diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
commit | 9f449569df9c94670f51fd8cd5558b66884cd877 (patch) | |
tree | 21d3c31e22b2cd0544351584c8614e70b66826e4 /linux | |
parent | Fourth commit (diff) | |
download | libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.gz libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.bz2 libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.xz |
Improve portability
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | linux/errors.mk | 6 | ||||
-rw-r--r-- | linux/signals.mk | 18 | ||||
-rw-r--r-- | linux/symbols.mk | 18 | ||||
-rw-r--r-- | linux/syscall-table.mk | 8 | ||||
-rw-r--r-- | linux/syscalls.h | 8 | ||||
-rw-r--r-- | linux/syscalls.mk | 146 |
6 files changed, 102 insertions, 102 deletions
diff --git a/linux/errors.mk b/linux/errors.mk index f69bf73..b34258a 100644 --- a/linux/errors.mk +++ b/linux/errors.mk @@ -17,7 +17,7 @@ generated/linux-errors.tbl: $(LINUX_SOURCE) linux/errors.mk printf '%s\n' "$$file"; \ done \ done \ - ) | grep '/\(gcc\|clang\)\(-[0-9.]\+\)\?$$'; \ + ) | grep '/\(gcc\|clang\)\(-[0-9.]\{1,\}\)\{0,1\}$$'; \ printf '%s\n' gcc; \ ) | sed 1q; \ }; \ @@ -27,7 +27,7 @@ generated/linux-errors.tbl: $(LINUX_SOURCE) linux/errors.mk { \ ($$extract "-I$$toolsdir/include/uapi" "$$2" && \ cat -- "linux-src/linux-$(LINUX_VERSION)/include/linux/errno.h") \ - | sed -n 's/^\s*\x23\s*define\s\+\(E[^\s]\+\)\s\+\([0-9]\+\)\s*\(\/.*\)\?$$/'"$$1"' \2 \1/p' \ + | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}\(E[^[:space:]]\{1,\}\)$(s)\{1,\}\([0-9]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/'"$$1"' \2 \1/p' \ | sort -k 2 -nu; \ }; \ for arch in $$(printf '%s\n' "$$toolsdir/arch"/*/ | sed 's:^.*/\([^/]*\)/$$:\1:'); do \ @@ -43,7 +43,7 @@ generated/linux-errors.h: generated/linux-errors.tbl linux/errors.mk for arch in $$(cut -d ' ' -f 1 < generated/linux-errors.tbl | uniq); do \ ARCH="$$(printf '%s\n' "$$arch" | tr '[a-z]' '[A-Z]')"; \ printf '#define LIST_LINUX_ERRORS_FOR_%s(X, D)\\\n' "$$ARCH"; \ - sed -n 's/^'"$$arch"' \([0-9]\+\) \(.*\)$$/\tX(\1, "\2") D\\/p' \ + sed -n 's/^'"$$arch"' \([0-9]\{1,\}\) \(.*\)$$/\tX(\1, "\2") D\\/p' \ < generated/linux-errors.tbl \ | sed '$$s/ D\\//'; \ printf 'static struct libsyscalls_named_number linux_errors_for_%s[] = {\n' "$$arch"; \ diff --git a/linux/signals.mk b/linux/signals.mk index 8fb9f07..4bb8812 100644 --- a/linux/signals.mk +++ b/linux/signals.mk @@ -17,7 +17,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk printf '%s\n' "$$file"; \ done \ done \ - ) | grep '/\(gcc\|clang\)\(-[0-9.]\+\)\?$$'; \ + ) | grep '/\(gcc\|clang\)\(-[0-9.]\{1,\}\)\{0,1\}$$'; \ printf '%s\n' gcc; \ ) | sed 1q; \ }; \ @@ -40,17 +40,17 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk set -e; \ signals="$$( \ $$extract "-I$$srcdir/tools/include" $$fixes "$$2" \ - | sed -n 's/^\s*\x23\s*define\s\+\(SIG[^\s]\+\)\s\+\([0-9]\+\)\s*\(\/.*\)\?$$/'"$$1"' \2 \1/p' \ + | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}\(SIG[^[:space:]]\{1,\}\)$(s)\{1,\}\([0-9]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/'"$$1"' \2 \1/p' \ | grep -v ' SIG_' \ | grep -v ' SIGSTKSZ' \ | sort -k 2 -nu; \ )"; \ if test "$$1" = arm; then \ - signals="$$(printf "%s\n" "$$signals" | sed 's/\bSIGSWI\b/SIGRTMIN/')"; \ + signals="$$(printf "%s\n" "$$signals" | sed 's/\(^\|[^A-Z0-9a-z_]\)SIGSWI\([^A-Z0-9a-z_]\|$$\)/\1SIGRTMIN\2/')"; \ fi; \ printf "%s\n" "$$signals"; \ - sigrtmin="$$(printf "%s\n" "$$signals" | sed -n 's/^.* \([0-9]\+\) SIGRTMIN$$/\1/p')"; \ - maxnamed="$$(printf "%s\n" "$$signals" | sed -n '$$s/^.* \([0-9]\+\) .*$$/\1/p')"; \ + sigrtmin="$$(printf "%s\n" "$$signals" | sed -n 's/^.* \([0-9]\{1,\}\) SIGRTMIN$$/\1/p')"; \ + maxnamed="$$(printf "%s\n" "$$signals" | sed -n '$$s/^.* \([0-9]\{1,\}\) .*$$/\1/p')"; \ test "$$sigrtmin" = "$$maxnamed"; \ maxsig=_NSIG; \ depth=0; \ @@ -58,7 +58,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk printf '%s: looking for %s\n' "$$1" "$$maxsig" >&2; \ def="$$maxsig"; \ maxsig="$$($$extract "-I$$srcdir/tools/include" $$fixes "$$2" \ - | sed -n 's/^\s*\x23\s*define\s\+'"$$def"'\s\+\([A-Z0-9_]\+\)\s*\(\/.*\)\?$$/\1/p')"; \ + | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$def"'$(s)\{1,\}\([A-Z0-9_]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/\1/p')"; \ if test -z "$$maxsig"; then \ maxsig="$$($$extract "-I$$srcdir/tools/include" \ "-I$$srcdir/arch/$$1/include" \ @@ -66,7 +66,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk "-I$$srcdir" \ $$fixes \ "$$(printf '%s\n' "$$2" | sed 's:/uapi/:/:')" \ - | sed -n 's/^\s*\x23\s*define\s\+'"$$def"'\s\+\([A-Z0-9_]\+\)\s*\(\/.*\)\?$$/\1/p')"; \ + | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$def"'$(s)\{1,\}\([A-Z0-9_]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/\1/p')"; \ fi; \ printf '%s: found %s\n' "$$1" "$$maxsig" >&2; \ : $$(( depth++ )); \ @@ -80,7 +80,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk done; \ }; \ getsigs () { \ - process_arch "$$@" | sed 's/\bSIGRTMIN\b/_&/'; \ + process_arch "$$@" | sed 's/\(^\|[^A-Z0-9a-z_]\)\(SIGRTMIN\)\([^A-Z0-9a-z_]\|$$\)/\1_\2\3/'; \ }; \ for arch in $$(printf '%s\n' "$$srcdir/arch"/*/ | sed 's:^.*/\([^/]*\)/$$:\1:'); do \ if test ! "$$arch" = s390 && test -f "$$srcdir/arch/$$arch/include/uapi/asm/signal.h"; then \ @@ -129,7 +129,7 @@ generated/linux-signals.h: generated/linux-signals.tbl linux/signals.mk for arch in $$(cut -d ' ' -f 1 < generated/linux-signals.tbl | uniq); do \ ARCH="$$(printf '%s\n' "$$arch" | tr '[a-z]' '[A-Z]')"; \ printf '#define LIST_LINUX_SIGNALS_FOR_%s(X, D)\\\n' "$$ARCH"; \ - sed -n 's/^'"$$arch"' \([0-9]\+\) \(.*\)$$/\tX(\1, "\2") D\\/p' \ + sed -n 's/^'"$$arch"' \([0-9]\{1,\}\) \(.*\)$$/\tX(\1, "\2") D\\/p' \ < generated/linux-signals.tbl \ | sed '$$s/ D\\//'; \ printf 'static struct libsyscalls_named_number linux_signals_for_%s[] = {\n' "$$arch"; \ diff --git a/linux/symbols.mk b/linux/symbols.mk index 97db4ab..ffdad11 100644 --- a/linux/symbols.mk +++ b/linux/symbols.mk @@ -1,6 +1,6 @@ # 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_TABLES != sed -n 's/^.*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\{1,\}\)\([^A-Za-z0-9_].*\)*\$$\$$\$$.*\$$\$$\$$.*$$/\1/p' < linux/syscalls.h LINUX_SYMBOL_TABLE_FILES != printf 'linux-src/symbols-$(LINUX_VERSION)/%s\n' $(LINUX_SYMBOL_TABLES) @@ -28,7 +28,7 @@ libsyscalls_get_syscall_display_info.lo: generated/linux-symbol-extractors.h lin $(LINUX_SYMBOL_TABLE_FILES): $(LINUX_SYMBOL_TABLE_DEPS) mkdir -p -- linux-src/symbols-$(LINUX_VERSION) table="$$(printf '%s\n' "$@" | tr / '\n' | sed -n '$$p')" && \ - command="$$(sed -n 's/^.*LINUX_SYMBOL_PRINTER_'"$$table"'\b.*\$$\$$\$$\s*\(.*\)\s*\$$\$$\$$.*$$/\1/p' < linux/syscalls.h)" && \ + command="$$(sed -n 's/^.*LINUX_SYMBOL_PRINTER_'"$$table"'\([^A-Za-z0-9_].*\)*\$$\$$\$$$(s)*\(.*\)$(s)*\$$\$$\$$.*$$/\2/p' < linux/syscalls.h)" && \ test -n "$$command" && \ printf '%s\n' "$$command" && \ (cd -- linux-src/linux-$(LINUX_VERSION) && env PATH="../../util:$${PATH}" sh -e -c "$$command") > $@ @@ -39,30 +39,30 @@ generated/linux-symbol-extractors.h: $(LINUX_SYMBOL_EXTRACTOR_DEPS) for tablefile in $(LINUX_SYMBOL_TABLE_FILES); do \ tablename="$$(printf '%s\n' "$$tablefile" | cut -d / -f 3)"; \ how="$$(sed -n < linux/syscalls.h \ - 's/^.*LINUX_SYMBOL_PRINTER_'"$$tablename"'\b.*\/\*\s*\(.*\)\s*\$$\$$\$$.*\$$\$$\$$.*$$/\1/p')"; \ + 's/^.*LINUX_SYMBOL_PRINTER_'"$$tablename"'\([^A-Za-z0-9_].*\)*\/\*$(s)*\(.*\)$(s)*\$$\$$\$$.*\$$\$$\$$.*$$/\2/p')"; \ printf '\n'; \ util/make-sym-extractor "$$tablename" "$$how" < "$$tablefile"; \ done > $@.tmp set -e; \ - pattern='\s\+LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\+\)\s*'; \ + pattern='$(s)\{1,\}LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\{1,\}\)$(s)*'; \ funcprefix='extract_linux_symbol_'; \ - sed -n 's/^\s*\x23\s*define'"$$pattern$$pattern"'\(\/.*\)\?$$/\x23define '$$funcprefix'\1 '$$funcprefix'\2/p' \ + sed -n 's/^$(s)*$(h)$(s)*define'"$$pattern$$pattern"'\(\/.*\)\{0,1\}$$/$(h)define '$$funcprefix'\1 '$$funcprefix'\2/p' \ < linux/syscalls.h | tr '[A-Z]' '[a-z]' > $@ storage_and_rettype="$$(sed '/^$$/d' < $@.tmp | sed 1q | sed 's/\*/\\\*/g' | sed 's/[^\*]$$/& /')"; \ sed -n 's/^extract_symbol_.*/'"$${storage_and_rettype}"'&;/p' < $@.tmp | cat - $@.tmp >> $@ -rm -f -- $@.tmp set -e; \ sed 's/, */ /g' < linux/syscalls.h \ - | sed -n 's/^.*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\+\)\b.*[^$$]\$$\$$\s*SYMBOLS(\(.*\))\s*\$$\$$[^$$].*$$/\1 \2/p' \ + | sed -n 's/^.*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\{1,\}\)\([^A-Za-z0-9_].*[^$$]\|[^A-Za-z0-9_$$]\)\$$\$$$(s)*SYMBOLS(\(.*\))$(s)*\$$\$$[^$$].*$$/\1 \3/p' \ | while read line; do \ printf '\n'; \ util/make-multiextractor $$line; \ done >> $@ printf '\n\43define LIST_LINUX_EXTRACTORS(X, D)\\\n' >> $@ set -e; \ - phonies="$$(sed -n '/\$$\$$\$$\s*BEGIN\s\+PHONIES\s*\$$\$$\$$/,/\$$\$$\$$\s*END\s\+PHONIES\s*\$$\$$\$$/p' < linux/syscalls.h \ - | sed -n 's/^\s*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\+\)\b.*$$/\1/p')"; \ - sed -n 's/^extract_symbol_\([^)]*\)(.*)\s*\/\*\s*\([0-9]\+\)\s*\*\/\s*$$/\1 \2/p' < $@ \ + phonies="$$(sed -n '/\$$\$$\$$$(s)*BEGIN$(s)\{1,\}PHONIES$(s)*\$$\$$\$$/,/\$$\$$\$$$(s)*END$(s)\{1,\}PHONIES$(s)*\$$\$$\$$/p' < linux/syscalls.h \ + | sed -n 's/^$(s)*LINUX_SYMBOL_PRINTER_\([A-Z0-9_]\{1,\}\)\([^A-Za-z0-9_].*\)*$$/\1/p')"; \ + sed -n 's/^extract_symbol_\([^)]*\)(.*)$(s)*\/\*$(s)*\([0-9]\{1,\}\)$(s)*\*\/$(s)*$$/\1 \2/p' < $@ \ | while read name n; do \ if ! printf '%s\n' "$$phonies" | grep -i \^"$$name"\$$ > /dev/null; then \ printf '\tX(LINUX_SYMBOL_PRINTER_%s, extract_symbol_%s, %i) D\\\n' \ diff --git a/linux/syscall-table.mk b/linux/syscall-table.mk index 1b993e6..7e6fb1a 100644 --- a/linux/syscall-table.mk +++ b/linux/syscall-table.mk @@ -12,7 +12,7 @@ libsyscalls_get_syscall_range.lo: $(LINUX_SYSCALLS_HDR) generated/linux-syscall-table.h: linux/syscall-table.c common.h linux/linux-support.mk set -e; \ - macros="$$(sed -n 's/^\s*\x23\s*define\s\+MAKE_\([^(]*\)(.*$$/\1/p' < linux/syscall-table.c)"; \ + macros="$$(sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}MAKE_\([^(]*\)(.*$$/\1/p' < linux/syscall-table.c)"; \ for arch in $(SUPPORTED_LINUX_ARCHES); do \ for macro in $$macros; do \ printf '\43define MAKE_%s_%s(...) MAKE_%s(%s, __VA_ARGS__)\n' \ @@ -32,9 +32,9 @@ generated/linux-syscall-ranges.h: $(LINUX_SYSCALLS_ARCH_HDR) printf '%s\n' 'This may take some time ...'; \ set -e; arch=; \ cat -- $(LINUX_SYSCALLS_ARCH_HDR) \ - | sed 's/^\s*X[A-Z_]*(\([^,]*\).*$$/\1/' \ - | sed 's/\x23\s*define\s\+LIST_LINUX_SYSCALLS_FOR_\(.*\)(.*/\1/' \ - | sed '/^\s*$$/d' \ + | sed 's/^$(s)*X[A-Z_]*(\([^,]*\).*$$/\1/' \ + | sed 's/$(h)$(s)*define$(s)\{1,\}LIST_LINUX_SYSCALLS_FOR_\(.*\)(.*/\1/' \ + | sed '/^$(s)*$$/d' \ | (\ while read line; do \ if test -z "$$(printf '%s\n' "$$line" | sed 's/^[A-Z].*$$//')"; then \ diff --git a/linux/syscalls.h b/linux/syscalls.h index e11120f..f55dac5 100644 --- a/linux/syscalls.h +++ b/linux/syscalls.h @@ -39,7 +39,7 @@ enum { /* LIBSYSCALLS_SYMBOL_PRINTER */ LINUX_SYMBOL_PRINTER_SHUT, /* enum $$$ getenum sock_shutdown_cmd < include/linux/net.h $$$ */ LINUX_SYMBOL_PRINTER_FADVISE, /* enum $$$ getdefs FADV POSIX_FADV < include/uapi/linux/fadvise.h $$$ */ LINUX_SYMBOL_PRINTER_ADJTIMEX, /* enum $$$ getdefs TIME < include/uapi/linux/timex.h $$$ */ - LINUX_SYMBOL_PRINTER_IPC_KEY, /* enum $$$ grep IPC_PRIVATE < include/uapi/linux/ipc.h | sed 's/(\s*\(__kernel_\)\?key_t\s*)//g' | getdefs IPC $$$ */ + LINUX_SYMBOL_PRINTER_IPC_KEY, /* enum $$$ grep IPC_PRIVATE < include/uapi/linux/ipc.h | sed 's/([[:space:]]*\(__kernel_\)\{0,1\}key_t[[:space:]]*)//g' | getdefs IPC $$$ */ LINUX_SYMBOL_PRINTER_ATFD, /* enum $$$ getdefs AT < tools/include/uapi/linux/fcntl.h | grep '^AT_FDCWD ' $$$ */ LINUX_SYMBOL_PRINTER_MSGCTL, /* IPCCTL,enum $$$ sed '1,/ctl commands/d;/ctl commands/d;/^\//q' < include/uapi/linux/msg.h | getdefs MSG $$$ */ LINUX_SYMBOL_PRINTER_SHMCTL, /* IPCCTL,enum $$$ sed '1,/ctl commands/d;/ctl commands/d;/^\//q' < include/uapi/linux/shm.h | getdefs SHM $$$ */ @@ -53,8 +53,8 @@ enum { /* LIBSYSCALLS_SYMBOL_PRINTER */ LINUX_SYMBOL_PRINTER_GRND, /* mask $$$ getdefs GRND < include/uapi/linux/random.h $$$ */ LINUX_SYMBOL_PRINTER_CLOSE_RANGE, /* mask $$$ getdefs CLOSE_RANGE < include/uapi/linux/close_range.h $$$ */ LINUX_SYMBOL_PRINTER_FSOPEN, /* mask $$$ getdefs FSOPEN < include/uapi/linux/mount.h $$$ */ - LINUX_SYMBOL_PRINTER_LOCK, /* mask $$$ getdefs LOCK < include/uapi/asm-generic/fcntl.h | grep -v '^LOCK_RW '; ! cat arch'/'*\/include/uapi/asm/fcntl.h | grep \\sLOCK_ > /dev/null $$$ */ - LINUX_SYMBOL_PRINTER_RWF, /* mask $$$ sed 's/(\s*__force\s\+__kernel_rwf_t\s*)//' < include/uapi/linux/fs.h | getdefs RWF $$$ */ + LINUX_SYMBOL_PRINTER_LOCK, /* mask $$$ getdefs LOCK < include/uapi/asm-generic/fcntl.h | grep -v '^LOCK_RW '; ! cat arch'/'*\/include/uapi/asm/fcntl.h | grep \[[:space:]]LOCK_ > /dev/null $$$ */ + LINUX_SYMBOL_PRINTER_RWF, /* mask $$$ sed 's/([[:space:]]*__force[[:space:]]\{1,\}__kernel_rwf_t[[:space:]]*)//' < include/uapi/linux/fs.h | getdefs RWF $$$ */ LINUX_SYMBOL_PRINTER_STATX, /* mask $$$ getdefs STATX < include/uapi/linux/stat.h | grep -v '^STATX_\(BASIC_STATS \|ALL \|ATTR_\)' $$$ */ LINUX_SYMBOL_PRINTER_FALLOC, /* mask $$$ getdefs FALLOC_FL < include/uapi/linux/falloc.h $$$ */ LINUX_SYMBOL_PRINTER_AT, /* mask $$$ grep '\(AT_EMPTY_PATH\|AT_SYMLINK_NOFOLLOW\)' < include/uapi/linux/fcntl.h | getdefs AT $$$ */ @@ -70,7 +70,7 @@ enum { /* LIBSYSCALLS_SYMBOL_PRINTER */ LINUX_SYMBOL_PRINTER_AT_STATX, /* AT_AUTOMOUNT|mask $$$ getdefs AT_STATX < include/uapi/linux/fcntl.h | grep -v '^AT_STATX_SYNC_TYPE ' $$$ */ LINUX_SYMBOL_PRINTER_RECVM, /* RECV|mask $$$ getdefs MSG < include/linux/socket.h | grep '^MSG_WAITFORONE ' $$$ */ LINUX_SYMBOL_PRINTER_SENDM, /* SEND|mask $$$ getdefs MSG < include/linux/socket.h | grep '^MSG_BATCH ' $$$ */ - LINUX_SYMBOL_PRINTER_MSGRCV, /* IPC_NOWAIT|mask $$$ grep '^.*\s0[0-9a-fA-FxulUL]*\s*\(/.*\)\?$' < include/uapi/linux/msg.h | getdefs MSG $$$ */ + LINUX_SYMBOL_PRINTER_MSGRCV, /* IPC_NOWAIT|mask $$$ grep '^.*[[:space:]]0[0-9a-fA-FxulUL]*[[:space:]]*\(/.*\)\{0,1\}$' < include/uapi/linux/msg.h | getdefs MSG $$$ */ LINUX_SYMBOL_PRINTER_SCHEDULER_SET, /* SCHEDULER|mask $$$ grep '0x' < include/uapi/linux/sched.h | getdefs SCHED | grep -v '^SCHED_FLAG_' $$$ */ /* arch dependent (TODO -- don't forget to remove #define from top of symbols.c) */ diff --git a/linux/syscalls.mk b/linux/syscalls.mk index ddd1a63..de748b3 100644 --- a/linux/syscalls.mk +++ b/linux/syscalls.mk @@ -6,7 +6,7 @@ LINUX_SYSCALLS_ARCH_TBL_SPLIT_X64 != printf '$(LINUX_SYSCALL_DIR)/%s.tbl\n' amd6 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_-]\{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) @@ -26,35 +26,35 @@ generated/linux-syscalls/alpha.h: $(LINUX_SYSCALL_DIR)/alpha.tbl linux/syscalls. printf '%i common %s %s\n' \ 320 idle sys_idle \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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\+\(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/' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\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 }' | \ + 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\)$$')" @@ -88,27 +88,27 @@ $(LINUX_SYSCALL_DIR)/arm.tbl.fixed: $(LINUX_SYSCALL_DIR)/arm.tbl linux/syscalls. 166 vm86 sys_vm86 \ 167 query_module sys_query_module \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.fixed=) - \ - | sed 's/\svserver\s*$$/& sys_ni_syscall/' \ - | sed 's/\snfsservctl\s*$$/& sys_nfsservctl/' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\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 }' | \ + 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\)$$')" @@ -123,11 +123,11 @@ generated/linux-syscalls/ia64.h: $(LINUX_SYSCALL_DIR)/ia64.tbl linux/syscalls.mk $$(( 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*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX((" $$1 " + 1024), " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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 @@ -152,11 +152,11 @@ generated/linux-syscalls/m68k.h: $(LINUX_SYSCALL_DIR)/m68k.tbl linux/syscalls.mk 137 afs_syscall sys_ni_syscall \ 278 vserver sys_ni_syscall \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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 @@ -166,11 +166,11 @@ generated/linux-syscalls/microblaze.h: $(LINUX_SYSCALL_DIR)/microblaze.tbl linux 251 set_zone_reclaim sys_set_zone_reclaim \ 285 setaltroot sys_setaltroot \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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 @@ -179,11 +179,11 @@ generated/linux-syscalls/mips-n32.h: $(LINUX_SYSCALL_DIR)/mips-n32.tbl linux/sys printf '%i common %s %s\n' \ 242 setaltroot sys_setaltroot \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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 @@ -192,11 +192,11 @@ generated/linux-syscalls/mips-n64.h: $(LINUX_SYSCALL_DIR)/mips-n64.tbl linux/sys printf '%i common %s %s\n' \ 238 setaltroot sys_setaltroot \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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 }' | \ + 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\)$$')" @@ -210,13 +210,13 @@ generated/linux-syscalls/mips-o32.h: $(LINUX_SYSCALL_DIR)/mips-o32.tbl linux/sys 84 old_lstat sys_lstat \ 279 setaltroot sys_setaltroot \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*\(18\|28\|82\|84\)\s\+o32.*$$/d' \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | 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*\(\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$$')" + 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 @@ -244,19 +244,19 @@ generated/linux-syscalls/parisc.h: $(LINUX_SYSCALL_DIR)/parisc.tbl.fixed linux/s 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*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/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\\$$//' >> $@ - 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 }' | \ + 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\)$$')" @@ -264,32 +264,32 @@ generated/linux-syscalls/powerpc.h: $(LINUX_SYSCALL_DIR)/powerpc.tbl linux/sysca 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*\(\x23.*\)\?$$/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_POWERPC_NOSPU(X, X_COMPAT, D)\\\n' >> $@ cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \ + 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\)$$')" @@ -297,21 +297,21 @@ 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*\(\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)*\($(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*\(\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 /' \ + | 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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \ + 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\)$$')" @@ -340,11 +340,11 @@ generated/linux-syscalls/sh.h: $(LINUX_SYSCALL_DIR)/sh.tbl linux/syscalls.mk 166 vm86 sys_vm86 \ 167 query_module sys_query_module \ | cat -- $(LINUX_SYSCALL_DIR)/sh.tbl - \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | sed '/^$(s)*\($(h).*\)\{0,1\}$$/d' \ | awk '{ print "\tX(" $$1 ", " $$3 ", " $$4 ") D\\"}' \ | sed '$$s/ D\\$$//' >> $@ - 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$$')" + 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 @@ -354,8 +354,8 @@ generated/linux-syscalls/sparc.h: $(LINUX_SYSCALL_DIR)/sparc.tbl linux/syscalls. 267 vserver sys_vserver \ | 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' \ + | 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\\/' \ @@ -364,13 +364,13 @@ generated/linux-syscalls/sparc.h: $(LINUX_SYSCALL_DIR)/sparc.tbl linux/syscalls. printf '%i common %s %s\n' \ 267 vserver sys_vserver \ | cat -- $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) - \ - | sed '/^\s*267\s\+common\s\+vserver\s\+.*$$/d' \ - | sed '/^\s*\(\x23.*\)\?$$/d' \ + | 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*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }')" = \ - "$$(sed '/^\s*\(\x23.*\)\?$$/d' < $(LINUX_SYSCALL_DIR)/$(@F:.h=.tbl) | awk '{ print $$2 }' | \ + 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\)$$')" @@ -381,14 +381,14 @@ generated/linux-syscalls/x86.h: $(LINUX_SYSCALL_DIR)/x86.tbl linux/syscalls.mk 251 set_zone_reclaim sys_set_zone_reclaim \ 285 setaltroot sys_setaltroot \ | 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' \ + | 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*\(\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$$')" + 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 @@ -397,14 +397,14 @@ generated/linux-syscalls/xtensa.h: $(LINUX_SYSCALL_DIR)/xtensa.tbl linux/syscall printf '%i common %s %s\n' \ 305 timerfd sys_timerfd \ | 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' \ + | 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*\(\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$$')" + 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 @@ -436,7 +436,7 @@ generated/linux-syscall-dedup.h: $(HDR) $(LINUX_SYSCALLS_HDR) linux/syscalls.h l cpp -DCREATING_DEDUP_TABLE linux/syscall-table.c \ | grep -v '^#' \ | tr '\n;\t' ' \n ' \ - | sed -n 's/^.* libsyscalls_syscall \+\(linux_[A-Z0-9a-z_]\+_syscall_[A-Z0-9a-z_]\+.*\)$$/\1/p' \ + | 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 \ |