1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
# See LICENSE file for copyright and license details.
LINUX_SYSCALL_DIR = linux-src/syscalls-$(LINUX_VERSION)
LINUX_SYSCALLS_ARCH_TBL_SPLIT_X64 != printf '$(LINUX_SYSCALL_DIR)/%s.tbl\n' amd64 x86
LINUX_SYSCALLS_ARCH_TBL_SPLIT_MIPS != printf '$(LINUX_SYSCALL_DIR)/%s.tbl\n' mips-n32 mips-o32 mips-n64
LINUX_SYSCALLS_ARCHES_SPLIT != grep '^LINUX_SYSCALLS_ARCH_TBL_SPLIT_' < linux/syscalls.mk | cut -d \% -f 2 | cut -d ' ' -f 2-
LINUX_SYSCALLS_ARCHES_SIMPLE != (sed -n 's/^generated\/linux-syscalls\/\([a-zA-Z0-9_-]\{1,\}\)\.h$(s)*:.*$$/\1/p' && \
printf '%s\n' $(LINUX_SYSCALLS_ARCHES_SPLIT)) < linux/syscalls.mk | sort | uniq -u
LINUX_SYSCALLS_ARCHES = $(LINUX_SYSCALLS_ARCHES_SIMPLE) $(LINUX_SYSCALLS_ARCHES_SPLIT)
LINUX_SYSCALLS_ARCH_HDR != printf 'generated/linux-syscalls/%s.h\n' $(LINUX_SYSCALLS_ARCHES)
LINUX_SYSCALLS_ARCH_TBL_SIMPLE != printf '$(LINUX_SYSCALL_DIR)/%s.tbl\n' $(LINUX_SYSCALLS_ARCHES_SIMPLE)
LINUX_SYSCALLS_ARCH_TBL_SPLIT != printf '$(LINUX_SYSCALL_DIR)/%s.tbl\n' $(LINUX_SYSCALLS_ARCHES_SPLIT)
LINUX_SYSCALLS_ARCH_TBL = $(LINUX_SYSCALLS_ARCH_TBL_SIMPLE) $(LINUX_SYSCALLS_ARCH_TBL_SPLIT)
LINUX_SYSCALLS_HDR =\
generated/linux-syscalls.h\
generated/linux-syscall-ranges.h\
$(LINUX_SYSCALLS_ARCH_HDR)
generated/linux-syscalls/alpha.h: $(LINUX_SYSCALL_DIR)/alpha.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_ALPHA(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
320 idle sys_idle \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
$(LINUX_SYSCALL_DIR)/amd64.tbl.fixed: $(LINUX_SYSCALL_DIR)/amd64.tbl linux/syscalls.mk
cat -- $(@:.fixed=) \
| sed 's/$(s)\{1,\}\(getpmsg\|putpmsg\|afs_syscall\|tuxcall\|security\|vserver\)$(s)*$$/& sys_ni_syscall/' \
| sed 's/^$(s)*[0-9]\{1,\}$(s)\{1,\}[a-z0-9]\{1,\}$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)*$$/& sys_\1/' \
> $@
generated/linux-syscalls/amd64.h: $(LINUX_SYSCALL_DIR)/amd64.tbl.fixed linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_AMD64(X, _X_COMPAT, D)\\\n' > $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|64\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_AMD64_X32(X, _X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|x32\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }' | \
grep '^\(common\|64\|x32\)$$')"
$(LINUX_SYSCALL_DIR)/arm.tbl.fixed: $(LINUX_SYSCALL_DIR)/arm.tbl linux/syscalls.mk
printf '%i common %s %s\n' \
7 waitpid sys_waitpid \
17 break sys_break \
18 old_stat sys_stat \
28 old_fstat sys_fstat \
31 stty sys_stty \
32 gtty sys_gtty \
35 ftime sys_ftime \
44 prof sys_prof \
48 signal sys_signal \
53 lock sys_lock \
56 mpx sys_mpx \
58 ulimit sys_ulimit \
59 oldolduname sys_olduname \
68 sgetmask sys_sgetmask \
69 ssetmask sys_ssetmask \
84 old_lstat sys_lstat \
98 profil sys_profil \
101 ioperm sys_ioperm \
109 olduname sys_uname \
110 iopl sys_iopl \
112 idle sys_idle \
123 modify_ldt sys_modify_ldt \
127 create_module sys_create_module \
130 get_kernel_syms sys_get_kernel_syms \
137 afs_syscall sys_afs_syscall \
166 vm86 sys_vm86 \
167 query_module sys_query_module \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.fixed=) - \
| sed 's/$(s)vserver$(s)*$$/& sys_ni_syscall/' \
| sed 's/$(s)nfsservctl$(s)*$$/& sys_nfsservctl/' \
> $@
generated/linux-syscalls/arm.h: $(LINUX_SYSCALL_DIR)/arm.tbl.fixed linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_ARM_EABI(X, _X_COMPAT, D)\\\n' > $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|eabi\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_ARM_OABI(X, X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|oabi\)$$/\\/p' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }' | \
grep '^\(common\|oabi\|eabi\)$$')"
generated/linux-syscalls/ia64.h: $(LINUX_SYSCALL_DIR)/ia64.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_IA64(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
$$(( 1120 - 1024 )) old_stat sys_stat \
$$(( 1121 - 1024 )) old_lstat sys_lstat \
$$(( 1122 - 1024 )) old_fstat sys_fstat \
$$(( 1132 - 1024 )) create_module sys_create_module \
$$(( 1135 - 1024 )) get_kernel_syms sys_get_kernel_syms \
$$(( 1136 - 1024 )) query_module sys_query_module \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX((" $$1 " + 1024), " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
generated/linux-syscalls/m68k.h: $(LINUX_SYSCALL_DIR)/m68k.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_M68K(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
17 break sys_ni_syscall \
31 stty sys_ni_syscall \
32 gtty sys_ni_syscall \
35 ftime sys_ni_syscall \
44 prof sys_ni_syscall \
53 lock sys_ni_syscall \
56 mpx sys_ni_syscall \
58 ulimit sys_ni_syscall \
59 oldolduname sys_olduname \
98 profil sys_ni_syscall \
101 ioperm sys_ioperm \
109 olduname sys_uname \
110 iopl sys_iopl \
112 idle sys_idle \
113 vm86 sys_vm86 \
137 afs_syscall sys_ni_syscall \
278 vserver sys_ni_syscall \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
generated/linux-syscalls/microblaze.h: $(LINUX_SYSCALL_DIR)/microblaze.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_MICROBLAZE_32(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
251 set_zone_reclaim sys_set_zone_reclaim \
285 setaltroot sys_setaltroot \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
generated/linux-syscalls/mips-n32.h: $(LINUX_SYSCALL_DIR)/mips-n32.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_MIPS_N32(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
242 setaltroot sys_setaltroot \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^n32$$')"
generated/linux-syscalls/mips-n64.h: $(LINUX_SYSCALL_DIR)/mips-n64.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_MIPS_N64(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
238 setaltroot sys_setaltroot \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \
grep '^\(n64\|common\)$$')"
generated/linux-syscalls/mips-o32.h: $(LINUX_SYSCALL_DIR)/mips-o32.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_MIPS_O32(X, X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
18 old_stat sys_stat \
28 old_fstat sys_fstat \
82 select sys_old_select \
84 old_lstat sys_lstat \
279 setaltroot sys_setaltroot \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*\(18\|28\|82\|84\)$(s)\{1,\}o32.*$$/d' \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\"}' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^o32$$')"
$(LINUX_SYSCALL_DIR)/parisc.tbl.fixed: $(LINUX_SYSCALL_DIR)/parisc.tbl linux/syscalls.mk
printf '%i common %s %s\n' \
102 socketcall sys_socketcall \
127 create_module sys_create_module \
130 get_kernel_syms sys_get_kernel_syms \
137 afs_syscall sys_ni_syscall \
167 query_module sys_query_module \
169 nfsservctl sys_nfsservctl \
196 getpmsg sys_ni_syscall \
197 putpmsg sys_ni_syscall \
203 attrctl sys_attrctl \
204 acl_get sys_acl_get \
205 acl_set sys_acl_set \
213 set_thread_area sys_set_thread_area \
214 get_thread_area sys_get_thread_area \
220 alloc_hugepages sys_alloc_hugepages \
221 free_hugepages sys_free_hugepages \
263 vserver sys_ni_syscall \
303 timerfd sys_timerfd \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.fixed=) - > $@
generated/linux-syscalls/parisc.h: $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_PARISC_64(X, _X_COMPAT, D)\\\n' > $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|64\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_PARISC_32(X, X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|32\)$$/\\/p' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }' | \
grep '^\(common\|64\|32\)$$')"
generated/linux-syscalls/powerpc.h: $(LINUX_SYSCALL_DIR)/powerpc.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_POWERPC_32(X, X_COMPAT, D)\\\n' > $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|32\)$$/\\/p' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_POWERPC_NOSPU(X, X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|nospu\)$$/\\/p' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_POWERPC_64(X, _X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|64\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_POWERPC_SPU(X, _X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|spu\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \
grep '^\(common\|spu\|nospu\|64\|32\)$$')"
generated/linux-syscalls/s390.h: $(LINUX_SYSCALL_DIR)/s390.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_S390_32(X, _X_COMPAT, D)\\\n' > $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| sed 's/^$(s)*\([0-9]\{1,\}\)$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)\{1,\}-$(s)\{1,\}-$(s)*$$/\1 \2 \3 sys_\3 sys_\3/' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|32\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_S390_64(X, _X_COMPAT, D)\\\n' >> $@
cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| sed 's/^$(s)*\([0-9]\{1,\}\)$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)\{1,\}-$(s)\{1,\}-$(s)*$$/\1 \2 \3 sys_\3 sys_\3/' \
| sed 's/^$(s)*\(89\)$(s)\{1,\}\(common\)$(s)\{1,\}\(readdir\)$(s)\{1,\}-$(s)\{1,\}/\1 \2 \3 sys_old_readdir /' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|64\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \
grep '^\(common\|32\|64\)$$')"
generated/linux-syscalls/sh.h: $(LINUX_SYSCALL_DIR)/sh.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_SH(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
17 break sys_ni_syscall \
31 stty sys_ni_syscall \
32 gtty sys_ni_syscall \
35 ftime sys_ni_syscall \
44 prof sys_ni_syscall \
53 lock sys_ni_syscall \
56 mpx sys_ni_syscall \
58 ulimit sys_ni_syscall \
59 oldolduname sys_olduname \
82 select sys_old_select \
98 profil sys_ni_syscall \
101 ioperm sys_ioperm \
110 iopl sys_iopl \
112 idle sys_idle \
113 vm86old sys_vm86old \
127 create_module sys_create_module \
130 get_kernel_syms sys_get_kernel_syms \
137 afs_syscall sys_ni_syscall \
166 vm86 sys_vm86 \
167 query_module sys_query_module \
| cat -- $(LINUX_SYSCALL_DIR)/sh.tbl - \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
generated/linux-syscalls/sparc.h: $(LINUX_SYSCALL_DIR)/sparc.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_SPARC_32(X, X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
267 vserver sys_vserver \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed 's/compat_sys_\(truncate64\|ftruncate64\)/sparc___&/g' \
| sed '/^$(s)*267$(s)\{1,\}common$(s)\{1,\}vserver$(s)\{1,\}.*$$/d' \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\" $$2}' \
| sed -n 's/\\\(common\|32\)$$/\\/p' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
printf '\n\43define LIST_LINUX_SYSCALLS_FOR_SPARC_64(X, _X_COMPAT, D)\\\n' >> $@
printf '%i common %s %s\n' \
267 vserver sys_vserver \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed '/^$(s)*267$(s)\{1,\}common$(s)\{1,\}vserver$(s)\{1,\}.*$$/d' \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \
| sed -n 's/\\\(common\|64\)$$/\\/p' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \
grep '^\(common\|32\|64\)$$')"
generated/linux-syscalls/x86.h: $(LINUX_SYSCALL_DIR)/x86.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_I386(X, X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
251 set_zone_reclaim sys_set_zone_reclaim \
285 setaltroot sys_setaltroot \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed 's/$(s)\{1,\}\(break\|stty\|gtty\|ftime\|prof\|lock\|mpx\|ulimit\|profil\|idle\|afs_syscall\|getpmsg\|putpmsg\|vserver\)$(s)*$$/& sys_ni_syscall/' \
| sed 's/^$(s)*[0-9]\{1,\}$(s)\{1,\}[a-z0-9]\{1,\}$(s)\{1,\}\([A-Za-z0-9_]\{1,\}\)$(s)*$$/& sys_\1/' \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\"}' \
| sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^i386$$')"
generated/linux-syscalls/xtensa.h: $(LINUX_SYSCALL_DIR)/xtensa.tbl linux/syscalls.mk
mkdir -p -- generated/linux-syscalls
printf '\43define LIST_LINUX_SYSCALLS_FOR_XTENSA(X, _X_COMPAT, D)\\\n' > $@
printf '%i common %s %s\n' \
305 timerfd sys_timerfd \
| cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \
| sed 's/reserved152$(s)\{1,\}sys_ni_syscall/set_thread_area sys_set_thread_area/' \
| sed 's/reserved153$(s)\{1,\}sys_ni_syscall/get_thread_area sys_get_thread_area/' \
| sed 's/nfsservctl$(s)\{1,\}sys_ni_syscall/nfsservctl sys_nfsservctl/' \
| sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \
| awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \
| sed '$$s/ D\\$$//' >> $@
test "$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \
"$$(sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')"
$(LINUX_SYSCALLS_ARCH_TBL_SIMPLE): $(LINUX_SOURCE) linux/syscalls.mk
mkdir -p -- $(LINUX_SYSCALL_DIR)
arch="$$(printf '%s\n' "$(@F)" | cut -d . -f 1)"; \
if test "$$arch" = arm; then \
printf '%s\n' "ln -sf -- ../tools $(LINUX_DIR)/arch/$$arch/kernel/syscalls" && \
ln -sf -- ../tools $(LINUX_DIR)/arch/$$arch/kernel/syscalls || exit 1; \
fi && \
printf '%s\n' "cp -- $(LINUX_DIR)/arch/$$arch/kernel/syscalls/syscall.tbl $@" && \
cp -- $(LINUX_DIR)/arch/$$arch/kernel/syscalls/syscall.tbl $@
$(LINUX_SYSCALLS_ARCH_TBL_SPLIT_X64): $(LINUX_SOURCE) linux/syscalls.mk
mkdir -p -- $(LINUX_SYSCALL_DIR)
test -e $(LINUX_DIR)/arch/x86/kernel/syscalls || \
ln -sf -- ../entry/syscalls $(LINUX_DIR)/arch/x86/kernel/syscalls
cp -- $(LINUX_DIR)/arch/x86/kernel/syscalls/syscall_32.tbl $(LINUX_SYSCALL_DIR)/x86.tbl
cp -- $(LINUX_DIR)/arch/x86/kernel/syscalls/syscall_64.tbl $(LINUX_SYSCALL_DIR)/amd64.tbl
$(LINUX_SYSCALLS_ARCH_TBL_SPLIT_MIPS): $(LINUX_SOURCE) linux/syscalls.mk
mkdir -p -- $(LINUX_SYSCALL_DIR)
cp -- $(LINUX_DIR)/arch/mips/kernel/syscalls/syscall_n32.tbl $(LINUX_SYSCALL_DIR)/mips-n32.tbl
cp -- $(LINUX_DIR)/arch/mips/kernel/syscalls/syscall_o32.tbl $(LINUX_SYSCALL_DIR)/mips-o32.tbl
cp -- $(LINUX_DIR)/arch/mips/kernel/syscalls/syscall_n64.tbl $(LINUX_SYSCALL_DIR)/mips-n64.tbl
generated/linux-syscall-dedup.h: $(HDR) $(LINUX_SYSCALLS_HDR) linux/syscalls.h linux/syscall-table.c linux/syscalls.mk
mkdir -p -- generated
cpp -DCREATING_DEDUP_TABLE linux/syscall-table.c \
| grep -v '^#' \
| tr '\n;\t' ' \n ' \
| sed -n 's/^.* libsyscalls_syscall \{1,\}\(linux_[A-Z0-9a-z_]\{1,\}_syscall_[A-Z0-9a-z_]\{1,\}.*\)$$/\1/p' \
| tr -d ' ' \
| sed 's/=/ /' \
| sort -k 2 \
| (set -e; master=; mastertext=; \
while read slave slavetext; do \
if test "$$slavetext" = "$$mastertext"; then \
printf '#define %s %s\n' "$$slave" "$$master"; \
else \
master="$$slave"; \
mastertext="$$slavetext"; \
fi; \
done \
) > $@
printf '\43define linux_%s_syscalls_table\n' $(SUPPORTED_LINUX_ARCHES) \
| sed -n 's/ linux_\(.*\)_[LB]E_syscalls_table/& linux_\1_syscalls_table/p' >> $@
|