Comment: | stop attempting to auto-detect system constants during build process, and maintain os/arch-specific tables instead |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e42b590b4576d56235b8e34b4769f5d6 |
User & Date: | lexi on 2019-08-24 23:02:13 |
Other Links: | manifest | tags |
2019-08-24
| ||
23:07 | update license statement check-in: c36308ecd9 user: lexi tags: trunk | |
23:02 | stop attempting to auto-detect system constants during build process, and maintain os/arch-specific tables instead check-in: e42b590b45 user: lexi tags: trunk | |
00:20 | improve comments check-in: 858eba7607 user: lexi tags: trunk | |
Added arch/mktbl.posix.sh version [c6b3376c79].
1 +#!/usr/bin/env bash 2 + 3 +ABI=$2 4 + 5 +cat >$1/system_calls.h <<HEADER 6 +#ifndef KIplatform_syscall 7 +#define KIplatform_syscall 8 + 9 +enum k_platform_syscall { 10 + 11 +HEADER 12 + 13 +awk <$1/system_calls.tbl >>$1/system_calls.h -F'\t+' '$2 == "common" || $2 == "'$ABI'" { print "\tk_platform_syscall_" $3 " = " $1 "," }' 14 + 15 +cat >>$1/system_calls.h <<FOOTER 16 + 17 +}; 18 + 19 +#endif 20 + 21 +FOOTER 22 + 23 +cat >$1/error_table.h <<HEADER 24 +#ifndef KIplatform_error 25 +#define KIplatform_error 26 + 27 +enum k_platform_error { 28 + 29 +HEADER 30 + 31 +awk <$1/error_table.tbl >>$1/error_table.h -F' +' '{ print "\tk_platform_error_" $1 " = " $2 "," }' 32 + 33 +cat >>$1/error_table.h <<FOOTER 34 + 35 +}; 36 + 37 +#endif 38 + 39 +FOOTER
Added arch/posix.h version [bc192b16ff].
1 +/* arch/posix.h - posix constants 2 + * ? this file defines posix magic numbers 3 + * needed in syscalls, both cross-platform 4 + * ones and os-dependent ones. note that 5 + * the values may change depending on the 6 + * OS specified! */ 7 + 8 +#ifndef KIplatform_posix 9 +#define KIplatform_posix 10 +#include <k/def.h> 11 +#include <k/type.h> 12 + 13 +#if (!defined(KFplatform_define_constants)) && \ 14 + (!defined(KFplatform_define_types)) && \ 15 + (!defined(KFplatform_define_funcs)) 16 +#define KFplatform_define_constants 17 +#define KFplatform_define_types 18 +#define KFplatform_define_funcs 19 +#endif 20 + 21 +#ifdef KFplatform_define_constants 22 + 23 +enum posix_prot { 24 + posix_prot_none = 0, 25 + posix_prot_read = 1 << 0, 26 + posix_prot_write = 1 << 1, 27 + posix_prot_exec = 1 << 2 28 +}; 29 + 30 +enum posix_map { 31 + posix_map_shared = 1, 32 + posix_map_private = 2 33 +}; 34 + 35 +enum posix_flag { 36 + posix_flag_fixed = 0x10, 37 +#if KVos == KA_os_lin 38 + posix_flag_anonymous = 0x20, 39 +#elif KVos == KA_os_fbsd 40 + posix_flag_anonymous = 0x1000, 41 +#endif 42 + 43 + /* platform flags */ 44 + posix_flag_linux_hugetlb = 0x40000 45 +}; 46 + 47 +#endif 48 +#ifdef KFplatform_define_types 49 + 50 +/* platform types */ 51 + 52 +typedef s64 k_platform_syscall_return; 53 +typedef u64 k_platform_syscall_error; 54 + 55 +#if KVos == KA_os_lin 56 + typedef long k_platform_syscall_arg; 57 +#elif KVos == KA_os_fbsd 58 + typedef u64 k_platform_syscall_arg; 59 +#else 60 + /* we're going to just pick a sane 61 + * fallback that's reasonably likely 62 + * to work with most systems one way 63 + * or another */ 64 + typedef unsigned long long k_platform_syscall_arg; 65 +#endif 66 + 67 +struct k_platform_syscall_answer { 68 + k_platform_syscall_return ret; 69 + k_platform_syscall_error error; 70 +}; 71 + 72 +#endif 73 + 74 +#if defined(KFplatform_define_constants) ||\ 75 + defined(KFplatform_define_funcs) 76 + /* the specific system call table to use is 77 + * selected by the build script; /arch/$target 78 + * is set as an include directory */ 79 +# include <system_calls.h> 80 +#endif 81 + 82 +#ifdef KFplatform_define_funcs 83 + 84 +extern struct k_platform_syscall_answer 85 +k_platform_syscall(enum k_platform_syscall call, u8 valency, 86 + k_platform_syscall_arg args[]); 87 + 88 +#endif 89 + 90 +#endif
Deleted arch/posix/errnos version [1054d9a4df].
1 -EPERM 2 -EINVAL 3 -EBADF 4 -EFAULT 5 -ENOSPC 6 -EDQUOT 7 -EIO 8 -EAGAIN 9 -EFBIG 10 -EINTR 11 -EDESTADDRREQ 12 -EACCES 13 -EMFILE 14 -ENODEV 15 -ENOMEM 16 -ENXIO 17 -EOVERFLOW
Deleted arch/posix/posix.h version [676bf37092].
1 -/* arch/posix.h - posix constants 2 - * ? this file defines posix magic numbers 3 - * needed in syscalls, both cross-platform 4 - * ones and os-dependent ones. note that 5 - * the values may change depending on the 6 - * OS specified! */ 7 - 8 -#ifndef KIplatform_posix 9 -#define KIplatform_posix 10 -#include <k/def.h> 11 -#include <k/type.h> 12 - 13 -#if (!defined(KFplatform_define_constants)) && \ 14 - (!defined(KFplatform_define_types)) && \ 15 - (!defined(KFplatform_define_funcs)) 16 -#define KFplatform_define_constants 17 -#define KFplatform_define_types 18 -#define KFplatform_define_funcs 19 -#endif 20 - 21 -#ifdef KFplatform_define_constants 22 - 23 -enum posix_prot { 24 - posix_prot_none = 0, 25 - posix_prot_read = 1 << 0, 26 - posix_prot_write = 1 << 1, 27 - posix_prot_exec = 1 << 2 28 -}; 29 - 30 -enum posix_map { 31 - posix_map_shared = 1, 32 - posix_map_private = 2 33 -}; 34 - 35 -enum posix_flag { 36 - posix_flag_fixed = 0x10, 37 -#if KVos == KA_os_lin 38 - posix_flag_anonymous = 0x20, 39 -#elif KVos == KA_os_fbsd 40 - posix_flag_anonymous = 0x1000, 41 -#endif 42 - 43 - /* platform flags */ 44 - posix_flag_linux_hugetlb = 0x40000 45 -}; 46 - 47 -#endif 48 -#ifdef KFplatform_define_types 49 - 50 -/* platform types */ 51 - 52 -typedef s64 k_platform_syscall_return; 53 -typedef u64 k_platform_syscall_error; 54 - 55 -#if KVos == KA_os_lin 56 - typedef long k_platform_syscall_arg; 57 -#elif KVos == KA_os_fbsd 58 - typedef u64 k_platform_syscall_arg; 59 -#else 60 - /* we're going to just pick a sane 61 - * fallback that's reasonably likely 62 - * to work with most systems one way 63 - * or another */ 64 - typedef unsigned long long k_platform_syscall_arg; 65 -#endif 66 - 67 -struct k_platform_syscall_answer { 68 - k_platform_syscall_return ret; 69 - k_platform_syscall_error error; 70 -}; 71 - 72 -#endif 73 - 74 -#if defined(KFplatform_define_constants) ||\ 75 - defined(KFplatform_define_funcs) 76 -# include <system_calls.h> 77 -#endif 78 - 79 -#ifdef KFplatform_define_funcs 80 - 81 -extern struct k_platform_syscall_answer 82 -k_platform_syscall(enum k_platform_syscall call, u8 valency, 83 - k_platform_syscall_arg args[]); 84 - 85 -#endif 86 - 87 -#endif
Deleted arch/posix/syscalls version [f436d656b4].
1 -exit 2 -read 3 -write 4 -mmap 5 -munmap 6 -brk
Deleted arch/posix/x86.fbsd.32.s version [fb0cced6da].
1 -;; abi definition file for x86 linux 64-bit 2 -; vim: ft=nasm 3 - 4 -; syscall numbers - syscall table must be created first! 5 -%include "system_calls.s" 6 - 7 -; extremely stupid freebsd-ism: expects the syscall to 8 -; come from a function 9 -_syscall: int 0x80 10 - ret 11 - 12 -%define sys.call call _syscall 13 - 14 -; parameters are passed on the stack 15 -%macro syscall 1-* 16 - mov eax, %1 17 - %rep %0-1 18 - %rotate 1 19 - push %1 20 - %endrep 21 - sys.call 22 - add esp, 4*(%0-1) 23 -%endmacro
Deleted arch/posix/x86.fbsd.64.s version [8f1b903740].
1 -;; abi definition file for x86 linux 64-bit 2 -; vim: ft=nasm 3 - 4 -; syscall numbers - syscall table must be created first! 5 -%include "system_calls.s" 6 - 7 -; freebsd uses the common x86-64 ABI 8 -%include "x86.syscall.64.s"
Deleted arch/posix/x86.lin.32.s version [30df0fa7c9].
1 -; register order for syscall convention 2 -%define sys.reg.n 6 3 -%define sys.reg.ret eax 4 -%define sys.reg.0 eax 5 -%define sys.reg.1 ebx 6 -%define sys.reg.2 ecx 7 -%define sys.reg.3 edx 8 -%define sys.reg.4 esi 9 -%define sys.reg.5 edi 10 - 11 -%define sys.call int 0x80
Deleted arch/posix/x86.lin.64.s version [58546ff139].
1 -;; abi definition file for x86 linux 64-bit 2 -; vim: ft=nasm 3 - 4 -; syscall64 numbers - syscall table must be created first! 5 -%include "system_calls.s" 6 - 7 -; linux uses the common x86-64 ABI 8 -%include "../x86.syscall.64.s" 9 -
Deleted arch/x86.cdecl.32.s version [6e1eece757].
1 -;; x86.cdecl.32.s: x86 cdecl impl 2 -; vim: ft=nasm 3 - 4 -%macro ccall 1-* 5 - %assign i 0 6 - ; arguments must be pushed to the stack backwards 7 - %assign ct (%0-ct)-1 8 - %rotate ct 9 - %rep ct 10 - %rotate -1 11 - push %1 12 - %endrep 13 - %rotate ct 14 - push esp ; it's our responsibility to preserve the stack 15 - call %1 16 - ; the arguments are still on the stack; time to 17 - ; dump them back into the Garbage Zone 18 - pop esp 19 -%endmacro
Added arch/x86.fbsd.32/cdecl.s version [66f33449ab].
1 +%include "arch/x86.cdecl.32.s"
Added arch/x86.fbsd.32/posix.h version [676bf37092].
1 +/* arch/posix.h - posix constants 2 + * ? this file defines posix magic numbers 3 + * needed in syscalls, both cross-platform 4 + * ones and os-dependent ones. note that 5 + * the values may change depending on the 6 + * OS specified! */ 7 + 8 +#ifndef KIplatform_posix 9 +#define KIplatform_posix 10 +#include <k/def.h> 11 +#include <k/type.h> 12 + 13 +#if (!defined(KFplatform_define_constants)) && \ 14 + (!defined(KFplatform_define_types)) && \ 15 + (!defined(KFplatform_define_funcs)) 16 +#define KFplatform_define_constants 17 +#define KFplatform_define_types 18 +#define KFplatform_define_funcs 19 +#endif 20 + 21 +#ifdef KFplatform_define_constants 22 + 23 +enum posix_prot { 24 + posix_prot_none = 0, 25 + posix_prot_read = 1 << 0, 26 + posix_prot_write = 1 << 1, 27 + posix_prot_exec = 1 << 2 28 +}; 29 + 30 +enum posix_map { 31 + posix_map_shared = 1, 32 + posix_map_private = 2 33 +}; 34 + 35 +enum posix_flag { 36 + posix_flag_fixed = 0x10, 37 +#if KVos == KA_os_lin 38 + posix_flag_anonymous = 0x20, 39 +#elif KVos == KA_os_fbsd 40 + posix_flag_anonymous = 0x1000, 41 +#endif 42 + 43 + /* platform flags */ 44 + posix_flag_linux_hugetlb = 0x40000 45 +}; 46 + 47 +#endif 48 +#ifdef KFplatform_define_types 49 + 50 +/* platform types */ 51 + 52 +typedef s64 k_platform_syscall_return; 53 +typedef u64 k_platform_syscall_error; 54 + 55 +#if KVos == KA_os_lin 56 + typedef long k_platform_syscall_arg; 57 +#elif KVos == KA_os_fbsd 58 + typedef u64 k_platform_syscall_arg; 59 +#else 60 + /* we're going to just pick a sane 61 + * fallback that's reasonably likely 62 + * to work with most systems one way 63 + * or another */ 64 + typedef unsigned long long k_platform_syscall_arg; 65 +#endif 66 + 67 +struct k_platform_syscall_answer { 68 + k_platform_syscall_return ret; 69 + k_platform_syscall_error error; 70 +}; 71 + 72 +#endif 73 + 74 +#if defined(KFplatform_define_constants) ||\ 75 + defined(KFplatform_define_funcs) 76 +# include <system_calls.h> 77 +#endif 78 + 79 +#ifdef KFplatform_define_funcs 80 + 81 +extern struct k_platform_syscall_answer 82 +k_platform_syscall(enum k_platform_syscall call, u8 valency, 83 + k_platform_syscall_arg args[]); 84 + 85 +#endif 86 + 87 +#endif
Added arch/x86.fbsd.32/syscall.s version [fb0cced6da].
1 +;; abi definition file for x86 linux 64-bit 2 +; vim: ft=nasm 3 + 4 +; syscall numbers - syscall table must be created first! 5 +%include "system_calls.s" 6 + 7 +; extremely stupid freebsd-ism: expects the syscall to 8 +; come from a function 9 +_syscall: int 0x80 10 + ret 11 + 12 +%define sys.call call _syscall 13 + 14 +; parameters are passed on the stack 15 +%macro syscall 1-* 16 + mov eax, %1 17 + %rep %0-1 18 + %rotate 1 19 + push %1 20 + %endrep 21 + sys.call 22 + add esp, 4*(%0-1) 23 +%endmacro
Added arch/x86.fbsd.64/cdecl.s version [dab764aed2].
1 +; freebsd uses the standard x86-64 calling convention 2 +%include ../x86.cdecl.64
Added arch/x86.fbsd.64/posix.h version [676bf37092].
1 +/* arch/posix.h - posix constants 2 + * ? this file defines posix magic numbers 3 + * needed in syscalls, both cross-platform 4 + * ones and os-dependent ones. note that 5 + * the values may change depending on the 6 + * OS specified! */ 7 + 8 +#ifndef KIplatform_posix 9 +#define KIplatform_posix 10 +#include <k/def.h> 11 +#include <k/type.h> 12 + 13 +#if (!defined(KFplatform_define_constants)) && \ 14 + (!defined(KFplatform_define_types)) && \ 15 + (!defined(KFplatform_define_funcs)) 16 +#define KFplatform_define_constants 17 +#define KFplatform_define_types 18 +#define KFplatform_define_funcs 19 +#endif 20 + 21 +#ifdef KFplatform_define_constants 22 + 23 +enum posix_prot { 24 + posix_prot_none = 0, 25 + posix_prot_read = 1 << 0, 26 + posix_prot_write = 1 << 1, 27 + posix_prot_exec = 1 << 2 28 +}; 29 + 30 +enum posix_map { 31 + posix_map_shared = 1, 32 + posix_map_private = 2 33 +}; 34 + 35 +enum posix_flag { 36 + posix_flag_fixed = 0x10, 37 +#if KVos == KA_os_lin 38 + posix_flag_anonymous = 0x20, 39 +#elif KVos == KA_os_fbsd 40 + posix_flag_anonymous = 0x1000, 41 +#endif 42 + 43 + /* platform flags */ 44 + posix_flag_linux_hugetlb = 0x40000 45 +}; 46 + 47 +#endif 48 +#ifdef KFplatform_define_types 49 + 50 +/* platform types */ 51 + 52 +typedef s64 k_platform_syscall_return; 53 +typedef u64 k_platform_syscall_error; 54 + 55 +#if KVos == KA_os_lin 56 + typedef long k_platform_syscall_arg; 57 +#elif KVos == KA_os_fbsd 58 + typedef u64 k_platform_syscall_arg; 59 +#else 60 + /* we're going to just pick a sane 61 + * fallback that's reasonably likely 62 + * to work with most systems one way 63 + * or another */ 64 + typedef unsigned long long k_platform_syscall_arg; 65 +#endif 66 + 67 +struct k_platform_syscall_answer { 68 + k_platform_syscall_return ret; 69 + k_platform_syscall_error error; 70 +}; 71 + 72 +#endif 73 + 74 +#if defined(KFplatform_define_constants) ||\ 75 + defined(KFplatform_define_funcs) 76 +# include <system_calls.h> 77 +#endif 78 + 79 +#ifdef KFplatform_define_funcs 80 + 81 +extern struct k_platform_syscall_answer 82 +k_platform_syscall(enum k_platform_syscall call, u8 valency, 83 + k_platform_syscall_arg args[]); 84 + 85 +#endif 86 + 87 +#endif
Added arch/x86.fbsd.64/syscall.s version [8f1b903740].
1 +;; abi definition file for x86 linux 64-bit 2 +; vim: ft=nasm 3 + 4 +; syscall numbers - syscall table must be created first! 5 +%include "system_calls.s" 6 + 7 +; freebsd uses the common x86-64 ABI 8 +%include "x86.syscall.64.s"
Added arch/x86.lin.32/cdecl.s version [66f33449ab].
1 +%include "arch/x86.cdecl.32.s"
Added arch/x86.lin.32/posix.h version [4a7813cd60].
1 +/* no special changes are needed from the 2 + * normal POSIX header. */ 3 + 4 +#include <arch/posix.h>
Added arch/x86.lin.32/syscall.s version [30df0fa7c9].
1 +; register order for syscall convention 2 +%define sys.reg.n 6 3 +%define sys.reg.ret eax 4 +%define sys.reg.0 eax 5 +%define sys.reg.1 ebx 6 +%define sys.reg.2 ecx 7 +%define sys.reg.3 edx 8 +%define sys.reg.4 esi 9 +%define sys.reg.5 edi 10 + 11 +%define sys.call int 0x80
Added arch/x86.lin.64/cdecl.s version [92abebdccc].
1 +; linux uses the standard 64-bit calling convention 2 +%include 'arch/x86.cdecl.64.s'
Added arch/x86.lin.64/error_table.h version [236c9ded31].
1 +#ifndef KIplatform_error 2 +#define KIplatform_error 3 + 4 +enum k_platform_error { 5 + 6 + k_platform_error_EPERM = 1, 7 + k_platform_error_ENOENT = 2, 8 + k_platform_error_ESRCH = 3, 9 + k_platform_error_EINTR = 4, 10 + k_platform_error_EIO = 5, 11 + k_platform_error_ENXIO = 6, 12 + k_platform_error_E2BIG = 7, 13 + k_platform_error_ENOEXEC = 8, 14 + k_platform_error_EBADF = 9, 15 + k_platform_error_ECHILD = 10, 16 + k_platform_error_EAGAIN = 11, 17 + k_platform_error_ENOMEM = 12, 18 + k_platform_error_EACCES = 13, 19 + k_platform_error_EFAULT = 14, 20 + k_platform_error_ENOTBLK = 15, 21 + k_platform_error_EBUSY = 16, 22 + k_platform_error_EEXIST = 17, 23 + k_platform_error_EXDEV = 18, 24 + k_platform_error_ENODEV = 19, 25 + k_platform_error_ENOTDIR = 20, 26 + k_platform_error_EISDIR = 21, 27 + k_platform_error_EINVAL = 22, 28 + k_platform_error_ENFILE = 23, 29 + k_platform_error_EMFILE = 24, 30 + k_platform_error_ENOTTY = 25, 31 + k_platform_error_ETXTBSY = 26, 32 + k_platform_error_EFBIG = 27, 33 + k_platform_error_ENOSPC = 28, 34 + k_platform_error_ESPIPE = 29, 35 + k_platform_error_EROFS = 30, 36 + k_platform_error_EMLINK = 31, 37 + k_platform_error_EPIPE = 32, 38 + k_platform_error_EDOM = 33, 39 + k_platform_error_ERANGE = 34, 40 + k_platform_error_EDEADLK = 35, 41 + k_platform_error_ENAMETOOLONG = 36, 42 + k_platform_error_ENOLCK = 37, 43 + k_platform_error_ENOSYS = 38, 44 + k_platform_error_ENOTEMPTY = 39, 45 + k_platform_error_ELOOP = 40, 46 + k_platform_error_EWOULDBLOCK = 11, 47 + k_platform_error_ENOMSG = 42, 48 + k_platform_error_EIDRM = 43, 49 + k_platform_error_ECHRNG = 44, 50 + k_platform_error_EL2NSYNC = 45, 51 + k_platform_error_EL3HLT = 46, 52 + k_platform_error_EL3RST = 47, 53 + k_platform_error_ELNRNG = 48, 54 + k_platform_error_EUNATCH = 49, 55 + k_platform_error_ENOCSI = 50, 56 + k_platform_error_EL2HLT = 51, 57 + k_platform_error_EBADE = 52, 58 + k_platform_error_EBADR = 53, 59 + k_platform_error_EXFULL = 54, 60 + k_platform_error_ENOANO = 55, 61 + k_platform_error_EBADRQC = 56, 62 + k_platform_error_EBADSLT = 57, 63 + k_platform_error_EDEADLOCK = 35, 64 + k_platform_error_EBFONT = 59, 65 + k_platform_error_ENOSTR = 60, 66 + k_platform_error_ENODATA = 61, 67 + k_platform_error_ETIME = 62, 68 + k_platform_error_ENOSR = 63, 69 + k_platform_error_ENONET = 64, 70 + k_platform_error_ENOPKG = 65, 71 + k_platform_error_EREMOTE = 66, 72 + k_platform_error_ENOLINK = 67, 73 + k_platform_error_EADV = 68, 74 + k_platform_error_ESRMNT = 69, 75 + k_platform_error_ECOMM = 70, 76 + k_platform_error_EPROTO = 71, 77 + k_platform_error_EMULTIHOP = 72, 78 + k_platform_error_EDOTDOT = 73, 79 + k_platform_error_EBADMSG = 74, 80 + k_platform_error_EOVERFLOW = 75, 81 + k_platform_error_ENOTUNIQ = 76, 82 + k_platform_error_EBADFD = 77, 83 + k_platform_error_EREMCHG = 78, 84 + k_platform_error_ELIBACC = 79, 85 + k_platform_error_ELIBBAD = 80, 86 + k_platform_error_ELIBSCN = 81, 87 + k_platform_error_ELIBMAX = 82, 88 + k_platform_error_ELIBEXEC = 83, 89 + k_platform_error_EILSEQ = 84, 90 + k_platform_error_ERESTART = 85, 91 + k_platform_error_ESTRPIPE = 86, 92 + k_platform_error_EUSERS = 87, 93 + k_platform_error_ENOTSOCK = 88, 94 + k_platform_error_EDESTADDRREQ = 89, 95 + k_platform_error_EMSGSIZE = 90, 96 + k_platform_error_EPROTOTYPE = 91, 97 + k_platform_error_ENOPROTOOPT = 92, 98 + k_platform_error_EPROTONOSUPPORT = 93, 99 + k_platform_error_ESOCKTNOSUPPORT = 94, 100 + k_platform_error_EOPNOTSUPP = 95, 101 + k_platform_error_EPFNOSUPPORT = 96, 102 + k_platform_error_EAFNOSUPPORT = 97, 103 + k_platform_error_EADDRINUSE = 98, 104 + k_platform_error_EADDRNOTAVAIL = 99, 105 + k_platform_error_ENETDOWN = 100, 106 + k_platform_error_ENETUNREACH = 101, 107 + k_platform_error_ENETRESET = 102, 108 + k_platform_error_ECONNABORTED = 103, 109 + k_platform_error_ECONNRESET = 104, 110 + k_platform_error_ENOBUFS = 105, 111 + k_platform_error_EISCONN = 106, 112 + k_platform_error_ENOTCONN = 107, 113 + k_platform_error_ESHUTDOWN = 108, 114 + k_platform_error_ETOOMANYREFS = 109, 115 + k_platform_error_ETIMEDOUT = 110, 116 + k_platform_error_ECONNREFUSED = 111, 117 + k_platform_error_EHOSTDOWN = 112, 118 + k_platform_error_EHOSTUNREACH = 113, 119 + k_platform_error_EALREADY = 114, 120 + k_platform_error_EINPROGRESS = 115, 121 + k_platform_error_ESTALE = 116, 122 + k_platform_error_EUCLEAN = 117, 123 + k_platform_error_ENOTNAM = 118, 124 + k_platform_error_ENAVAIL = 119, 125 + k_platform_error_EISNAM = 120, 126 + k_platform_error_EREMOTEIO = 121, 127 + k_platform_error_EDQUOT = 122, 128 + k_platform_error_ENOMEDIUM = 123, 129 + k_platform_error_EMEDIUMTYPE = 124, 130 + k_platform_error_ECANCELED = 125, 131 + k_platform_error_ENOKEY = 126, 132 + k_platform_error_EKEYEXPIRED = 127, 133 + k_platform_error_EKEYREVOKED = 128, 134 + k_platform_error_EKEYREJECTED = 129, 135 + k_platform_error_EOWNERDEAD = 130, 136 + k_platform_error_ENOTRECOVERABLE = 131, 137 + k_platform_error_ERFKILL = 132, 138 + k_platform_error_EHWPOISON = 133, 139 + 140 +}; 141 + 142 +#endif 143 +
Added arch/x86.lin.64/error_table.tbl version [bf50702918].
1 +EPERM 1 2 +ENOENT 2 3 +ESRCH 3 4 +EINTR 4 5 +EIO 5 6 +ENXIO 6 7 +E2BIG 7 8 +ENOEXEC 8 9 +EBADF 9 10 +ECHILD 10 11 +EAGAIN 11 12 +ENOMEM 12 13 +EACCES 13 14 +EFAULT 14 15 +ENOTBLK 15 16 +EBUSY 16 17 +EEXIST 17 18 +EXDEV 18 19 +ENODEV 19 20 +ENOTDIR 20 21 +EISDIR 21 22 +EINVAL 22 23 +ENFILE 23 24 +EMFILE 24 25 +ENOTTY 25 26 +ETXTBSY 26 27 +EFBIG 27 28 +ENOSPC 28 29 +ESPIPE 29 30 +EROFS 30 31 +EMLINK 31 32 +EPIPE 32 33 +EDOM 33 34 +ERANGE 34 35 +EDEADLK 35 36 +ENAMETOOLONG 36 37 +ENOLCK 37 38 +ENOSYS 38 39 +ENOTEMPTY 39 40 +ELOOP 40 41 +EWOULDBLOCK 11 42 +ENOMSG 42 43 +EIDRM 43 44 +ECHRNG 44 45 +EL2NSYNC 45 46 +EL3HLT 46 47 +EL3RST 47 48 +ELNRNG 48 49 +EUNATCH 49 50 +ENOCSI 50 51 +EL2HLT 51 52 +EBADE 52 53 +EBADR 53 54 +EXFULL 54 55 +ENOANO 55 56 +EBADRQC 56 57 +EBADSLT 57 58 +EDEADLOCK 35 59 +EBFONT 59 60 +ENOSTR 60 61 +ENODATA 61 62 +ETIME 62 63 +ENOSR 63 64 +ENONET 64 65 +ENOPKG 65 66 +EREMOTE 66 67 +ENOLINK 67 68 +EADV 68 69 +ESRMNT 69 70 +ECOMM 70 71 +EPROTO 71 72 +EMULTIHOP 72 73 +EDOTDOT 73 74 +EBADMSG 74 75 +EOVERFLOW 75 76 +ENOTUNIQ 76 77 +EBADFD 77 78 +EREMCHG 78 79 +ELIBACC 79 80 +ELIBBAD 80 81 +ELIBSCN 81 82 +ELIBMAX 82 83 +ELIBEXEC 83 84 +EILSEQ 84 85 +ERESTART 85 86 +ESTRPIPE 86 87 +EUSERS 87 88 +ENOTSOCK 88 89 +EDESTADDRREQ 89 90 +EMSGSIZE 90 91 +EPROTOTYPE 91 92 +ENOPROTOOPT 92 93 +EPROTONOSUPPORT 93 94 +ESOCKTNOSUPPORT 94 95 +EOPNOTSUPP 95 96 +EPFNOSUPPORT 96 97 +EAFNOSUPPORT 97 98 +EADDRINUSE 98 99 +EADDRNOTAVAIL 99 100 +ENETDOWN 100 101 +ENETUNREACH 101 102 +ENETRESET 102 103 +ECONNABORTED 103 104 +ECONNRESET 104 105 +ENOBUFS 105 106 +EISCONN 106 107 +ENOTCONN 107 108 +ESHUTDOWN 108 109 +ETOOMANYREFS 109 110 +ETIMEDOUT 110 111 +ECONNREFUSED 111 112 +EHOSTDOWN 112 113 +EHOSTUNREACH 113 114 +EALREADY 114 115 +EINPROGRESS 115 116 +ESTALE 116 117 +EUCLEAN 117 118 +ENOTNAM 118 119 +ENAVAIL 119 120 +EISNAM 120 121 +EREMOTEIO 121 122 +EDQUOT 122 123 +ENOMEDIUM 123 124 +EMEDIUMTYPE 124 125 +ECANCELED 125 126 +ENOKEY 126 127 +EKEYEXPIRED 127 128 +EKEYREVOKED 128 129 +EKEYREJECTED 129 130 +EOWNERDEAD 130 131 +ENOTRECOVERABLE 131 132 +ERFKILL 132 133 +EHWPOISON 133
Added arch/x86.lin.64/posix.h version [4a7813cd60].
1 +/* no special changes are needed from the 2 + * normal POSIX header. */ 3 + 4 +#include <arch/posix.h>
Added arch/x86.lin.64/syscall.s version [b719b03db7].
1 +;; abi definition file for x86 linux 64-bit 2 +; vim: ft=nasm 3 + 4 +; linux uses the common x86-64 ABI 5 +%include "../x86.syscall.64.s"
Added arch/x86.lin.64/system_calls.h version [82935502f3].
1 +#ifndef KIplatform_syscall 2 +#define KIplatform_syscall 3 + 4 +enum k_platform_syscall { 5 + 6 + k_platform_syscall_read = 0, 7 + k_platform_syscall_write = 1, 8 + k_platform_syscall_open = 2, 9 + k_platform_syscall_close = 3, 10 + k_platform_syscall_stat = 4, 11 + k_platform_syscall_fstat = 5, 12 + k_platform_syscall_lstat = 6, 13 + k_platform_syscall_poll = 7, 14 + k_platform_syscall_lseek = 8, 15 + k_platform_syscall_mmap = 9, 16 + k_platform_syscall_mprotect = 10, 17 + k_platform_syscall_munmap = 11, 18 + k_platform_syscall_brk = 12, 19 + k_platform_syscall_rt_sigaction = 13, 20 + k_platform_syscall_rt_sigprocmask = 14, 21 + k_platform_syscall_rt_sigreturn = 15, 22 + k_platform_syscall_ioctl = 16, 23 + k_platform_syscall_pread64 = 17, 24 + k_platform_syscall_pwrite64 = 18, 25 + k_platform_syscall_readv = 19, 26 + k_platform_syscall_writev = 20, 27 + k_platform_syscall_access = 21, 28 + k_platform_syscall_pipe = 22, 29 + k_platform_syscall_select = 23, 30 + k_platform_syscall_sched_yield = 24, 31 + k_platform_syscall_mremap = 25, 32 + k_platform_syscall_msync = 26, 33 + k_platform_syscall_mincore = 27, 34 + k_platform_syscall_madvise = 28, 35 + k_platform_syscall_shmget = 29, 36 + k_platform_syscall_shmat = 30, 37 + k_platform_syscall_shmctl = 31, 38 + k_platform_syscall_dup = 32, 39 + k_platform_syscall_dup2 = 33, 40 + k_platform_syscall_pause = 34, 41 + k_platform_syscall_nanosleep = 35, 42 + k_platform_syscall_getitimer = 36, 43 + k_platform_syscall_alarm = 37, 44 + k_platform_syscall_setitimer = 38, 45 + k_platform_syscall_getpid = 39, 46 + k_platform_syscall_sendfile = 40, 47 + k_platform_syscall_socket = 41, 48 + k_platform_syscall_connect = 42, 49 + k_platform_syscall_accept = 43, 50 + k_platform_syscall_sendto = 44, 51 + k_platform_syscall_recvfrom = 45, 52 + k_platform_syscall_sendmsg = 46, 53 + k_platform_syscall_recvmsg = 47, 54 + k_platform_syscall_shutdown = 48, 55 + k_platform_syscall_bind = 49, 56 + k_platform_syscall_listen = 50, 57 + k_platform_syscall_getsockname = 51, 58 + k_platform_syscall_getpeername = 52, 59 + k_platform_syscall_socketpair = 53, 60 + k_platform_syscall_setsockopt = 54, 61 + k_platform_syscall_getsockopt = 55, 62 + k_platform_syscall_clone = 56, 63 + k_platform_syscall_fork = 57, 64 + k_platform_syscall_vfork = 58, 65 + k_platform_syscall_execve = 59, 66 + k_platform_syscall_exit = 60, 67 + k_platform_syscall_wait4 = 61, 68 + k_platform_syscall_kill = 62, 69 + k_platform_syscall_uname = 63, 70 + k_platform_syscall_semget = 64, 71 + k_platform_syscall_semop = 65, 72 + k_platform_syscall_semctl = 66, 73 + k_platform_syscall_shmdt = 67, 74 + k_platform_syscall_msgget = 68, 75 + k_platform_syscall_msgsnd = 69, 76 + k_platform_syscall_msgrcv = 70, 77 + k_platform_syscall_msgctl = 71, 78 + k_platform_syscall_fcntl = 72, 79 + k_platform_syscall_flock = 73, 80 + k_platform_syscall_fsync = 74, 81 + k_platform_syscall_fdatasync = 75, 82 + k_platform_syscall_truncate = 76, 83 + k_platform_syscall_ftruncate = 77, 84 + k_platform_syscall_getdents = 78, 85 + k_platform_syscall_getcwd = 79, 86 + k_platform_syscall_chdir = 80, 87 + k_platform_syscall_fchdir = 81, 88 + k_platform_syscall_rename = 82, 89 + k_platform_syscall_mkdir = 83, 90 + k_platform_syscall_rmdir = 84, 91 + k_platform_syscall_creat = 85, 92 + k_platform_syscall_link = 86, 93 + k_platform_syscall_unlink = 87, 94 + k_platform_syscall_symlink = 88, 95 + k_platform_syscall_readlink = 89, 96 + k_platform_syscall_chmod = 90, 97 + k_platform_syscall_fchmod = 91, 98 + k_platform_syscall_chown = 92, 99 + k_platform_syscall_fchown = 93, 100 + k_platform_syscall_lchown = 94, 101 + k_platform_syscall_umask = 95, 102 + k_platform_syscall_gettimeofday = 96, 103 + k_platform_syscall_getrlimit = 97, 104 + k_platform_syscall_getrusage = 98, 105 + k_platform_syscall_sysinfo = 99, 106 + k_platform_syscall_times = 100, 107 + k_platform_syscall_ptrace = 101, 108 + k_platform_syscall_getuid = 102, 109 + k_platform_syscall_syslog = 103, 110 + k_platform_syscall_getgid = 104, 111 + k_platform_syscall_setuid = 105, 112 + k_platform_syscall_setgid = 106, 113 + k_platform_syscall_geteuid = 107, 114 + k_platform_syscall_getegid = 108, 115 + k_platform_syscall_setpgid = 109, 116 + k_platform_syscall_getppid = 110, 117 + k_platform_syscall_getpgrp = 111, 118 + k_platform_syscall_setsid = 112, 119 + k_platform_syscall_setreuid = 113, 120 + k_platform_syscall_setregid = 114, 121 + k_platform_syscall_getgroups = 115, 122 + k_platform_syscall_setgroups = 116, 123 + k_platform_syscall_setresuid = 117, 124 + k_platform_syscall_getresuid = 118, 125 + k_platform_syscall_setresgid = 119, 126 + k_platform_syscall_getresgid = 120, 127 + k_platform_syscall_getpgid = 121, 128 + k_platform_syscall_setfsuid = 122, 129 + k_platform_syscall_setfsgid = 123, 130 + k_platform_syscall_getsid = 124, 131 + k_platform_syscall_capget = 125, 132 + k_platform_syscall_capset = 126, 133 + k_platform_syscall_rt_sigpending = 127, 134 + k_platform_syscall_rt_sigtimedwait = 128, 135 + k_platform_syscall_rt_sigqueueinfo = 129, 136 + k_platform_syscall_rt_sigsuspend = 130, 137 + k_platform_syscall_sigaltstack = 131, 138 + k_platform_syscall_utime = 132, 139 + k_platform_syscall_mknod = 133, 140 + k_platform_syscall_uselib = 134, 141 + k_platform_syscall_personality = 135, 142 + k_platform_syscall_ustat = 136, 143 + k_platform_syscall_statfs = 137, 144 + k_platform_syscall_fstatfs = 138, 145 + k_platform_syscall_sysfs = 139, 146 + k_platform_syscall_getpriority = 140, 147 + k_platform_syscall_setpriority = 141, 148 + k_platform_syscall_sched_setparam = 142, 149 + k_platform_syscall_sched_getparam = 143, 150 + k_platform_syscall_sched_setscheduler = 144, 151 + k_platform_syscall_sched_getscheduler = 145, 152 + k_platform_syscall_sched_get_priority_max = 146, 153 + k_platform_syscall_sched_get_priority_min = 147, 154 + k_platform_syscall_sched_rr_get_interval = 148, 155 + k_platform_syscall_mlock = 149, 156 + k_platform_syscall_munlock = 150, 157 + k_platform_syscall_mlockall = 151, 158 + k_platform_syscall_munlockall = 152, 159 + k_platform_syscall_vhangup = 153, 160 + k_platform_syscall_modify_ldt = 154, 161 + k_platform_syscall_pivot_root = 155, 162 + k_platform_syscall__sysctl = 156, 163 + k_platform_syscall_prctl = 157, 164 + k_platform_syscall_arch_prctl = 158, 165 + k_platform_syscall_adjtimex = 159, 166 + k_platform_syscall_setrlimit = 160, 167 + k_platform_syscall_chroot = 161, 168 + k_platform_syscall_sync = 162, 169 + k_platform_syscall_acct = 163, 170 + k_platform_syscall_settimeofday = 164, 171 + k_platform_syscall_mount = 165, 172 + k_platform_syscall_umount2 = 166, 173 + k_platform_syscall_swapon = 167, 174 + k_platform_syscall_swapoff = 168, 175 + k_platform_syscall_reboot = 169, 176 + k_platform_syscall_sethostname = 170, 177 + k_platform_syscall_setdomainname = 171, 178 + k_platform_syscall_iopl = 172, 179 + k_platform_syscall_ioperm = 173, 180 + k_platform_syscall_create_module = 174, 181 + k_platform_syscall_init_module = 175, 182 + k_platform_syscall_delete_module = 176, 183 + k_platform_syscall_get_kernel_syms = 177, 184 + k_platform_syscall_query_module = 178, 185 + k_platform_syscall_quotactl = 179, 186 + k_platform_syscall_nfsservctl = 180, 187 + k_platform_syscall_getpmsg = 181, 188 + k_platform_syscall_putpmsg = 182, 189 + k_platform_syscall_afs_syscall = 183, 190 + k_platform_syscall_tuxcall = 184, 191 + k_platform_syscall_security = 185, 192 + k_platform_syscall_gettid = 186, 193 + k_platform_syscall_readahead = 187, 194 + k_platform_syscall_setxattr = 188, 195 + k_platform_syscall_lsetxattr = 189, 196 + k_platform_syscall_fsetxattr = 190, 197 + k_platform_syscall_getxattr = 191, 198 + k_platform_syscall_lgetxattr = 192, 199 + k_platform_syscall_fgetxattr = 193, 200 + k_platform_syscall_listxattr = 194, 201 + k_platform_syscall_llistxattr = 195, 202 + k_platform_syscall_flistxattr = 196, 203 + k_platform_syscall_removexattr = 197, 204 + k_platform_syscall_lremovexattr = 198, 205 + k_platform_syscall_fremovexattr = 199, 206 + k_platform_syscall_tkill = 200, 207 + k_platform_syscall_time = 201, 208 + k_platform_syscall_futex = 202, 209 + k_platform_syscall_sched_setaffinity = 203, 210 + k_platform_syscall_sched_getaffinity = 204, 211 + k_platform_syscall_set_thread_area = 205, 212 + k_platform_syscall_io_setup = 206, 213 + k_platform_syscall_io_destroy = 207, 214 + k_platform_syscall_io_getevents = 208, 215 + k_platform_syscall_io_submit = 209, 216 + k_platform_syscall_io_cancel = 210, 217 + k_platform_syscall_get_thread_area = 211, 218 + k_platform_syscall_lookup_dcookie = 212, 219 + k_platform_syscall_epoll_create = 213, 220 + k_platform_syscall_epoll_ctl_old = 214, 221 + k_platform_syscall_epoll_wait_old = 215, 222 + k_platform_syscall_remap_file_pages = 216, 223 + k_platform_syscall_getdents64 = 217, 224 + k_platform_syscall_set_tid_address = 218, 225 + k_platform_syscall_restart_syscall = 219, 226 + k_platform_syscall_semtimedop = 220, 227 + k_platform_syscall_fadvise64 = 221, 228 + k_platform_syscall_timer_create = 222, 229 + k_platform_syscall_timer_settime = 223, 230 + k_platform_syscall_timer_gettime = 224, 231 + k_platform_syscall_timer_getoverrun = 225, 232 + k_platform_syscall_timer_delete = 226, 233 + k_platform_syscall_clock_settime = 227, 234 + k_platform_syscall_clock_gettime = 228, 235 + k_platform_syscall_clock_getres = 229, 236 + k_platform_syscall_clock_nanosleep = 230, 237 + k_platform_syscall_exit_group = 231, 238 + k_platform_syscall_epoll_wait = 232, 239 + k_platform_syscall_epoll_ctl = 233, 240 + k_platform_syscall_tgkill = 234, 241 + k_platform_syscall_utimes = 235, 242 + k_platform_syscall_vserver = 236, 243 + k_platform_syscall_mbind = 237, 244 + k_platform_syscall_set_mempolicy = 238, 245 + k_platform_syscall_get_mempolicy = 239, 246 + k_platform_syscall_mq_open = 240, 247 + k_platform_syscall_mq_unlink = 241, 248 + k_platform_syscall_mq_timedsend = 242, 249 + k_platform_syscall_mq_timedreceive = 243, 250 + k_platform_syscall_mq_notify = 244, 251 + k_platform_syscall_mq_getsetattr = 245, 252 + k_platform_syscall_kexec_load = 246, 253 + k_platform_syscall_waitid = 247, 254 + k_platform_syscall_add_key = 248, 255 + k_platform_syscall_request_key = 249, 256 + k_platform_syscall_keyctl = 250, 257 + k_platform_syscall_ioprio_set = 251, 258 + k_platform_syscall_ioprio_get = 252, 259 + k_platform_syscall_inotify_init = 253, 260 + k_platform_syscall_inotify_add_watch = 254, 261 + k_platform_syscall_inotify_rm_watch = 255, 262 + k_platform_syscall_migrate_pages = 256, 263 + k_platform_syscall_openat = 257, 264 + k_platform_syscall_mkdirat = 258, 265 + k_platform_syscall_mknodat = 259, 266 + k_platform_syscall_fchownat = 260, 267 + k_platform_syscall_futimesat = 261, 268 + k_platform_syscall_newfstatat = 262, 269 + k_platform_syscall_unlinkat = 263, 270 + k_platform_syscall_renameat = 264, 271 + k_platform_syscall_linkat = 265, 272 + k_platform_syscall_symlinkat = 266, 273 + k_platform_syscall_readlinkat = 267, 274 + k_platform_syscall_fchmodat = 268, 275 + k_platform_syscall_faccessat = 269, 276 + k_platform_syscall_pselect6 = 270, 277 + k_platform_syscall_ppoll = 271, 278 + k_platform_syscall_unshare = 272, 279 + k_platform_syscall_set_robust_list = 273, 280 + k_platform_syscall_get_robust_list = 274, 281 + k_platform_syscall_splice = 275, 282 + k_platform_syscall_tee = 276, 283 + k_platform_syscall_sync_file_range = 277, 284 + k_platform_syscall_vmsplice = 278, 285 + k_platform_syscall_move_pages = 279, 286 + k_platform_syscall_utimensat = 280, 287 + k_platform_syscall_epoll_pwait = 281, 288 + k_platform_syscall_signalfd = 282, 289 + k_platform_syscall_timerfd_create = 283, 290 + k_platform_syscall_eventfd = 284, 291 + k_platform_syscall_fallocate = 285, 292 + k_platform_syscall_timerfd_settime = 286, 293 + k_platform_syscall_timerfd_gettime = 287, 294 + k_platform_syscall_accept4 = 288, 295 + k_platform_syscall_signalfd4 = 289, 296 + k_platform_syscall_eventfd2 = 290, 297 + k_platform_syscall_epoll_create1 = 291, 298 + k_platform_syscall_dup3 = 292, 299 + k_platform_syscall_pipe2 = 293, 300 + k_platform_syscall_inotify_init1 = 294, 301 + k_platform_syscall_preadv = 295, 302 + k_platform_syscall_pwritev = 296, 303 + k_platform_syscall_rt_tgsigqueueinfo = 297, 304 + k_platform_syscall_perf_event_open = 298, 305 + k_platform_syscall_recvmmsg = 299, 306 + k_platform_syscall_fanotify_init = 300, 307 + k_platform_syscall_fanotify_mark = 301, 308 + k_platform_syscall_prlimit64 = 302, 309 + k_platform_syscall_name_to_handle_at = 303, 310 + k_platform_syscall_open_by_handle_at = 304, 311 + k_platform_syscall_clock_adjtime = 305, 312 + k_platform_syscall_syncfs = 306, 313 + k_platform_syscall_sendmmsg = 307, 314 + k_platform_syscall_setns = 308, 315 + k_platform_syscall_getcpu = 309, 316 + k_platform_syscall_process_vm_readv = 310, 317 + k_platform_syscall_process_vm_writev = 311, 318 + k_platform_syscall_kcmp = 312, 319 + k_platform_syscall_finit_module = 313, 320 + k_platform_syscall_sched_setattr = 314, 321 + k_platform_syscall_sched_getattr = 315, 322 + k_platform_syscall_renameat2 = 316, 323 + k_platform_syscall_seccomp = 317, 324 + k_platform_syscall_getrandom = 318, 325 + k_platform_syscall_memfd_create = 319, 326 + k_platform_syscall_kexec_file_load = 320, 327 + k_platform_syscall_bpf = 321, 328 + k_platform_syscall_execveat = 322, 329 + k_platform_syscall_userfaultfd = 323, 330 + k_platform_syscall_membarrier = 324, 331 + k_platform_syscall_mlock2 = 325, 332 + k_platform_syscall_copy_file_range = 326, 333 + k_platform_syscall_preadv2 = 327, 334 + k_platform_syscall_pwritev2 = 328, 335 + k_platform_syscall_pkey_mprotect = 329, 336 + k_platform_syscall_pkey_alloc = 330, 337 + k_platform_syscall_pkey_free = 331, 338 + k_platform_syscall_statx = 332, 339 + k_platform_syscall_io_pgetevents = 333, 340 + k_platform_syscall_rseq = 334, 341 + k_platform_syscall_pidfd_send_signal = 424, 342 + k_platform_syscall_io_uring_setup = 425, 343 + k_platform_syscall_io_uring_enter = 426, 344 + k_platform_syscall_io_uring_register = 427, 345 + k_platform_syscall_open_tree = 428, 346 + k_platform_syscall_move_mount = 429, 347 + k_platform_syscall_fsopen = 430, 348 + k_platform_syscall_fsconfig = 431, 349 + k_platform_syscall_fsmount = 432, 350 + k_platform_syscall_fspick = 433, 351 + k_platform_syscall_pidfd_open = 434, 352 + k_platform_syscall_clone3 = 435, 353 + 354 +}; 355 + 356 +#endif 357 +
Added arch/x86.lin.64/system_calls.tbl version [474283bc8d].
1 +# imported from kernel source tree; original file 2 +# at /arch/x86/entry/syscalls/syscall_64.tbl 3 +# ---- 4 +# 64-bit system call numbers and entry vectors 5 +# 6 +# The format is: 7 +# <number> <abi> <name> <entry point> 8 +# 9 +# The __x64_sys_*() stubs are created on-the-fly for sys_*() system calls 10 +# 11 +# The abi is "common", "64" or "x32" for this file. 12 +# 13 +0 common read __x64_sys_read 14 +1 common write __x64_sys_write 15 +2 common open __x64_sys_open 16 +3 common close __x64_sys_close 17 +4 common stat __x64_sys_newstat 18 +5 common fstat __x64_sys_newfstat 19 +6 common lstat __x64_sys_newlstat 20 +7 common poll __x64_sys_poll 21 +8 common lseek __x64_sys_lseek 22 +9 common mmap __x64_sys_mmap 23 +10 common mprotect __x64_sys_mprotect 24 +11 common munmap __x64_sys_munmap 25 +12 common brk __x64_sys_brk 26 +13 64 rt_sigaction __x64_sys_rt_sigaction 27 +14 common rt_sigprocmask __x64_sys_rt_sigprocmask 28 +15 64 rt_sigreturn __x64_sys_rt_sigreturn/ptregs 29 +16 64 ioctl __x64_sys_ioctl 30 +17 common pread64 __x64_sys_pread64 31 +18 common pwrite64 __x64_sys_pwrite64 32 +19 64 readv __x64_sys_readv 33 +20 64 writev __x64_sys_writev 34 +21 common access __x64_sys_access 35 +22 common pipe __x64_sys_pipe 36 +23 common select __x64_sys_select 37 +24 common sched_yield __x64_sys_sched_yield 38 +25 common mremap __x64_sys_mremap 39 +26 common msync __x64_sys_msync 40 +27 common mincore __x64_sys_mincore 41 +28 common madvise __x64_sys_madvise 42 +29 common shmget __x64_sys_shmget 43 +30 common shmat __x64_sys_shmat 44 +31 common shmctl __x64_sys_shmctl 45 +32 common dup __x64_sys_dup 46 +33 common dup2 __x64_sys_dup2 47 +34 common pause __x64_sys_pause 48 +35 common nanosleep __x64_sys_nanosleep 49 +36 common getitimer __x64_sys_getitimer 50 +37 common alarm __x64_sys_alarm 51 +38 common setitimer __x64_sys_setitimer 52 +39 common getpid __x64_sys_getpid 53 +40 common sendfile __x64_sys_sendfile64 54 +41 common socket __x64_sys_socket 55 +42 common connect __x64_sys_connect 56 +43 common accept __x64_sys_accept 57 +44 common sendto __x64_sys_sendto 58 +45 64 recvfrom __x64_sys_recvfrom 59 +46 64 sendmsg __x64_sys_sendmsg 60 +47 64 recvmsg __x64_sys_recvmsg 61 +48 common shutdown __x64_sys_shutdown 62 +49 common bind __x64_sys_bind 63 +50 common listen __x64_sys_listen 64 +51 common getsockname __x64_sys_getsockname 65 +52 common getpeername __x64_sys_getpeername 66 +53 common socketpair __x64_sys_socketpair 67 +54 64 setsockopt __x64_sys_setsockopt 68 +55 64 getsockopt __x64_sys_getsockopt 69 +56 common clone __x64_sys_clone/ptregs 70 +57 common fork __x64_sys_fork/ptregs 71 +58 common vfork __x64_sys_vfork/ptregs 72 +59 64 execve __x64_sys_execve/ptregs 73 +60 common exit __x64_sys_exit 74 +61 common wait4 __x64_sys_wait4 75 +62 common kill __x64_sys_kill 76 +63 common uname __x64_sys_newuname 77 +64 common semget __x64_sys_semget 78 +65 common semop __x64_sys_semop 79 +66 common semctl __x64_sys_semctl 80 +67 common shmdt __x64_sys_shmdt 81 +68 common msgget __x64_sys_msgget 82 +69 common msgsnd __x64_sys_msgsnd 83 +70 common msgrcv __x64_sys_msgrcv 84 +71 common msgctl __x64_sys_msgctl 85 +72 common fcntl __x64_sys_fcntl 86 +73 common flock __x64_sys_flock 87 +74 common fsync __x64_sys_fsync 88 +75 common fdatasync __x64_sys_fdatasync 89 +76 common truncate __x64_sys_truncate 90 +77 common ftruncate __x64_sys_ftruncate 91 +78 common getdents __x64_sys_getdents 92 +79 common getcwd __x64_sys_getcwd 93 +80 common chdir __x64_sys_chdir 94 +81 common fchdir __x64_sys_fchdir 95 +82 common rename __x64_sys_rename 96 +83 common mkdir __x64_sys_mkdir 97 +84 common rmdir __x64_sys_rmdir 98 +85 common creat __x64_sys_creat 99 +86 common link __x64_sys_link 100 +87 common unlink __x64_sys_unlink 101 +88 common symlink __x64_sys_symlink 102 +89 common readlink __x64_sys_readlink 103 +90 common chmod __x64_sys_chmod 104 +91 common fchmod __x64_sys_fchmod 105 +92 common chown __x64_sys_chown 106 +93 common fchown __x64_sys_fchown 107 +94 common lchown __x64_sys_lchown 108 +95 common umask __x64_sys_umask 109 +96 common gettimeofday __x64_sys_gettimeofday 110 +97 common getrlimit __x64_sys_getrlimit 111 +98 common getrusage __x64_sys_getrusage 112 +99 common sysinfo __x64_sys_sysinfo 113 +100 common times __x64_sys_times 114 +101 64 ptrace __x64_sys_ptrace 115 +102 common getuid __x64_sys_getuid 116 +103 common syslog __x64_sys_syslog 117 +104 common getgid __x64_sys_getgid 118 +105 common setuid __x64_sys_setuid 119 +106 common setgid __x64_sys_setgid 120 +107 common geteuid __x64_sys_geteuid 121 +108 common getegid __x64_sys_getegid 122 +109 common setpgid __x64_sys_setpgid 123 +110 common getppid __x64_sys_getppid 124 +111 common getpgrp __x64_sys_getpgrp 125 +112 common setsid __x64_sys_setsid 126 +113 common setreuid __x64_sys_setreuid 127 +114 common setregid __x64_sys_setregid 128 +115 common getgroups __x64_sys_getgroups 129 +116 common setgroups __x64_sys_setgroups 130 +117 common setresuid __x64_sys_setresuid 131 +118 common getresuid __x64_sys_getresuid 132 +119 common setresgid __x64_sys_setresgid 133 +120 common getresgid __x64_sys_getresgid 134 +121 common getpgid __x64_sys_getpgid 135 +122 common setfsuid __x64_sys_setfsuid 136 +123 common setfsgid __x64_sys_setfsgid 137 +124 common getsid __x64_sys_getsid 138 +125 common capget __x64_sys_capget 139 +126 common capset __x64_sys_capset 140 +127 64 rt_sigpending __x64_sys_rt_sigpending 141 +128 64 rt_sigtimedwait __x64_sys_rt_sigtimedwait 142 +129 64 rt_sigqueueinfo __x64_sys_rt_sigqueueinfo 143 +130 common rt_sigsuspend __x64_sys_rt_sigsuspend 144 +131 64 sigaltstack __x64_sys_sigaltstack 145 +132 common utime __x64_sys_utime 146 +133 common mknod __x64_sys_mknod 147 +134 64 uselib 148 +135 common personality __x64_sys_personality 149 +136 common ustat __x64_sys_ustat 150 +137 common statfs __x64_sys_statfs 151 +138 common fstatfs __x64_sys_fstatfs 152 +139 common sysfs __x64_sys_sysfs 153 +140 common getpriority __x64_sys_getpriority 154 +141 common setpriority __x64_sys_setpriority 155 +142 common sched_setparam __x64_sys_sched_setparam 156 +143 common sched_getparam __x64_sys_sched_getparam 157 +144 common sched_setscheduler __x64_sys_sched_setscheduler 158 +145 common sched_getscheduler __x64_sys_sched_getscheduler 159 +146 common sched_get_priority_max __x64_sys_sched_get_priority_max 160 +147 common sched_get_priority_min __x64_sys_sched_get_priority_min 161 +148 common sched_rr_get_interval __x64_sys_sched_rr_get_interval 162 +149 common mlock __x64_sys_mlock 163 +150 common munlock __x64_sys_munlock 164 +151 common mlockall __x64_sys_mlockall 165 +152 common munlockall __x64_sys_munlockall 166 +153 common vhangup __x64_sys_vhangup 167 +154 common modify_ldt __x64_sys_modify_ldt 168 +155 common pivot_root __x64_sys_pivot_root 169 +156 64 _sysctl __x64_sys_sysctl 170 +157 common prctl __x64_sys_prctl 171 +158 common arch_prctl __x64_sys_arch_prctl 172 +159 common adjtimex __x64_sys_adjtimex 173 +160 common setrlimit __x64_sys_setrlimit 174 +161 common chroot __x64_sys_chroot 175 +162 common sync __x64_sys_sync 176 +163 common acct __x64_sys_acct 177 +164 common settimeofday __x64_sys_settimeofday 178 +165 common mount __x64_sys_mount 179 +166 common umount2 __x64_sys_umount 180 +167 common swapon __x64_sys_swapon 181 +168 common swapoff __x64_sys_swapoff 182 +169 common reboot __x64_sys_reboot 183 +170 common sethostname __x64_sys_sethostname 184 +171 common setdomainname __x64_sys_setdomainname 185 +172 common iopl __x64_sys_iopl/ptregs 186 +173 common ioperm __x64_sys_ioperm 187 +174 64 create_module 188 +175 common init_module __x64_sys_init_module 189 +176 common delete_module __x64_sys_delete_module 190 +177 64 get_kernel_syms 191 +178 64 query_module 192 +179 common quotactl __x64_sys_quotactl 193 +180 64 nfsservctl 194 +181 common getpmsg 195 +182 common putpmsg 196 +183 common afs_syscall 197 +184 common tuxcall 198 +185 common security 199 +186 common gettid __x64_sys_gettid 200 +187 common readahead __x64_sys_readahead 201 +188 common setxattr __x64_sys_setxattr 202 +189 common lsetxattr __x64_sys_lsetxattr 203 +190 common fsetxattr __x64_sys_fsetxattr 204 +191 common getxattr __x64_sys_getxattr 205 +192 common lgetxattr __x64_sys_lgetxattr 206 +193 common fgetxattr __x64_sys_fgetxattr 207 +194 common listxattr __x64_sys_listxattr 208 +195 common llistxattr __x64_sys_llistxattr 209 +196 common flistxattr __x64_sys_flistxattr 210 +197 common removexattr __x64_sys_removexattr 211 +198 common lremovexattr __x64_sys_lremovexattr 212 +199 common fremovexattr __x64_sys_fremovexattr 213 +200 common tkill __x64_sys_tkill 214 +201 common time __x64_sys_time 215 +202 common futex __x64_sys_futex 216 +203 common sched_setaffinity __x64_sys_sched_setaffinity 217 +204 common sched_getaffinity __x64_sys_sched_getaffinity 218 +205 64 set_thread_area 219 +206 64 io_setup __x64_sys_io_setup 220 +207 common io_destroy __x64_sys_io_destroy 221 +208 common io_getevents __x64_sys_io_getevents 222 +209 64 io_submit __x64_sys_io_submit 223 +210 common io_cancel __x64_sys_io_cancel 224 +211 64 get_thread_area 225 +212 common lookup_dcookie __x64_sys_lookup_dcookie 226 +213 common epoll_create __x64_sys_epoll_create 227 +214 64 epoll_ctl_old 228 +215 64 epoll_wait_old 229 +216 common remap_file_pages __x64_sys_remap_file_pages 230 +217 common getdents64 __x64_sys_getdents64 231 +218 common set_tid_address __x64_sys_set_tid_address 232 +219 common restart_syscall __x64_sys_restart_syscall 233 +220 common semtimedop __x64_sys_semtimedop 234 +221 common fadvise64 __x64_sys_fadvise64 235 +222 64 timer_create __x64_sys_timer_create 236 +223 common timer_settime __x64_sys_timer_settime 237 +224 common timer_gettime __x64_sys_timer_gettime 238 +225 common timer_getoverrun __x64_sys_timer_getoverrun 239 +226 common timer_delete __x64_sys_timer_delete 240 +227 common clock_settime __x64_sys_clock_settime 241 +228 common clock_gettime __x64_sys_clock_gettime 242 +229 common clock_getres __x64_sys_clock_getres 243 +230 common clock_nanosleep __x64_sys_clock_nanosleep 244 +231 common exit_group __x64_sys_exit_group 245 +232 common epoll_wait __x64_sys_epoll_wait 246 +233 common epoll_ctl __x64_sys_epoll_ctl 247 +234 common tgkill __x64_sys_tgkill 248 +235 common utimes __x64_sys_utimes 249 +236 64 vserver 250 +237 common mbind __x64_sys_mbind 251 +238 common set_mempolicy __x64_sys_set_mempolicy 252 +239 common get_mempolicy __x64_sys_get_mempolicy 253 +240 common mq_open __x64_sys_mq_open 254 +241 common mq_unlink __x64_sys_mq_unlink 255 +242 common mq_timedsend __x64_sys_mq_timedsend 256 +243 common mq_timedreceive __x64_sys_mq_timedreceive 257 +244 64 mq_notify __x64_sys_mq_notify 258 +245 common mq_getsetattr __x64_sys_mq_getsetattr 259 +246 64 kexec_load __x64_sys_kexec_load 260 +247 64 waitid __x64_sys_waitid 261 +248 common add_key __x64_sys_add_key 262 +249 common request_key __x64_sys_request_key 263 +250 common keyctl __x64_sys_keyctl 264 +251 common ioprio_set __x64_sys_ioprio_set 265 +252 common ioprio_get __x64_sys_ioprio_get 266 +253 common inotify_init __x64_sys_inotify_init 267 +254 common inotify_add_watch __x64_sys_inotify_add_watch 268 +255 common inotify_rm_watch __x64_sys_inotify_rm_watch 269 +256 common migrate_pages __x64_sys_migrate_pages 270 +257 common openat __x64_sys_openat 271 +258 common mkdirat __x64_sys_mkdirat 272 +259 common mknodat __x64_sys_mknodat 273 +260 common fchownat __x64_sys_fchownat 274 +261 common futimesat __x64_sys_futimesat 275 +262 common newfstatat __x64_sys_newfstatat 276 +263 common unlinkat __x64_sys_unlinkat 277 +264 common renameat __x64_sys_renameat 278 +265 common linkat __x64_sys_linkat 279 +266 common symlinkat __x64_sys_symlinkat 280 +267 common readlinkat __x64_sys_readlinkat 281 +268 common fchmodat __x64_sys_fchmodat 282 +269 common faccessat __x64_sys_faccessat 283 +270 common pselect6 __x64_sys_pselect6 284 +271 common ppoll __x64_sys_ppoll 285 +272 common unshare __x64_sys_unshare 286 +273 64 set_robust_list __x64_sys_set_robust_list 287 +274 64 get_robust_list __x64_sys_get_robust_list 288 +275 common splice __x64_sys_splice 289 +276 common tee __x64_sys_tee 290 +277 common sync_file_range __x64_sys_sync_file_range 291 +278 64 vmsplice __x64_sys_vmsplice 292 +279 64 move_pages __x64_sys_move_pages 293 +280 common utimensat __x64_sys_utimensat 294 +281 common epoll_pwait __x64_sys_epoll_pwait 295 +282 common signalfd __x64_sys_signalfd 296 +283 common timerfd_create __x64_sys_timerfd_create 297 +284 common eventfd __x64_sys_eventfd 298 +285 common fallocate __x64_sys_fallocate 299 +286 common timerfd_settime __x64_sys_timerfd_settime 300 +287 common timerfd_gettime __x64_sys_timerfd_gettime 301 +288 common accept4 __x64_sys_accept4 302 +289 common signalfd4 __x64_sys_signalfd4 303 +290 common eventfd2 __x64_sys_eventfd2 304 +291 common epoll_create1 __x64_sys_epoll_create1 305 +292 common dup3 __x64_sys_dup3 306 +293 common pipe2 __x64_sys_pipe2 307 +294 common inotify_init1 __x64_sys_inotify_init1 308 +295 64 preadv __x64_sys_preadv 309 +296 64 pwritev __x64_sys_pwritev 310 +297 64 rt_tgsigqueueinfo __x64_sys_rt_tgsigqueueinfo 311 +298 common perf_event_open __x64_sys_perf_event_open 312 +299 64 recvmmsg __x64_sys_recvmmsg 313 +300 common fanotify_init __x64_sys_fanotify_init 314 +301 common fanotify_mark __x64_sys_fanotify_mark 315 +302 common prlimit64 __x64_sys_prlimit64 316 +303 common name_to_handle_at __x64_sys_name_to_handle_at 317 +304 common open_by_handle_at __x64_sys_open_by_handle_at 318 +305 common clock_adjtime __x64_sys_clock_adjtime 319 +306 common syncfs __x64_sys_syncfs 320 +307 64 sendmmsg __x64_sys_sendmmsg 321 +308 common setns __x64_sys_setns 322 +309 common getcpu __x64_sys_getcpu 323 +310 64 process_vm_readv __x64_sys_process_vm_readv 324 +311 64 process_vm_writev __x64_sys_process_vm_writev 325 +312 common kcmp __x64_sys_kcmp 326 +313 common finit_module __x64_sys_finit_module 327 +314 common sched_setattr __x64_sys_sched_setattr 328 +315 common sched_getattr __x64_sys_sched_getattr 329 +316 common renameat2 __x64_sys_renameat2 330 +317 common seccomp __x64_sys_seccomp 331 +318 common getrandom __x64_sys_getrandom 332 +319 common memfd_create __x64_sys_memfd_create 333 +320 common kexec_file_load __x64_sys_kexec_file_load 334 +321 common bpf __x64_sys_bpf 335 +322 64 execveat __x64_sys_execveat/ptregs 336 +323 common userfaultfd __x64_sys_userfaultfd 337 +324 common membarrier __x64_sys_membarrier 338 +325 common mlock2 __x64_sys_mlock2 339 +326 common copy_file_range __x64_sys_copy_file_range 340 +327 64 preadv2 __x64_sys_preadv2 341 +328 64 pwritev2 __x64_sys_pwritev2 342 +329 common pkey_mprotect __x64_sys_pkey_mprotect 343 +330 common pkey_alloc __x64_sys_pkey_alloc 344 +331 common pkey_free __x64_sys_pkey_free 345 +332 common statx __x64_sys_statx 346 +333 common io_pgetevents __x64_sys_io_pgetevents 347 +334 common rseq __x64_sys_rseq 348 +# don't use numbers 387 through 423, add new calls after the last 349 +# 'common' entry 350 +424 common pidfd_send_signal __x64_sys_pidfd_send_signal 351 +425 common io_uring_setup __x64_sys_io_uring_setup 352 +426 common io_uring_enter __x64_sys_io_uring_enter 353 +427 common io_uring_register __x64_sys_io_uring_register 354 +428 common open_tree __x64_sys_open_tree 355 +429 common move_mount __x64_sys_move_mount 356 +430 common fsopen __x64_sys_fsopen 357 +431 common fsconfig __x64_sys_fsconfig 358 +432 common fsmount __x64_sys_fsmount 359 +433 common fspick __x64_sys_fspick 360 +434 common pidfd_open __x64_sys_pidfd_open 361 +435 common clone3 __x64_sys_clone3/ptregs 362 + 363 +# 364 +# x32-specific system call numbers start at 512 to avoid cache impact 365 +# for native 64-bit operation. The __x32_compat_sys stubs are created 366 +# on-the-fly for compat_sys_*() compatibility system calls if X86_X32 367 +# is defined. 368 +# 369 +512 x32 rt_sigaction __x32_compat_sys_rt_sigaction 370 +513 x32 rt_sigreturn sys32_x32_rt_sigreturn 371 +514 x32 ioctl __x32_compat_sys_ioctl 372 +515 x32 readv __x32_compat_sys_readv 373 +516 x32 writev __x32_compat_sys_writev 374 +517 x32 recvfrom __x32_compat_sys_recvfrom 375 +518 x32 sendmsg __x32_compat_sys_sendmsg 376 +519 x32 recvmsg __x32_compat_sys_recvmsg 377 +520 x32 execve __x32_compat_sys_execve/ptregs 378 +521 x32 ptrace __x32_compat_sys_ptrace 379 +522 x32 rt_sigpending __x32_compat_sys_rt_sigpending 380 +523 x32 rt_sigtimedwait __x32_compat_sys_rt_sigtimedwait_time64 381 +524 x32 rt_sigqueueinfo __x32_compat_sys_rt_sigqueueinfo 382 +525 x32 sigaltstack __x32_compat_sys_sigaltstack 383 +526 x32 timer_create __x32_compat_sys_timer_create 384 +527 x32 mq_notify __x32_compat_sys_mq_notify 385 +528 x32 kexec_load __x32_compat_sys_kexec_load 386 +529 x32 waitid __x32_compat_sys_waitid 387 +530 x32 set_robust_list __x32_compat_sys_set_robust_list 388 +531 x32 get_robust_list __x32_compat_sys_get_robust_list 389 +532 x32 vmsplice __x32_compat_sys_vmsplice 390 +533 x32 move_pages __x32_compat_sys_move_pages 391 +534 x32 preadv __x32_compat_sys_preadv64 392 +535 x32 pwritev __x32_compat_sys_pwritev64 393 +536 x32 rt_tgsigqueueinfo __x32_compat_sys_rt_tgsigqueueinfo 394 +537 x32 recvmmsg __x32_compat_sys_recvmmsg_time64 395 +538 x32 sendmmsg __x32_compat_sys_sendmmsg 396 +539 x32 process_vm_readv __x32_compat_sys_process_vm_readv 397 +540 x32 process_vm_writev __x32_compat_sys_process_vm_writev 398 +541 x32 setsockopt __x32_compat_sys_setsockopt 399 +542 x32 getsockopt __x32_compat_sys_getsockopt 400 +543 x32 io_setup __x32_compat_sys_io_setup 401 +544 x32 io_submit __x32_compat_sys_io_submit 402 +545 x32 execveat __x32_compat_sys_execveat/ptregs 403 +546 x32 preadv2 __x32_compat_sys_preadv64v2 404 +547 x32 pwritev2 __x32_compat_sys_pwritev64v2
Modified build.sh from [b5a70ac75f] to [4c9dbc8e12].
146 146 if test ! "$output" -ot "$src"; then 147 147 return 148 148 fi 149 149 fi 150 150 if test "$debug" = yes; then 151 151 local dflag="-g dwarf2" 152 152 fi 153 - report $asm $flags $dflag "-f$bin_fmt" -i "$gen" -i "$PWD" "$src" -o "$output"; 153 + report $asm $flags $dflag "-f$bin_fmt" -I "$gen" -I "$PWD" -I "arch/$target" "$src" -o "$output"; 154 154 } 155 155 comp_co() { comp_c $1 $2 "-c -fPIC"; } 156 156 comp_c(){ 157 157 local src=$1 158 158 local output=$2 159 159 local flags=$3 160 160 if test -e "$output"; then ................................................................................ 165 165 # only rebuild the file if the source file is newer 166 166 if test "$debug" = yes; then 167 167 local dflag="-g" 168 168 else 169 169 local dflag="-O4" 170 170 fi 171 171 if test "$assembly" = yes; then 172 - report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/" -ffreestanding -nostdlib "-L$to" -masm=intel -fverbose-asm -S "-o$output.s" 172 + report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/$target" -isystem "$PWD" -ffreestanding -nostdlib "-L$to" -masm=intel -fverbose-asm -S "-o$output.s" 173 173 else 174 - report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/" -ffreestanding -nostdlib "-L$to" "-o$output" 174 + report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/$target" -isystem "$PWD" -ffreestanding -nostdlib "-L$to" "-o$output" 175 175 fi 176 176 } 177 177 178 178 say "commencing libk build $build at $(timestamp)" 179 179 # set -x 180 180 181 181 # get type data 182 182 mkdir -p $gen 183 183 report $cc -D_emit_m4_include arch/typesize.c -o $gen/typesize 184 184 $gen/typesize > gen/typesize.m 185 185 186 -# generate syscall tables 187 -if test $posix = yes; then 188 - # on posix, we simply abuse CPP to garner a list of syscalls; 189 - # the file arch/posix/syscalls contains a list of syscalls 190 - # we wish to import; we use sed to transform this into a form 191 - # that cpp will fill out for us, producing a table that the 192 - # awk scripts can handle and turn into a list of constants. 193 - echo '#include <sys/syscall.h>' > $gen/system_calls.t.1 # this is the magic part 194 - cat arch/posix/syscalls > $gen/system_calls.t.2 195 - sed -e 's;^\(.*\)$;\1 SYS_\1;' -i $gen/system_calls.t.2 196 - cat $gen/system_calls.t.1 $gen/system_calls.t.2 | cpp -P >$gen/system_calls.tbl 197 - 198 - # generate errno tables the same way 199 - echo '#include <errno.h>' > $gen/error_codes.t.1 # this is the magic part 200 - cat arch/posix/errnos > $gen/error_codes.t.2 201 - sed -e 's;^\(.*\)$;k_platform_error_\1 \1;' -i $gen/error_codes.t.2 202 - cat $gen/error_codes.t.1 $gen/error_codes.t.2 | cpp -P | grep "^k_platform_error" >$gen/error_codes.tbl # haaaack 203 -else 204 - case $os in 205 - *) noimpl 'system call table generation';; 206 - esac 207 -fi 208 - 209 -# take the OS-specific system call tables that have been prepared 210 -# for us above and feed them into awk scripts to generate C headers 211 -awk -f arch/syscall.awk -v out=s <$gen/system_calls.tbl>$gen/system_calls.s 212 -awk -f arch/syscall.awk -v out=h <$gen/system_calls.tbl>$gen/system_calls.h 213 - 214 -# do the same with our error codes table 215 -awk -f arch/errtbl.awk <$gen/error_codes.tbl >$gen/error_table.h 216 - 217 186 # generate symbol tables for error handling functions 218 187 mkdir -p "$to/k" 219 188 awk -f global/gen-conds.awk <global/modules >$to/k/internal.egroup.h 220 189 awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c 221 190 comp_co $gen/internal.ident.c $to/internal.ident.o 222 191 223 192 # first pass: copy all headers into place,
Modified global/build-manpage.sh from [d03c3443d7] to [132a7e50b4].
1 1 #!/usr/bin/env bash 2 2 (test -d global && test -f build.sh) || { 3 - echo >&2 "($0) run [1m$me[21m from root of [1mlibk[21m source directory" 3 + echo >&2 "($0) run [1m$0[21m from root of [1mlibk[21m source directory" 4 4 exit 1 5 5 } 6 6 7 7 source global/common.sh 8 8 reqpack cmark "generate documentation" 9 9 check gen "a directory for generated build dependencies" 10 10
Modified mod/kcore/boot.rt.x86.lin.64.s from [3c036595d7] to [a74c88489c].
1 1 ; vim: ft=nasm 2 2 bits 64 3 -%include "../arch/posix/x86.lin.64.s" 3 +%include "syscall.s" 4 4 global _start:function 5 5 extern _boot 6 6 extern entry 7 7 8 8 _start: 9 9 mov rbp, 0 ; zero the stack base ptr. 10 10 ; attempted fix for a difficult-to- ................................................................................ 57 57 ; regardless of the size of the 58 58 ; return value of main(), _boot always 59 59 ; returns the system word length. 60 60 61 61 mov sys.reg.1, sys.reg.ret ; fill in 62 62 ; the return value as exit's argument 63 63 64 - mov sys.reg.0, sys.exit ; set %rax to 64 + mov sys.reg.0, 60 ; set %rax to 65 65 ; the syscall number of exit 66 66 67 67 sys.call ; invoke the kernel
Modified mod/kcore/platform.syscall.fn.c from [9c61e189e0] to [4315e80d93].
7 7 * implementation may vary drastically. 8 8 */ 9 9 10 10 #include <k/def.h> 11 11 #include <k/type.h> 12 12 13 13 #ifdef KFenv_posix 14 -# include <posix/posix.h> 14 +# include <posix.h> 15 15 #else 16 16 Knoimpl(k_platform_syscall) 17 17 #endif 18 18 19 19 extern void k_platform_syscall_raw ( 20 20 k_platform_syscall_return* return_slot, 21 21 k_platform_syscall_error* error_no_slot,
Modified mod/kcore/stop.fn.c from [1f91f150ef] to [62a3920f4e].
5 5 6 6 #include <k/core.h> 7 7 #include <k/def.h> // so we know what system this is 8 8 #include <k/type.h> 9 9 #ifdef KFenv_posix 10 10 # define KFplatform_define_types 11 11 # define KFplatform_define_constants 12 -# include <posix/posix.h> 12 +# include <posix.h> 13 13 #endif 14 14 15 15 /* this manual redefinition is necessary to stop gcc 16 16 * bitching that kstop returns, which it def does not */ 17 17 noreturn extern struct k_platform_syscall_answer 18 18 k_platform_syscall(enum k_platform_syscall call, u8 valency, 19 19 k_platform_syscall_arg args[]);
Modified mod/kcore/syscall.fn.x86.lin.64.s from [9bf0ba9bf3] to [856b7532d5].
7 7 ; altogether and access the error value of a 8 8 ; syscall directly. invoke as: 9 9 ; 10 10 ; void k_platform_syscall_raw(s64* result, u64* errno, 11 11 ; syscall, u8 valency, s64[] args) 12 12 13 13 bits 64 14 -%include "arch/posix/x86.lin.64.s" 15 -%include "arch/x86.cdecl.64.s" 14 + 15 +; which file is included is selected via the value 16 +; of the target tuple - arch/$target is passed to 17 +; the assembler as an include directory 18 +%include 'syscall.s' 19 +%include 'cdecl.s' 16 20 ; vim: ft=nasm 17 21 18 22 %macro handle_arg 1 19 23 %assign v %1+1 20 24 mov sys.reg. %+ v, [r15 + 8 * %1] 21 25 dec ccall.reg.3 22 26 jz .perform_call
Modified mod/kio/send.fn.c from [1b46213bbd] to [9e8cd30a43].
6 6 * kiosend() writes to a channel with an open out stream 7 7 */ 8 8 9 9 /* we define all platform functions here, 10 10 * whether or not they're for the correct 11 11 * platform - only the ones actually called 12 12 * by the generated code will be linked */ 13 -#include <posix/posix.h> 13 +#include <posix.h> 14 14 #include <error_table.h> 15 15 16 16 kiocond kiosend(kiochan target, ksraw string, sz* len) { 17 17 if (target.out.kind == kiostream_closed) return kiocond_fail_closed_stream; 18 18 19 19 # ifdef KFenv_posix 20 20 /* issue the write syscall here and now so we can
Modified mod/kmem/heapa.fn.c from [99ad7a3351] to [14fc9d1a27].
6 6 * ~ lexi hale <lexi@hale.su> 7 7 * kmheapa() allocates a pointer on the heap à la libc malloc() 8 8 * see also: kmheapf() "heap free" 9 9 */ 10 10 11 11 /* arch specific headers */ 12 12 #ifdef KFenv_posix 13 -# include <posix/posix.h> 13 +# include <posix.h> 14 14 #endif 15 15 16 16 #include <error_table.h> 17 17 18 18 /* we define all our platform functions here, whether or not 19 19 * they're for the correct platform - only the ones that are 20 20 * called by the preprocessed form of the code will actually
Modified mod/kmem/heapf.fn.c from [868113c60d] to [a8a4c98c3a].
6 6 * ~ lexi hale <lexi@hale.su> 7 7 * kmheapf() frees a region on the heap à la libc free() 8 8 * see also: kmheapa() "heap alloc" 9 9 */ 10 10 11 11 /* arch specific headers */ 12 12 #ifdef KFenv_posix 13 -# include <posix/posix.h> 13 +# include <posix.h> 14 14 #endif 15 15 16 16 /* we define all our platform functions here, whether or not 17 17 * they're for the correct platform - only the ones that are 18 18 * called by the preprocessed form of the code will actually 19 19 * be linked, linker errors are our friend here! */ 20 20 extern int kmem_platform_munmap(void* addr, unsigned long sz);
Modified mod/kmem/lina.fn.c from [0011a847e1] to [5feb3edaf1].
5 5 * this memory simply by growing the heap the proper 6 6 * length. */ 7 7 8 8 #include <k/mem.h> 9 9 #include <k/def.h> 10 10 11 11 #ifdef KFenv_posix 12 -# include <posix/posix.h> 12 +# include <posix.h> 13 13 #endif 14 14 15 15 kmres kmlina(sz size) { 16 16 k_platform_syscall_arg 17 17 top = (sz)kmlini(), 18 18 newbrk = top + size; 19 19
Modified mod/kmem/lini.fn.c from [99be01eb40] to [537b55b516].
6 6 * value `0`. (note that the brk syscall and the libc 7 7 * wrapper have different behavior.) */ 8 8 9 9 #include <k/mem.h> 10 10 #include <k/def.h> 11 11 12 12 #ifdef KFenv_posix 13 -# include <posix/posix.h> 13 +# include <posix.h> 14 14 #endif 15 15 16 16 /* returns void* instead of kmres because kmlini has 17 17 * no failure state */ 18 18 void* kmlini(void) { 19 19 k_platform_syscall_arg zero = 0; 20 20 /* brk adjusts the heap break then returns the new