Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0
HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
-e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
-e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
ifeq ($(strip $(ARCH)),)
override ARCH := $(HOSTARCH)
endif
SRCARCH := $(ARCH)
# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
SRCARCH := x86
endif
# Additional ARCH settings for sparc
ifeq ($(ARCH),sparc32)
SRCARCH := sparc
endif
ifeq ($(ARCH),sparc64)
SRCARCH := sparc
endif
# Additional ARCH settings for loongarch
ifeq ($(ARCH),loongarch32)
SRCARCH := loongarch
endif
ifeq ($(ARCH),loongarch64)
SRCARCH := loongarch
endif
LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
ifeq ($(LP64), 1)
IS_64_BIT := 1
else
IS_64_BIT := 0
endif
+230
View File
@@ -0,0 +1,230 @@
# SPDX-License-Identifier: GPL-2.0
ifneq ($(O),)
ifeq ($(origin O), command line)
$(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
objtree := $(O)
endif
endif
endif
# check that the output directory actually exists
ifneq ($(OUTPUT),)
OUTDIR := $(shell cd $(OUTPUT) && pwd)
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
endif
#
# Include saner warnings here, which can catch bugs:
#
EXTRA_WARNINGS := -Wbad-function-cast
EXTRA_WARNINGS += -Wdeclaration-after-statement
EXTRA_WARNINGS += -Wformat-security
EXTRA_WARNINGS += -Wformat-y2k
EXTRA_WARNINGS += -Winit-self
EXTRA_WARNINGS += -Wmissing-declarations
EXTRA_WARNINGS += -Wmissing-prototypes
EXTRA_WARNINGS += -Wnested-externs
EXTRA_WARNINGS += -Wno-system-headers
EXTRA_WARNINGS += -Wold-style-definition
EXTRA_WARNINGS += -Wpacked
EXTRA_WARNINGS += -Wredundant-decls
EXTRA_WARNINGS += -Wstrict-prototypes
EXTRA_WARNINGS += -Wswitch-default
EXTRA_WARNINGS += -Wswitch-enum
EXTRA_WARNINGS += -Wundef
EXTRA_WARNINGS += -Wwrite-strings
EXTRA_WARNINGS += -Wformat
EXTRA_WARNINGS += -Wno-type-limits
# Makefiles suck: This macro sets a default value of $(2) for the
# variable named by $(1), unless the variable has been set by
# environment or command line. This is necessary for CC and AR
# because make sets default values, so the simpler ?= approach
# won't work as expected.
define allow-override
$(if $(or $(findstring environment,$(origin $(1))),\
$(findstring command line,$(origin $(1)))),,\
$(eval $(1) = $(2)))
endef
ifneq ($(LLVM),)
ifneq ($(filter %/,$(LLVM)),)
LLVM_PREFIX := $(LLVM)
else ifneq ($(filter -%,$(LLVM)),)
LLVM_SUFFIX := $(LLVM)
else ifneq ($(LLVM),1)
$(error Invalid value for LLVM, see Documentation/kbuild/llvm.rst)
endif
$(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX))
$(call allow-override,AR,$(LLVM_PREFIX)llvm-ar$(LLVM_SUFFIX))
$(call allow-override,LD,$(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX))
$(call allow-override,CXX,$(LLVM_PREFIX)clang++$(LLVM_SUFFIX))
$(call allow-override,STRIP,$(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX))
else
# Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix.
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,AR,$(CROSS_COMPILE)ar)
$(call allow-override,LD,$(CROSS_COMPILE)ld)
$(call allow-override,CXX,$(CROSS_COMPILE)g++)
$(call allow-override,STRIP,$(CROSS_COMPILE)strip)
endif
CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
ifneq ($(LLVM),)
HOSTAR ?= $(LLVM_PREFIX)llvm-ar$(LLVM_SUFFIX)
HOSTCC ?= $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
HOSTLD ?= $(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX)
else
HOSTAR ?= ar
HOSTCC ?= gcc
HOSTLD ?= ld
endif
# Some tools require Clang, LLC and/or LLVM utils
CLANG ?= clang
LLC ?= llc
LLVM_CONFIG ?= llvm-config
LLVM_OBJCOPY ?= llvm-objcopy
LLVM_STRIP ?= llvm-strip
# Some tools require bpftool
SYSTEM_BPFTOOL ?= bpftool
RUSTC ?= rustc
ifeq ($(CC_NO_CLANG), 1)
EXTRA_WARNINGS += -Wstrict-aliasing=3
else ifneq ($(CROSS_COMPILE),)
# Allow userspace to override CLANG_CROSS_FLAGS to specify their own
# sysroots and flags or to avoid the GCC call in pure Clang builds.
ifeq ($(CLANG_CROSS_FLAGS),)
CLANG_TARGET := $(notdir $(CROSS_COMPILE:%-=%))
CLANG_TARGET := $(subst s390-linux,s390x-linux,$(CLANG_TARGET))
CLANG_CROSS_FLAGS := --target=$(CLANG_TARGET)
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
ifneq ($(GCC_TOOLCHAIN_DIR),)
CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)
CLANG_CROSS_FLAGS += --gcc-toolchain=$(realpath $(GCC_TOOLCHAIN_DIR)/..)
endif # GCC_TOOLCHAIN_DIR
endif # CLANG_CROSS_FLAGS
CFLAGS += $(CLANG_CROSS_FLAGS)
AFLAGS += $(CLANG_CROSS_FLAGS)
else
CLANG_CROSS_FLAGS :=
endif # CROSS_COMPILE
# Hack to avoid type-punned warnings on old systems such as RHEL5:
# We should be changing CFLAGS and checking gcc version, but this
# will do for now and keep the above -Wstrict-aliasing=3 in place
# in newer systems.
# Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h
#
# See https://lore.kernel.org/lkml/9a8748490611281710g78402fbeh8ff7fcc162dbcbca@mail.gmail.com/
# and https://gcc.gnu.org/gcc-4.8/changes.html,
# that takes into account Linus's comments (search for Wshadow) for the reasoning about
# -Wshadow not being interesting before gcc 4.8.
ifneq ($(filter 3.%,$(MAKE_VERSION)),) # make-3
EXTRA_WARNINGS += -fno-strict-aliasing
EXTRA_WARNINGS += -Wno-shadow
else
EXTRA_WARNINGS += -Wshadow
endif
ifneq ($(findstring $(MAKEFLAGS), w),w)
PRINT_DIR = --no-print-directory
else
NO_SUBDIR = :
endif
# Beautify output
# ---------------------------------------------------------------------------
#
# Most of build commands in Kbuild start with "cmd_". You can optionally define
# "quiet_cmd_*". If defined, the short log is printed. Otherwise, no log from
# that command is printed by default.
#
# e.g.)
# quiet_cmd_depmod = DEPMOD $(MODLIB)
# cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE)
#
# A simple variant is to prefix commands with $(Q) - that's useful
# for commands that shall be hidden in non-verbose mode.
#
# $(Q)$(MAKE) $(build)=scripts/basic
#
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifeq ($(V),1)
quiet =
Q =
else
quiet = quiet_
Q = @
endif
# If the user is running make -s (silent mode), suppress echoing of commands
# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
ifeq ($(filter 3.%,$(MAKE_VERSION)),)
short-opts := $(firstword -$(MAKEFLAGS))
else
short-opts := $(filter-out --%,$(MAKEFLAGS))
endif
ifneq ($(findstring s,$(short-opts)),)
silent=1
quiet=silent_
endif
export quiet Q
#
# Define a callable command for descending to a new directory
#
# Call by doing: $(call descend,directory[,target])
#
descend = \
+mkdir -p $(OUTPUT)$(1) && \
$(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
ifneq ($(silent),1)
ifneq ($(V),1)
QUIET_CC = @echo ' CC '$@;
QUIET_CC_FPIC = @echo ' CC FPIC '$@;
QUIET_CLANG = @echo ' CLANG '$@;
QUIET_AR = @echo ' AR '$@;
QUIET_LINK = @echo ' LINK '$@;
QUIET_MKDIR = @echo ' MKDIR '$@;
QUIET_GEN = @echo ' GEN '$@;
QUIET_SUBDIR0 = +@subdir=
QUIET_SUBDIR1 = ;$(NO_SUBDIR) \
echo ' SUBDIR '$$subdir; \
$(MAKE) $(PRINT_DIR) -C $$subdir
QUIET_FLEX = @echo ' FLEX '$@;
QUIET_BISON = @echo ' BISON '$@;
QUIET_GENSKEL = @echo ' GENSKEL '$@;
descend = \
+@echo ' DESCEND '$(1); \
mkdir -p $(OUTPUT)$(1) && \
$(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
QUIET_CLEAN = @printf ' CLEAN %s\n' $1;
QUIET_INSTALL = @printf ' INSTALL %s\n' $1;
QUIET_UNINST = @printf ' UNINST %s\n' $1;
endif
endif
pound := \#
+414
View File
@@ -0,0 +1,414 @@
# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
#
# This file contains the system call numbers for all of the
# more recently added architectures.
#
# As a basic principle, no duplication of functionality
# should be added, e.g. we don't use lseek when llseek
# is present. New architectures should use this file
# and implement the less feature-full calls in user space.
#
0 common io_setup sys_io_setup compat_sys_io_setup
1 common io_destroy sys_io_destroy
2 common io_submit sys_io_submit compat_sys_io_submit
3 common io_cancel sys_io_cancel
4 time32 io_getevents sys_io_getevents_time32
4 64 io_getevents sys_io_getevents
5 common setxattr sys_setxattr
6 common lsetxattr sys_lsetxattr
7 common fsetxattr sys_fsetxattr
8 common getxattr sys_getxattr
9 common lgetxattr sys_lgetxattr
10 common fgetxattr sys_fgetxattr
11 common listxattr sys_listxattr
12 common llistxattr sys_llistxattr
13 common flistxattr sys_flistxattr
14 common removexattr sys_removexattr
15 common lremovexattr sys_lremovexattr
16 common fremovexattr sys_fremovexattr
17 common getcwd sys_getcwd
18 common lookup_dcookie sys_ni_syscall
19 common eventfd2 sys_eventfd2
20 common epoll_create1 sys_epoll_create1
21 common epoll_ctl sys_epoll_ctl
22 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait
23 common dup sys_dup
24 common dup3 sys_dup3
25 32 fcntl64 sys_fcntl64 compat_sys_fcntl64
25 64 fcntl sys_fcntl
26 common inotify_init1 sys_inotify_init1
27 common inotify_add_watch sys_inotify_add_watch
28 common inotify_rm_watch sys_inotify_rm_watch
29 common ioctl sys_ioctl compat_sys_ioctl
30 common ioprio_set sys_ioprio_set
31 common ioprio_get sys_ioprio_get
32 common flock sys_flock
33 common mknodat sys_mknodat
34 common mkdirat sys_mkdirat
35 common unlinkat sys_unlinkat
36 common symlinkat sys_symlinkat
37 common linkat sys_linkat
# renameat is superseded with flags by renameat2
38 renameat renameat sys_renameat
39 common umount2 sys_umount
40 common mount sys_mount
41 common pivot_root sys_pivot_root
42 common nfsservctl sys_ni_syscall
43 32 statfs64 sys_statfs64 compat_sys_statfs64
43 64 statfs sys_statfs
44 32 fstatfs64 sys_fstatfs64 compat_sys_fstatfs64
44 64 fstatfs sys_fstatfs
45 32 truncate64 sys_truncate64 compat_sys_truncate64
45 64 truncate sys_truncate
46 32 ftruncate64 sys_ftruncate64 compat_sys_ftruncate64
46 64 ftruncate sys_ftruncate
47 common fallocate sys_fallocate compat_sys_fallocate
48 common faccessat sys_faccessat
49 common chdir sys_chdir
50 common fchdir sys_fchdir
51 common chroot sys_chroot
52 common fchmod sys_fchmod
53 common fchmodat sys_fchmodat
54 common fchownat sys_fchownat
55 common fchown sys_fchown
56 common openat sys_openat
57 common close sys_close
58 common vhangup sys_vhangup
59 common pipe2 sys_pipe2
60 common quotactl sys_quotactl
61 common getdents64 sys_getdents64
62 32 llseek sys_llseek
62 64 lseek sys_lseek
63 common read sys_read
64 common write sys_write
65 common readv sys_readv sys_readv
66 common writev sys_writev sys_writev
67 common pread64 sys_pread64 compat_sys_pread64
68 common pwrite64 sys_pwrite64 compat_sys_pwrite64
69 common preadv sys_preadv compat_sys_preadv
70 common pwritev sys_pwritev compat_sys_pwritev
71 32 sendfile64 sys_sendfile64
71 64 sendfile sys_sendfile64
72 time32 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32
72 64 pselect6 sys_pselect6
73 time32 ppoll sys_ppoll_time32 compat_sys_ppoll_time32
73 64 ppoll sys_ppoll
74 common signalfd4 sys_signalfd4 compat_sys_signalfd4
75 common vmsplice sys_vmsplice
76 common splice sys_splice
77 common tee sys_tee
78 common readlinkat sys_readlinkat
79 stat64 fstatat64 sys_fstatat64
79 64 newfstatat sys_newfstatat
80 stat64 fstat64 sys_fstat64
80 64 fstat sys_newfstat
81 common sync sys_sync
82 common fsync sys_fsync
83 common fdatasync sys_fdatasync
84 common sync_file_range sys_sync_file_range compat_sys_sync_file_range
85 common timerfd_create sys_timerfd_create
86 time32 timerfd_settime sys_timerfd_settime32
86 64 timerfd_settime sys_timerfd_settime
87 time32 timerfd_gettime sys_timerfd_gettime32
87 64 timerfd_gettime sys_timerfd_gettime
88 time32 utimensat sys_utimensat_time32
88 64 utimensat sys_utimensat
89 common acct sys_acct
90 common capget sys_capget
91 common capset sys_capset
92 common personality sys_personality
93 common exit sys_exit
94 common exit_group sys_exit_group
95 common waitid sys_waitid compat_sys_waitid
96 common set_tid_address sys_set_tid_address
97 common unshare sys_unshare
98 time32 futex sys_futex_time32
98 64 futex sys_futex
99 common set_robust_list sys_set_robust_list compat_sys_set_robust_list
100 common get_robust_list sys_get_robust_list compat_sys_get_robust_list
101 time32 nanosleep sys_nanosleep_time32
101 64 nanosleep sys_nanosleep
102 common getitimer sys_getitimer compat_sys_getitimer
103 common setitimer sys_setitimer compat_sys_setitimer
104 common kexec_load sys_kexec_load compat_sys_kexec_load
105 common init_module sys_init_module
106 common delete_module sys_delete_module
107 common timer_create sys_timer_create compat_sys_timer_create
108 time32 timer_gettime sys_timer_gettime32
108 64 timer_gettime sys_timer_gettime
109 common timer_getoverrun sys_timer_getoverrun
110 time32 timer_settime sys_timer_settime32
110 64 timer_settime sys_timer_settime
111 common timer_delete sys_timer_delete
112 time32 clock_settime sys_clock_settime32
112 64 clock_settime sys_clock_settime
113 time32 clock_gettime sys_clock_gettime32
113 64 clock_gettime sys_clock_gettime
114 time32 clock_getres sys_clock_getres_time32
114 64 clock_getres sys_clock_getres
115 time32 clock_nanosleep sys_clock_nanosleep_time32
115 64 clock_nanosleep sys_clock_nanosleep
116 common syslog sys_syslog
117 common ptrace sys_ptrace compat_sys_ptrace
118 common sched_setparam sys_sched_setparam
119 common sched_setscheduler sys_sched_setscheduler
120 common sched_getscheduler sys_sched_getscheduler
121 common sched_getparam sys_sched_getparam
122 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity
123 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity
124 common sched_yield sys_sched_yield
125 common sched_get_priority_max sys_sched_get_priority_max
126 common sched_get_priority_min sys_sched_get_priority_min
127 time32 sched_rr_get_interval sys_sched_rr_get_interval_time32
127 64 sched_rr_get_interval sys_sched_rr_get_interval
128 common restart_syscall sys_restart_syscall
129 common kill sys_kill
130 common tkill sys_tkill
131 common tgkill sys_tgkill
132 common sigaltstack sys_sigaltstack compat_sys_sigaltstack
133 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend
134 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction
135 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask
136 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending
137 time32 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32
137 64 rt_sigtimedwait sys_rt_sigtimedwait
138 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo
139 common rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn
140 common setpriority sys_setpriority
141 common getpriority sys_getpriority
142 common reboot sys_reboot
143 common setregid sys_setregid
144 common setgid sys_setgid
145 common setreuid sys_setreuid
146 common setuid sys_setuid
147 common setresuid sys_setresuid
148 common getresuid sys_getresuid
149 common setresgid sys_setresgid
150 common getresgid sys_getresgid
151 common setfsuid sys_setfsuid
152 common setfsgid sys_setfsgid
153 common times sys_times compat_sys_times
154 common setpgid sys_setpgid
155 common getpgid sys_getpgid
156 common getsid sys_getsid
157 common setsid sys_setsid
158 common getgroups sys_getgroups
159 common setgroups sys_setgroups
160 common uname sys_newuname
161 common sethostname sys_sethostname
162 common setdomainname sys_setdomainname
# getrlimit and setrlimit are superseded with prlimit64
163 rlimit getrlimit sys_getrlimit compat_sys_getrlimit
164 rlimit setrlimit sys_setrlimit compat_sys_setrlimit
165 common getrusage sys_getrusage compat_sys_getrusage
166 common umask sys_umask
167 common prctl sys_prctl
168 common getcpu sys_getcpu
169 time32 gettimeofday sys_gettimeofday compat_sys_gettimeofday
169 64 gettimeofday sys_gettimeofday
170 time32 settimeofday sys_settimeofday compat_sys_settimeofday
170 64 settimeofday sys_settimeofday
171 time32 adjtimex sys_adjtimex_time32
171 64 adjtimex sys_adjtimex
172 common getpid sys_getpid
173 common getppid sys_getppid
174 common getuid sys_getuid
175 common geteuid sys_geteuid
176 common getgid sys_getgid
177 common getegid sys_getegid
178 common gettid sys_gettid
179 common sysinfo sys_sysinfo compat_sys_sysinfo
180 common mq_open sys_mq_open compat_sys_mq_open
181 common mq_unlink sys_mq_unlink
182 time32 mq_timedsend sys_mq_timedsend_time32
182 64 mq_timedsend sys_mq_timedsend
183 time32 mq_timedreceive sys_mq_timedreceive_time32
183 64 mq_timedreceive sys_mq_timedreceive
184 common mq_notify sys_mq_notify compat_sys_mq_notify
185 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr
186 common msgget sys_msgget
187 common msgctl sys_msgctl compat_sys_msgctl
188 common msgrcv sys_msgrcv compat_sys_msgrcv
189 common msgsnd sys_msgsnd compat_sys_msgsnd
190 common semget sys_semget
191 common semctl sys_semctl compat_sys_semctl
192 time32 semtimedop sys_semtimedop_time32
192 64 semtimedop sys_semtimedop
193 common semop sys_semop
194 common shmget sys_shmget
195 common shmctl sys_shmctl compat_sys_shmctl
196 common shmat sys_shmat compat_sys_shmat
197 common shmdt sys_shmdt
198 common socket sys_socket
199 common socketpair sys_socketpair
200 common bind sys_bind
201 common listen sys_listen
202 common accept sys_accept
203 common connect sys_connect
204 common getsockname sys_getsockname
205 common getpeername sys_getpeername
206 common sendto sys_sendto
207 common recvfrom sys_recvfrom compat_sys_recvfrom
208 common setsockopt sys_setsockopt sys_setsockopt
209 common getsockopt sys_getsockopt sys_getsockopt
210 common shutdown sys_shutdown
211 common sendmsg sys_sendmsg compat_sys_sendmsg
212 common recvmsg sys_recvmsg compat_sys_recvmsg
213 common readahead sys_readahead compat_sys_readahead
214 common brk sys_brk
215 common munmap sys_munmap
216 common mremap sys_mremap
217 common add_key sys_add_key
218 common request_key sys_request_key
219 common keyctl sys_keyctl compat_sys_keyctl
220 common clone sys_clone
221 common execve sys_execve compat_sys_execve
222 32 mmap2 sys_mmap2
222 64 mmap sys_mmap
223 32 fadvise64_64 sys_fadvise64_64 compat_sys_fadvise64_64
223 64 fadvise64 sys_fadvise64_64
224 common swapon sys_swapon
225 common swapoff sys_swapoff
226 common mprotect sys_mprotect
227 common msync sys_msync
228 common mlock sys_mlock
229 common munlock sys_munlock
230 common mlockall sys_mlockall
231 common munlockall sys_munlockall
232 common mincore sys_mincore
233 common madvise sys_madvise
234 common remap_file_pages sys_remap_file_pages
235 common mbind sys_mbind
236 common get_mempolicy sys_get_mempolicy
237 common set_mempolicy sys_set_mempolicy
238 common migrate_pages sys_migrate_pages
239 common move_pages sys_move_pages
240 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo
241 common perf_event_open sys_perf_event_open
242 common accept4 sys_accept4
243 time32 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32
243 64 recvmmsg sys_recvmmsg
# Architectures may provide up to 16 syscalls of their own between 244 and 259
244 arc cacheflush sys_cacheflush
245 arc arc_settls sys_arc_settls
246 arc arc_gettls sys_arc_gettls
247 arc sysfs sys_sysfs
248 arc arc_usr_cmpxchg sys_arc_usr_cmpxchg
244 csky set_thread_area sys_set_thread_area
245 csky cacheflush sys_cacheflush
244 nios2 cacheflush sys_cacheflush
244 or1k or1k_atomic sys_or1k_atomic
258 riscv riscv_hwprobe sys_riscv_hwprobe
259 riscv riscv_flush_icache sys_riscv_flush_icache
260 time32 wait4 sys_wait4 compat_sys_wait4
260 64 wait4 sys_wait4
261 common prlimit64 sys_prlimit64
262 common fanotify_init sys_fanotify_init
263 common fanotify_mark sys_fanotify_mark
264 common name_to_handle_at sys_name_to_handle_at
265 common open_by_handle_at sys_open_by_handle_at
266 time32 clock_adjtime sys_clock_adjtime32
266 64 clock_adjtime sys_clock_adjtime
267 common syncfs sys_syncfs
268 common setns sys_setns
269 common sendmmsg sys_sendmmsg compat_sys_sendmmsg
270 common process_vm_readv sys_process_vm_readv
271 common process_vm_writev sys_process_vm_writev
272 common kcmp sys_kcmp
273 common finit_module sys_finit_module
274 common sched_setattr sys_sched_setattr
275 common sched_getattr sys_sched_getattr
276 common renameat2 sys_renameat2
277 common seccomp sys_seccomp
278 common getrandom sys_getrandom
279 common memfd_create sys_memfd_create
280 common bpf sys_bpf
281 common execveat sys_execveat compat_sys_execveat
282 common userfaultfd sys_userfaultfd
283 common membarrier sys_membarrier
284 common mlock2 sys_mlock2
285 common copy_file_range sys_copy_file_range
286 common preadv2 sys_preadv2 compat_sys_preadv2
287 common pwritev2 sys_pwritev2 compat_sys_pwritev2
288 common pkey_mprotect sys_pkey_mprotect
289 common pkey_alloc sys_pkey_alloc
290 common pkey_free sys_pkey_free
291 common statx sys_statx
292 time32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents
292 64 io_pgetevents sys_io_pgetevents
293 common rseq sys_rseq
294 common kexec_file_load sys_kexec_file_load
# 295 through 402 are unassigned to sync up with generic numbers don't use
403 32 clock_gettime64 sys_clock_gettime
404 32 clock_settime64 sys_clock_settime
405 32 clock_adjtime64 sys_clock_adjtime
406 32 clock_getres_time64 sys_clock_getres
407 32 clock_nanosleep_time64 sys_clock_nanosleep
408 32 timer_gettime64 sys_timer_gettime
409 32 timer_settime64 sys_timer_settime
410 32 timerfd_gettime64 sys_timerfd_gettime
411 32 timerfd_settime64 sys_timerfd_settime
412 32 utimensat_time64 sys_utimensat
413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64
414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64
416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64
417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64
418 32 mq_timedsend_time64 sys_mq_timedsend
419 32 mq_timedreceive_time64 sys_mq_timedreceive
420 32 semtimedop_time64 sys_semtimedop
421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64
422 32 futex_time64 sys_futex
423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval
424 common pidfd_send_signal sys_pidfd_send_signal
425 common io_uring_setup sys_io_uring_setup
426 common io_uring_enter sys_io_uring_enter
427 common io_uring_register sys_io_uring_register
428 common open_tree sys_open_tree
429 common move_mount sys_move_mount
430 common fsopen sys_fsopen
431 common fsconfig sys_fsconfig
432 common fsmount sys_fsmount
433 common fspick sys_fspick
434 common pidfd_open sys_pidfd_open
435 common clone3 sys_clone3
436 common close_range sys_close_range
437 common openat2 sys_openat2
438 common pidfd_getfd sys_pidfd_getfd
439 common faccessat2 sys_faccessat2
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
443 common quotactl_fd sys_quotactl_fd
444 common landlock_create_ruleset sys_landlock_create_ruleset
445 common landlock_add_rule sys_landlock_add_rule
446 common landlock_restrict_self sys_landlock_restrict_self
447 memfd_secret memfd_secret sys_memfd_secret
448 common process_mrelease sys_process_mrelease
449 common futex_waitv sys_futex_waitv
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
451 common cachestat sys_cachestat
452 common fchmodat2 sys_fchmodat2
453 common map_shadow_stack sys_map_shadow_stack
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common statmount sys_statmount
458 common listmount sys_listmount
459 common lsm_get_self_attr sys_lsm_get_self_attr
460 common lsm_set_self_attr sys_lsm_set_self_attr
461 common lsm_list_modules sys_lsm_list_modules
462 common mseal sys_mseal
463 common setxattrat sys_setxattrat
464 common getxattrat sys_getxattrat
465 common listxattrat sys_listxattrat
466 common removexattrat sys_removexattrat
467 common open_tree_attr sys_open_tree_attr
468 common file_getattr sys_file_getattr
469 common file_setattr sys_file_setattr
470 common listns sys_listns
471 common rseq_slice_yield sys_rseq_slice_yield
+199
View File
@@ -0,0 +1,199 @@
# This allows us to work with the newline character:
define newline
endef
newline := $(newline)
# nl-escape
#
# Usage: escape = $(call nl-escape[,escape])
#
# This is used as the common way to specify
# what should replace a newline when escaping
# newlines; the default is a bizarre string.
#
nl-escape = $(if $(1),$(1),m822df3020w6a44id34bt574ctac44eb9f4n)
# escape-nl
#
# Usage: escaped-text = $(call escape-nl,text[,escape])
#
# GNU make's $(shell ...) function converts to a
# single space each newline character in the output
# produced during the expansion; this may not be
# desirable.
#
# The only solution is to change each newline into
# something that won't be converted, so that the
# information can be recovered later with
# $(call unescape-nl...)
#
escape-nl = $(subst $(newline),$(call nl-escape,$(2)),$(1))
# unescape-nl
#
# Usage: text = $(call unescape-nl,escaped-text[,escape])
#
# See escape-nl.
#
unescape-nl = $(subst $(call nl-escape,$(2)),$(newline),$(1))
# shell-escape-nl
#
# Usage: $(shell some-command | $(call shell-escape-nl[,escape]))
#
# Use this to escape newlines from within a shell call;
# the default escape is a bizarre string.
#
# NOTE: The escape is used directly as a string constant
# in an `awk' program that is delimited by shell
# single-quotes, so be wary of the characters
# that are chosen.
#
define shell-escape-nl
awk 'NR==1 {t=$$0} NR>1 {t=t "$(nl-escape)" $$0} END {printf t}'
endef
# shell-unescape-nl
#
# Usage: $(shell some-command | $(call shell-unescape-nl[,escape]))
#
# Use this to unescape newlines from within a shell call;
# the default escape is a bizarre string.
#
# NOTE: The escape is used directly as an extended regular
# expression constant in an `awk' program that is
# delimited by shell single-quotes, so be wary
# of the characters that are chosen.
#
# (The bash shell has a bug where `{gsub(...),...}' is
# misinterpreted as a brace expansion; this can be
# overcome by putting a space between `{' and `gsub').
#
define shell-unescape-nl
awk 'NR==1 {t=$$0} NR>1 {t=t "\n" $$0} END { gsub(/$(nl-escape)/,"\n",t); printf t }'
endef
# escape-for-shell-sq
#
# Usage: embeddable-text = $(call escape-for-shell-sq,text)
#
# This function produces text that is suitable for
# embedding in a shell string that is delimited by
# single-quotes.
#
escape-for-shell-sq = $(subst ','\'',$(1))
# shell-sq
#
# Usage: single-quoted-and-escaped-text = $(call shell-sq,text)
#
shell-sq = '$(escape-for-shell-sq)'
# shell-wordify
#
# Usage: wordified-text = $(call shell-wordify,text)
#
# For instance:
#
# |define text
# |hello
# |world
# |endef
# |
# |target:
# | echo $(call shell-wordify,$(text))
#
# At least GNU make gets confused by expanding a newline
# within the context of a command line of a makefile rule
# (this is in constrast to a `$(shell ...)' function call,
# which can handle it just fine).
#
# This function avoids the problem by producing a string
# that works as a shell word, regardless of whether or
# not it contains a newline.
#
# If the text to be wordified contains a newline, then
# an intrictate shell command substitution is constructed
# to render the text as a single line; when the shell
# processes the resulting escaped text, it transforms
# it into the original unescaped text.
#
# If the text does not contain a newline, then this function
# produces the same results as the `$(shell-sq)' function.
#
shell-wordify = $(if $(findstring $(newline),$(1)),$(_sw-esc-nl),$(shell-sq))
define _sw-esc-nl
"$$(echo $(call escape-nl,$(shell-sq),$(2)) | $(call shell-unescape-nl,$(2)))"
endef
# is-absolute
#
# Usage: bool-value = $(call is-absolute,path)
#
is-absolute = $(shell echo $(shell-sq) | grep -q ^/ && echo y)
# lookup
#
# Usage: absolute-executable-path-or-empty = $(call lookup,path)
#
# (It's necessary to use `sh -c' because GNU make messes up by
# trying too hard and getting things wrong).
#
lookup = $(call unescape-nl,$(shell sh -c $(_l-sh)))
_l-sh = $(call shell-sq,command -v $(shell-sq) | $(call shell-escape-nl,))
# is-executable
#
# Usage: bool-value = $(call is-executable,path)
#
# (It's necessary to use `sh -c' because GNU make messes up by
# trying too hard and getting things wrong).
#
is-executable = $(call _is-executable-helper,$(shell-sq))
_is-executable-helper = $(shell sh -c $(_is-executable-sh))
_is-executable-sh = $(call shell-sq,test -f $(1) -a -x $(1) && echo y)
# get-executable
#
# Usage: absolute-executable-path-or-empty = $(call get-executable,path)
#
# The goal is to get an absolute path for an executable;
# the `command -v' is defined by POSIX, but it's not
# necessarily very portable, so it's only used if
# relative path resolution is requested, as determined
# by the presence of a leading `/'.
#
get-executable = $(if $(1),$(if $(is-absolute),$(_ge-abspath),$(lookup)))
_ge-abspath = $(if $(is-executable),$(1))
# get-supplied-or-default-executable
#
# Usage: absolute-executable-path-or-empty = $(call get-executable-or-default,variable,default)
#
define get-executable-or-default
$(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2)))
endef
_ge_attempt = $(or $(get-executable),$(call _gea_err,$(2)))
_gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
# version-ge3
#
# Usage $(call version-ge3,2.6.4,$(FLEX_VERSION))
#
# To compare if a 3 component version is greater or equal to another, first use
# was to check the flex version to see if we can use compiler warnings as
# errors for one of the cases flex generates code C compilers complains about.
version-ge3 = $(shell echo "$(1).$(2)" | awk -F'.' '{ printf("%d\n", (10000000 * $$1 + 10000 * $$2 + $$3) >= (10000000 * $$4 + 10000 * $$5 + $$6)) }')
# version-lt3
#
# Usage $(call version-lt3,2.6.2,$(FLEX_VERSION))
#
# To compare if a 3 component version is less thjan another, first use was to
# check the flex version to see if we can use compiler warnings as errors for
# one of the cases flex generates code C compilers complains about.
version-lt3 = $(shell echo "$(1).$(2)" | awk -F'.' '{ printf("%d\n", (10000000 * $$1 + 10000 * $$2 + $$3) < (10000000 * $$4 + 10000 * $$5 + $$6)) }')