diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-05 00:03:04 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-05 00:03:04 +0100 |
commit | 58dd684c4e86944301959a140dbed9746df35779 (patch) | |
tree | a2702ea4f66b2a58711ee22eb7449c74b1ecf0d1 /linux | |
parent | First commit (diff) | |
download | libsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.gz libsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.bz2 libsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.xz |
Second commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | linux/download.mk | 2 | ||||
-rw-r--r-- | linux/errors.mk | 2 | ||||
-rw-r--r-- | linux/linux-support.mk | 4 | ||||
-rw-r--r-- | linux/signals.mk | 2 | ||||
-rw-r--r-- | linux/symbols.c | 14 | ||||
-rw-r--r-- | linux/symbols.mk | 2 | ||||
-rw-r--r-- | linux/syscall-table.mk | 2 | ||||
-rw-r--r-- | linux/syscalls.h | 2 | ||||
-rw-r--r-- | linux/syscalls.mk | 186 | ||||
-rw-r--r-- | linux/types.mk | 2 |
10 files changed, 118 insertions, 100 deletions
diff --git a/linux/download.mk b/linux/download.mk index 31da0b1..5555074 100644 --- a/linux/download.mk +++ b/linux/download.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + LINUX_MIRROR = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot LINUX_TAREXT = tar.gz LINUX_TARBALL = $(LINUX_MIRROR)/linux-$(LINUX_VERSION).$(LINUX_TAREXT) diff --git a/linux/errors.mk b/linux/errors.mk index b6b7197..f69bf73 100644 --- a/linux/errors.mk +++ b/linux/errors.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + libsyscalls_get_syscall_errors.o: generated/linux-errors.h linux/errors.c libsyscalls_get_syscall_errors.lo: generated/linux-errors.h linux/errors.c diff --git a/linux/linux-support.mk b/linux/linux-support.mk index 5efeafe..d596922 100644 --- a/linux/linux-support.mk +++ b/linux/linux-support.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + LINUX_VERSION = 6.6 # Changing this number can potentially break the build, # silently or violently, so make sure everything still @@ -35,6 +37,8 @@ NPARAMS += 8 SUPPORTED_LINUX_ARCHES != printf '%s\n' $(SUPPORTED_LINUX_ARCHES) $(SUPPORTED_ARCHES) | sort | uniq -d +TEST_ENV += SUPPORTED_LINUX_ARCHES="$(SUPPORTED_LINUX_ARCHES)" + include linux/download.mk include linux/errors.mk diff --git a/linux/signals.mk b/linux/signals.mk index f7a8a45..8fb9f07 100644 --- a/linux/signals.mk +++ b/linux/signals.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + libsyscalls_get_signals.o: generated/linux-signals.h linux/signals.c libsyscalls_get_signals.lo: generated/linux-signals.h linux/signals.c diff --git a/linux/symbols.c b/linux/symbols.c index d91880f..cbc61f5 100644 --- a/linux/symbols.c +++ b/linux/symbols.c @@ -47,13 +47,13 @@ extract_linux_symbol_mode(struct libsyscalls_symbol_printer_data *data, unsigned if (value & 07) goto digits1; if (0) { digits4: - data->buf[i++] = '0' | (value & 07000); + data->buf[i++] = '0' | ((value / 01000) & 7); digits3: - data->buf[i++] = '0' | (value & 0700); + data->buf[i++] = '0' | ((value / 0100) & 7); digits2: - data->buf[i++] = '0' | (value & 070); + data->buf[i++] = '0' | ((value / 010) & 7); digits1: - data->buf[i++] = '0' | (value & 07); + data->buf[i++] = '0' | ((value / 01) & 7); } data->buf[i++] = ' '; data->buf[i++] = '('; @@ -95,11 +95,11 @@ extract_linux_symbol_umask(struct libsyscalls_symbol_printer_data *data, unsigne if (value & 07) goto digits1; if (0) { digits3: - data->buf[i++] = '0' | (value & 0700); + data->buf[i++] = '0' | ((value / 0700) & 7); digits2: - data->buf[i++] = '0' | (value & 070); + data->buf[i++] = '0' | ((value / 070) & 7); digits1: - data->buf[i++] = '0' | (value & 07); + data->buf[i++] = '0' | ((value / 07) & 7); } data->buf[i++] = ' '; data->buf[i++] = '('; diff --git a/linux/symbols.mk b/linux/symbols.mk index f045222..97db4ab 100644 --- a/linux/symbols.mk +++ b/linux/symbols.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + LINUX_SYMBOL_TABLES != sed -n 's/^.*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\+\)\b.*\$$\$$\$$.*\$$\$$\$$.*$$/\1/p' < linux/syscalls.h LINUX_SYMBOL_TABLE_FILES != printf 'linux-src/symbols-$(LINUX_VERSION)/%s\n' $(LINUX_SYMBOL_TABLES) diff --git a/linux/syscall-table.mk b/linux/syscall-table.mk index 3f0d944..1b993e6 100644 --- a/linux/syscall-table.mk +++ b/linux/syscall-table.mk @@ -1,3 +1,5 @@ +# See LICENSE file for copyright and license details. + OBJ += linux/syscall-table.o diff --git a/linux/syscalls.h b/linux/syscalls.h index 94d714e..ed278cd 100644 --- a/linux/syscalls.h +++ b/linux/syscalls.h @@ -31,7 +31,7 @@ enum { /* LIBSYSCALLS_SYMBOL_PRINTER */ LINUX_SYMBOL_PRINTER_FACCESSAT, /* $$ SYMBOLS(ATFD, ACCESS_OK) $$ */ LINUX_SYMBOL_PRINTER_FANOTIFY_MARK, /* $$ SYMBOLS(FAN_MARK, FAN) $$ */ LINUX_SYMBOL_PRINTER_3STATX, /* $$ SYMBOLS(ATFD, AT_STATX, STATX) $$ */ - + LINUX_SYMBOL_PRINTER_ITIMER, /* enum $$$ getdefs ITIMER < include/uapi/linux/time.h $$$ */ LINUX_SYMBOL_PRINTER_SEEK, /* enum $$$ getdefs SEEK < include/uapi/linux/fs.h $$$ */ LINUX_SYMBOL_PRINTER_EPOLL_CTL, /* enum $$$ getdefs EPOLL_CTL < include/uapi/linux/eventpoll.h $$$ */ diff --git a/linux/syscalls.mk b/linux/syscalls.mk index 7c13441..ddd1a63 100644 --- a/linux/syscalls.mk +++ b/linux/syscalls.mk @@ -1,13 +1,15 @@ +# 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_-]\+\)\.h\s*:.*$$/\1/p' && \ +LINUX_SYSCALLS_ARCHES_SIMPLE != (sed -n 's/^generated\/linux-syscalls\/\([a-zA-Z0-9_-]\+\)\.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_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) @@ -18,41 +20,41 @@ LINUX_SYSCALLS_HDR =\ $(LINUX_SYSCALLS_ARCH_HDR) -generated/linux-syscalls-alpha.h: $(LINUX_SYSCALL_DIR)/alpha.tbl linux/syscalls.mk - mkdir -p -- generated +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)/alpha.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/alpha.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/alpha.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 -- $(LINUX_SYSCALL_DIR)/amd64.tbl \ + cat -- $(@:.fixed=) \ | sed 's/\s\+\(getpmsg\|putpmsg\|afs_syscall\|tuxcall\|security\|vserver\)\s*$$/& sys_ni_syscall/' \ | sed 's/^\s*[0-9]\+\s\+[a-z0-9]\+\s\+\([A-Za-z0-9_]\+\)\s*$$/& sys_\1/' \ > $@ -generated/linux-syscalls-amd64.h: $(LINUX_SYSCALL_DIR)/amd64.tbl.fixed linux/syscalls.mk - mkdir -p -- generated +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)/amd64.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/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)/amd64.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \ | sed -n 's/\\\(common\|x32\)$$/\\/p' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/amd64.tbl.fixed | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/amd64.tbl.fixed | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }' | \ grep '^\(common\|64\|x32\)$$')" @@ -85,33 +87,33 @@ $(LINUX_SYSCALL_DIR)/arm.tbl.fixed: $(LINUX_SYSCALL_DIR)/arm.tbl linux/syscalls. 137 afs_syscall sys_afs_syscall \ 166 vm86 sys_vm86 \ 167 query_module sys_query_module \ - | cat -- $(LINUX_SYSCALL_DIR)/arm.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.fixed=) - \ | sed 's/\svserver\s*$$/& sys_ni_syscall/' \ | sed 's/\snfsservctl\s*$$/& sys_nfsservctl/' \ > $@ -generated/linux-syscalls-arm.h: $(LINUX_SYSCALL_DIR)/arm.tbl.fixed linux/syscalls.mk - mkdir -p -- generated +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)/arm.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/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)/arm.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/arm.tbl.fixed | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/arm.tbl.fixed | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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 \ @@ -120,16 +122,16 @@ generated/linux-syscalls-ia64.h: $(LINUX_SYSCALL_DIR)/ia64.tbl linux/syscalls.mk $$(( 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)/ia64.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX((" $$1 " + 1024), " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/ia64.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/ia64.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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 \ @@ -149,57 +151,57 @@ generated/linux-syscalls-m68k.h: $(LINUX_SYSCALL_DIR)/m68k.tbl linux/syscalls.mk 113 vm86 sys_vm86 \ 137 afs_syscall sys_ni_syscall \ 278 vserver sys_ni_syscall \ - | cat -- $(LINUX_SYSCALL_DIR)/m68k.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/m68k.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/m68k.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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(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)/microblaze.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/microblaze.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/microblaze.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/mips-n32.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-n32.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-n32.tbl | awk '{ print $$2 }' | grep '^n32$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/mips-n64.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-n64.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-n64.tbl | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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 \ @@ -207,14 +209,14 @@ generated/linux-syscalls-mips-o32.h: $(LINUX_SYSCALL_DIR)/mips-o32.tbl linux/sys 82 select sys_old_select \ 84 old_lstat sys_lstat \ 279 setaltroot sys_setaltroot \ - | cat -- $(LINUX_SYSCALL_DIR)/mips-o32.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*\(18\|28\|82\|84\)\s\+o32.*$$/d' \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\"}' \ | sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-o32.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/mips-o32.tbl | awk '{ print $$2 }' | grep '^o32$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 @@ -236,85 +238,85 @@ $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed: $(LINUX_SYSCALL_DIR)/parisc.tbl linux/sys 221 free_hugepages sys_free_hugepages \ 263 vserver sys_ni_syscall \ 303 timerfd sys_timerfd \ - | cat -- $(LINUX_SYSCALL_DIR)/parisc.tbl - > $@ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.fixed=) - > $@ -generated/linux-syscalls-parisc.h: $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed linux/syscalls.mk - mkdir -p -- generated +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)/parisc.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/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)/parisc.tbl.fixed \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed \ | sed '/^\s*\(\x23.*\)\?$$/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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl).fixed | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/powerpc.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/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)/powerpc.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/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)/powerpc.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/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)/powerpc.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \ | sed -n 's/\\\(common\|spu\)$$/\\/p' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/powerpc.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/powerpc.tbl | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/s390.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | sed 's/^\s*\([0-9]\+\)\s\+\([A-Za-z0-9_]\+\)\s\+\([A-Za-z0-9_]\+\)\s\+-\s\+-\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)/s390.tbl \ + cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | sed 's/^\s*\([0-9]\+\)\s\+\([A-Za-z0-9_]\+\)\s\+\([A-Za-z0-9_]\+\)\s\+-\s\+-\s*$$/\1 \2 \3 sys_\3 sys_\3/' \ | sed 's/^\s*\(89\)\s\+\(common\)\s\+\(readdir\)\s\+-\s\+/\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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/s390.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/s390.tbl | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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 \ @@ -341,16 +343,16 @@ generated/linux-syscalls-sh.h: $(LINUX_SYSCALL_DIR)/sh.tbl linux/syscalls.mk | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/sh.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/sh.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/sparc.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed 's/compat_sys_\(truncate64\|ftruncate64\)/sparc___&/g' \ | sed '/^\s*267\s\+common\s\+vserver\s\+.*$$/d' \ | sed '/^\s*\(\x23.*\)\?$$/d' \ @@ -361,48 +363,48 @@ generated/linux-syscalls-sparc.h: $(LINUX_SYSCALL_DIR)/sparc.tbl linux/syscalls. 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)/sparc.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed '/^\s*267\s\+common\s\+vserver\s\+.*$$/d' \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\" $$2}' \ | sed -n 's/\\\(common\|64\)$$/\\/p' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/sparc.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/sparc.tbl | awk '{ print $$2 }' | \ + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/x86.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed 's/\s\+\(break\|stty\|gtty\|ftime\|prof\|lock\|mpx\|ulimit\|profil\|idle\|afs_syscall\|getpmsg\|putpmsg\|vserver\)\s*$$/& sys_ni_syscall/' \ | sed 's/^\s*[0-9]\+\s\+[a-z0-9]\+\s\+\([A-Za-z0-9_]\+\)\s*$$/& sys_\1/' \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX_COMPAT(" $$1 ", " $$3 ", " $$4 ", " $$5 ") D\\"}' \ | sed 's/X_COMPAT(\(.*\), ) D\\$$/X(\1) D\\/' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/x86.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/x86.tbl | awk '{ print $$2 }' | grep '^i386$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/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 +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)/xtensa.tbl - \ + | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ | sed 's/reserved152\s\+sys_ni_syscall/set_thread_area sys_set_thread_area/' \ | sed 's/reserved153\s\+sys_ni_syscall/get_thread_area sys_get_thread_area/' \ | sed 's/nfsservctl\s\+sys_ni_syscall/nfsservctl sys_nfsservctl/' \ | sed '/^\s*\(\x23.*\)\?$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/xtensa.tbl | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/xtensa.tbl | awk '{ print $$2 }' | grep '^common$$')" + test "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ + "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | grep '^common$$')" $(LINUX_SYSCALLS_ARCH_TBL_SIMPLE): $(LINUX_SOURCE) linux/syscalls.mk diff --git a/linux/types.mk b/linux/types.mk index 0e27c13..0e10bee 100644 --- a/linux/types.mk +++ b/linux/types.mk @@ -1,2 +1,4 @@ +# See LICENSE file for copyright and license details. + libsyscalls_get_datatype_description.o: linux/types.c libsyscalls_get_datatype_description.lo: linux/types.c |