libk  Check-in [e42b590b45]

Overview
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: e42b590b4576d56235b8e34b4769f5d65a61f507e8ef75fe4d0ee8aca50f6539
User & Date: lexi on 2019-08-24 23:02:13
Other Links: manifest | tags
Context
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
Changes

Added arch/mktbl.posix.sh version [c6b3376c79].















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash

ABI=$2

cat >$1/system_calls.h <<HEADER
#ifndef KIplatform_syscall
#define KIplatform_syscall

enum k_platform_syscall {

HEADER

awk <$1/system_calls.tbl >>$1/system_calls.h -F'\t+' '$2 == "common" || $2 == "'$ABI'" { print "\tk_platform_syscall_" $3 " = " $1 "," }'

cat >>$1/system_calls.h <<FOOTER

};

#endif

FOOTER

cat >$1/error_table.h <<HEADER
#ifndef KIplatform_error
#define KIplatform_error

enum k_platform_error {

HEADER

awk <$1/error_table.tbl >>$1/error_table.h -F' +' '{ print "\tk_platform_error_" $1 " = " $2 "," }'

cat >>$1/error_table.h <<FOOTER

};

#endif

FOOTER

Added arch/posix.h version [bc192b16ff].





















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* arch/posix.h - posix constants
 *  ? this file defines posix magic numbers
 *    needed in syscalls, both cross-platform
 *    ones and os-dependent ones. note that
 *    the values may change depending on the
 *    OS specified! */

#ifndef KIplatform_posix
#define KIplatform_posix
#include <k/def.h>
#include <k/type.h>

#if (!defined(KFplatform_define_constants)) && \
    (!defined(KFplatform_define_types)) && \
    (!defined(KFplatform_define_funcs))
#define KFplatform_define_constants
#define KFplatform_define_types
#define KFplatform_define_funcs
#endif

#ifdef KFplatform_define_constants

enum posix_prot {
	posix_prot_none  = 0,
	posix_prot_read  = 1 << 0,
	posix_prot_write = 1 << 1,
	posix_prot_exec  = 1 << 2
};

enum posix_map {
	posix_map_shared  = 1,
	posix_map_private = 2
};

enum posix_flag {
	posix_flag_fixed     = 0x10,
#if KVos == KA_os_lin
	posix_flag_anonymous = 0x20,
#elif KVos == KA_os_fbsd
	posix_flag_anonymous = 0x1000,
#endif

	/* platform flags */
	posix_flag_linux_hugetlb = 0x40000
};

#endif
#ifdef KFplatform_define_types

/* platform types */

typedef s64 k_platform_syscall_return;
typedef u64 k_platform_syscall_error;

#if KVos == KA_os_lin
	typedef long k_platform_syscall_arg;
#elif KVos == KA_os_fbsd
	typedef u64  k_platform_syscall_arg;
#else
	/* we're going to just pick a sane
	 * fallback that's reasonably likely
	 * to work with most systems one way
	 * or another */
	typedef unsigned long long k_platform_syscall_arg;
#endif

struct k_platform_syscall_answer {
	k_platform_syscall_return ret;
	k_platform_syscall_error error;
};

#endif

#if defined(KFplatform_define_constants) ||\
    defined(KFplatform_define_funcs)
	/* the specific system call table to use is
	 * selected by the build script; /arch/$target
	 * is set as an include directory */
#	include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

#endif

#endif

Deleted arch/posix/errnos version [1054d9a4df].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
EPERM
EINVAL
EBADF
EFAULT
ENOSPC
EDQUOT
EIO
EAGAIN
EFBIG
EINTR
EDESTADDRREQ
EACCES
EMFILE
ENODEV
ENOMEM
ENXIO
EOVERFLOW
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































Deleted arch/posix/posix.h version [676bf37092].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* arch/posix.h - posix constants
 *  ? this file defines posix magic numbers
 *    needed in syscalls, both cross-platform
 *    ones and os-dependent ones. note that
 *    the values may change depending on the
 *    OS specified! */

#ifndef KIplatform_posix
#define KIplatform_posix
#include <k/def.h>
#include <k/type.h>

#if (!defined(KFplatform_define_constants)) && \
    (!defined(KFplatform_define_types)) && \
    (!defined(KFplatform_define_funcs))
#define KFplatform_define_constants
#define KFplatform_define_types
#define KFplatform_define_funcs
#endif

#ifdef KFplatform_define_constants

enum posix_prot {
	posix_prot_none  = 0,
	posix_prot_read  = 1 << 0,
	posix_prot_write = 1 << 1,
	posix_prot_exec  = 1 << 2
};

enum posix_map {
	posix_map_shared  = 1,
	posix_map_private = 2
};

enum posix_flag {
	posix_flag_fixed     = 0x10,
#if KVos == KA_os_lin
	posix_flag_anonymous = 0x20,
#elif KVos == KA_os_fbsd
	posix_flag_anonymous = 0x1000,
#endif

	/* platform flags */
	posix_flag_linux_hugetlb = 0x40000
};

#endif
#ifdef KFplatform_define_types

/* platform types */

typedef s64 k_platform_syscall_return;
typedef u64 k_platform_syscall_error;

#if KVos == KA_os_lin
	typedef long k_platform_syscall_arg;
#elif KVos == KA_os_fbsd
	typedef u64  k_platform_syscall_arg;
#else
	/* we're going to just pick a sane
	 * fallback that's reasonably likely
	 * to work with most systems one way
	 * or another */
	typedef unsigned long long k_platform_syscall_arg;
#endif

struct k_platform_syscall_answer {
	k_platform_syscall_return ret;
	k_platform_syscall_error error;
};

#endif

#if defined(KFplatform_define_constants) ||\
    defined(KFplatform_define_funcs)
#		include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

#endif

#endif
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































Deleted arch/posix/syscalls version [f436d656b4].

1
2
3
4
5
6
exit
read
write
mmap
munmap
brk
<
<
<
<
<
<












Deleted arch/posix/x86.fbsd.32.s version [fb0cced6da].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; syscall numbers - syscall table must be created first!
%include "system_calls.s"

; extremely stupid freebsd-ism: expects the syscall to
; come from a function
_syscall: int 0x80
          ret

%define sys.call call _syscall

; parameters are passed on the stack
%macro syscall 1-*
	mov eax, %1
	%rep %0-1
		%rotate 1
		push %1
	%endrep
	sys.call
	add esp, 4*(%0-1)
%endmacro
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































Deleted arch/posix/x86.fbsd.64.s version [8f1b903740].

1
2
3
4
5
6
7
8
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; syscall numbers - syscall table must be created first!
%include "system_calls.s"

; freebsd uses the common x86-64 ABI
%include "x86.syscall.64.s"
<
<
<
<
<
<
<
<
















Deleted arch/posix/x86.lin.32.s version [30df0fa7c9].

1
2
3
4
5
6
7
8
9
10
11
; register order for syscall convention
%define sys.reg.n 6
%define sys.reg.ret eax
%define sys.reg.0 eax
%define sys.reg.1 ebx
%define sys.reg.2 ecx
%define sys.reg.3 edx
%define sys.reg.4 esi
%define sys.reg.5 edi

%define sys.call int 0x80
<
<
<
<
<
<
<
<
<
<
<






















Deleted arch/posix/x86.lin.64.s version [58546ff139].

1
2
3
4
5
6
7
8
9
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; syscall64 numbers - syscall table must be created first!
%include "system_calls.s"

; linux uses the common x86-64 ABI
%include "../x86.syscall.64.s"

<
<
<
<
<
<
<
<
<


















Deleted arch/x86.cdecl.32.s version [6e1eece757].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
;; x86.cdecl.32.s: x86 cdecl impl
; vim: ft=nasm

%macro ccall 1-*
	%assign i 0
	; arguments must be pushed to the stack backwards
	%assign ct (%0-ct)-1
	%rotate ct
	%rep ct
		%rotate -1
		push %1
	%endrep
	%rotate ct
	push esp ; it's our responsibility to preserve the stack
	call %1
	; the arguments are still on the stack; time to
	; dump them back into the Garbage Zone
	pop esp
%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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* arch/posix.h - posix constants
 *  ? this file defines posix magic numbers
 *    needed in syscalls, both cross-platform
 *    ones and os-dependent ones. note that
 *    the values may change depending on the
 *    OS specified! */

#ifndef KIplatform_posix
#define KIplatform_posix
#include <k/def.h>
#include <k/type.h>

#if (!defined(KFplatform_define_constants)) && \
    (!defined(KFplatform_define_types)) && \
    (!defined(KFplatform_define_funcs))
#define KFplatform_define_constants
#define KFplatform_define_types
#define KFplatform_define_funcs
#endif

#ifdef KFplatform_define_constants

enum posix_prot {
	posix_prot_none  = 0,
	posix_prot_read  = 1 << 0,
	posix_prot_write = 1 << 1,
	posix_prot_exec  = 1 << 2
};

enum posix_map {
	posix_map_shared  = 1,
	posix_map_private = 2
};

enum posix_flag {
	posix_flag_fixed     = 0x10,
#if KVos == KA_os_lin
	posix_flag_anonymous = 0x20,
#elif KVos == KA_os_fbsd
	posix_flag_anonymous = 0x1000,
#endif

	/* platform flags */
	posix_flag_linux_hugetlb = 0x40000
};

#endif
#ifdef KFplatform_define_types

/* platform types */

typedef s64 k_platform_syscall_return;
typedef u64 k_platform_syscall_error;

#if KVos == KA_os_lin
	typedef long k_platform_syscall_arg;
#elif KVos == KA_os_fbsd
	typedef u64  k_platform_syscall_arg;
#else
	/* we're going to just pick a sane
	 * fallback that's reasonably likely
	 * to work with most systems one way
	 * or another */
	typedef unsigned long long k_platform_syscall_arg;
#endif

struct k_platform_syscall_answer {
	k_platform_syscall_return ret;
	k_platform_syscall_error error;
};

#endif

#if defined(KFplatform_define_constants) ||\
    defined(KFplatform_define_funcs)
#		include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

#endif

#endif

Added arch/x86.fbsd.32/syscall.s version [fb0cced6da].















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; syscall numbers - syscall table must be created first!
%include "system_calls.s"

; extremely stupid freebsd-ism: expects the syscall to
; come from a function
_syscall: int 0x80
          ret

%define sys.call call _syscall

; parameters are passed on the stack
%macro syscall 1-*
	mov eax, %1
	%rep %0-1
		%rotate 1
		push %1
	%endrep
	sys.call
	add esp, 4*(%0-1)
%endmacro

Added arch/x86.fbsd.64/cdecl.s version [dab764aed2].





>
>
1
2
; freebsd uses the standard x86-64 calling convention
%include ../x86.cdecl.64

Added arch/x86.fbsd.64/posix.h version [676bf37092].















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* arch/posix.h - posix constants
 *  ? this file defines posix magic numbers
 *    needed in syscalls, both cross-platform
 *    ones and os-dependent ones. note that
 *    the values may change depending on the
 *    OS specified! */

#ifndef KIplatform_posix
#define KIplatform_posix
#include <k/def.h>
#include <k/type.h>

#if (!defined(KFplatform_define_constants)) && \
    (!defined(KFplatform_define_types)) && \
    (!defined(KFplatform_define_funcs))
#define KFplatform_define_constants
#define KFplatform_define_types
#define KFplatform_define_funcs
#endif

#ifdef KFplatform_define_constants

enum posix_prot {
	posix_prot_none  = 0,
	posix_prot_read  = 1 << 0,
	posix_prot_write = 1 << 1,
	posix_prot_exec  = 1 << 2
};

enum posix_map {
	posix_map_shared  = 1,
	posix_map_private = 2
};

enum posix_flag {
	posix_flag_fixed     = 0x10,
#if KVos == KA_os_lin
	posix_flag_anonymous = 0x20,
#elif KVos == KA_os_fbsd
	posix_flag_anonymous = 0x1000,
#endif

	/* platform flags */
	posix_flag_linux_hugetlb = 0x40000
};

#endif
#ifdef KFplatform_define_types

/* platform types */

typedef s64 k_platform_syscall_return;
typedef u64 k_platform_syscall_error;

#if KVos == KA_os_lin
	typedef long k_platform_syscall_arg;
#elif KVos == KA_os_fbsd
	typedef u64  k_platform_syscall_arg;
#else
	/* we're going to just pick a sane
	 * fallback that's reasonably likely
	 * to work with most systems one way
	 * or another */
	typedef unsigned long long k_platform_syscall_arg;
#endif

struct k_platform_syscall_answer {
	k_platform_syscall_return ret;
	k_platform_syscall_error error;
};

#endif

#if defined(KFplatform_define_constants) ||\
    defined(KFplatform_define_funcs)
#		include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

#endif

#endif

Added arch/x86.fbsd.64/syscall.s version [8f1b903740].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; syscall numbers - syscall table must be created first!
%include "system_calls.s"

; freebsd uses the common x86-64 ABI
%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
2
3
4
/* no special changes are needed from the 
 * normal POSIX header. */

#include <arch/posix.h>

Added arch/x86.lin.32/syscall.s version [30df0fa7c9].























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
; register order for syscall convention
%define sys.reg.n 6
%define sys.reg.ret eax
%define sys.reg.0 eax
%define sys.reg.1 ebx
%define sys.reg.2 ecx
%define sys.reg.3 edx
%define sys.reg.4 esi
%define sys.reg.5 edi

%define sys.call int 0x80

Added arch/x86.lin.64/cdecl.s version [92abebdccc].





>
>
1
2
; linux uses the standard 64-bit calling convention
%include 'arch/x86.cdecl.64.s'

Added arch/x86.lin.64/error_table.h version [236c9ded31].































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#ifndef KIplatform_error
#define KIplatform_error

enum k_platform_error {

	k_platform_error_EPERM = 1,
	k_platform_error_ENOENT = 2,
	k_platform_error_ESRCH = 3,
	k_platform_error_EINTR = 4,
	k_platform_error_EIO = 5,
	k_platform_error_ENXIO = 6,
	k_platform_error_E2BIG = 7,
	k_platform_error_ENOEXEC = 8,
	k_platform_error_EBADF = 9,
	k_platform_error_ECHILD = 10,
	k_platform_error_EAGAIN = 11,
	k_platform_error_ENOMEM = 12,
	k_platform_error_EACCES = 13,
	k_platform_error_EFAULT = 14,
	k_platform_error_ENOTBLK = 15,
	k_platform_error_EBUSY = 16,
	k_platform_error_EEXIST = 17,
	k_platform_error_EXDEV = 18,
	k_platform_error_ENODEV = 19,
	k_platform_error_ENOTDIR = 20,
	k_platform_error_EISDIR = 21,
	k_platform_error_EINVAL = 22,
	k_platform_error_ENFILE = 23,
	k_platform_error_EMFILE = 24,
	k_platform_error_ENOTTY = 25,
	k_platform_error_ETXTBSY = 26,
	k_platform_error_EFBIG = 27,
	k_platform_error_ENOSPC = 28,
	k_platform_error_ESPIPE = 29,
	k_platform_error_EROFS = 30,
	k_platform_error_EMLINK = 31,
	k_platform_error_EPIPE = 32,
	k_platform_error_EDOM = 33,
	k_platform_error_ERANGE = 34,
	k_platform_error_EDEADLK = 35,
	k_platform_error_ENAMETOOLONG = 36,
	k_platform_error_ENOLCK = 37,
	k_platform_error_ENOSYS = 38,
	k_platform_error_ENOTEMPTY = 39,
	k_platform_error_ELOOP = 40,
	k_platform_error_EWOULDBLOCK = 11,
	k_platform_error_ENOMSG = 42,
	k_platform_error_EIDRM = 43,
	k_platform_error_ECHRNG = 44,
	k_platform_error_EL2NSYNC = 45,
	k_platform_error_EL3HLT = 46,
	k_platform_error_EL3RST = 47,
	k_platform_error_ELNRNG = 48,
	k_platform_error_EUNATCH = 49,
	k_platform_error_ENOCSI = 50,
	k_platform_error_EL2HLT = 51,
	k_platform_error_EBADE = 52,
	k_platform_error_EBADR = 53,
	k_platform_error_EXFULL = 54,
	k_platform_error_ENOANO = 55,
	k_platform_error_EBADRQC = 56,
	k_platform_error_EBADSLT = 57,
	k_platform_error_EDEADLOCK = 35,
	k_platform_error_EBFONT = 59,
	k_platform_error_ENOSTR = 60,
	k_platform_error_ENODATA = 61,
	k_platform_error_ETIME = 62,
	k_platform_error_ENOSR = 63,
	k_platform_error_ENONET = 64,
	k_platform_error_ENOPKG = 65,
	k_platform_error_EREMOTE = 66,
	k_platform_error_ENOLINK = 67,
	k_platform_error_EADV = 68,
	k_platform_error_ESRMNT = 69,
	k_platform_error_ECOMM = 70,
	k_platform_error_EPROTO = 71,
	k_platform_error_EMULTIHOP = 72,
	k_platform_error_EDOTDOT = 73,
	k_platform_error_EBADMSG = 74,
	k_platform_error_EOVERFLOW = 75,
	k_platform_error_ENOTUNIQ = 76,
	k_platform_error_EBADFD = 77,
	k_platform_error_EREMCHG = 78,
	k_platform_error_ELIBACC = 79,
	k_platform_error_ELIBBAD = 80,
	k_platform_error_ELIBSCN = 81,
	k_platform_error_ELIBMAX = 82,
	k_platform_error_ELIBEXEC = 83,
	k_platform_error_EILSEQ = 84,
	k_platform_error_ERESTART = 85,
	k_platform_error_ESTRPIPE = 86,
	k_platform_error_EUSERS = 87,
	k_platform_error_ENOTSOCK = 88,
	k_platform_error_EDESTADDRREQ = 89,
	k_platform_error_EMSGSIZE = 90,
	k_platform_error_EPROTOTYPE = 91,
	k_platform_error_ENOPROTOOPT = 92,
	k_platform_error_EPROTONOSUPPORT = 93,
	k_platform_error_ESOCKTNOSUPPORT = 94,
	k_platform_error_EOPNOTSUPP = 95,
	k_platform_error_EPFNOSUPPORT = 96,
	k_platform_error_EAFNOSUPPORT = 97,
	k_platform_error_EADDRINUSE = 98,
	k_platform_error_EADDRNOTAVAIL = 99,
	k_platform_error_ENETDOWN = 100,
	k_platform_error_ENETUNREACH = 101,
	k_platform_error_ENETRESET = 102,
	k_platform_error_ECONNABORTED = 103,
	k_platform_error_ECONNRESET = 104,
	k_platform_error_ENOBUFS = 105,
	k_platform_error_EISCONN = 106,
	k_platform_error_ENOTCONN = 107,
	k_platform_error_ESHUTDOWN = 108,
	k_platform_error_ETOOMANYREFS = 109,
	k_platform_error_ETIMEDOUT = 110,
	k_platform_error_ECONNREFUSED = 111,
	k_platform_error_EHOSTDOWN = 112,
	k_platform_error_EHOSTUNREACH = 113,
	k_platform_error_EALREADY = 114,
	k_platform_error_EINPROGRESS = 115,
	k_platform_error_ESTALE = 116,
	k_platform_error_EUCLEAN = 117,
	k_platform_error_ENOTNAM = 118,
	k_platform_error_ENAVAIL = 119,
	k_platform_error_EISNAM = 120,
	k_platform_error_EREMOTEIO = 121,
	k_platform_error_EDQUOT = 122,
	k_platform_error_ENOMEDIUM = 123,
	k_platform_error_EMEDIUMTYPE = 124,
	k_platform_error_ECANCELED = 125,
	k_platform_error_ENOKEY = 126,
	k_platform_error_EKEYEXPIRED = 127,
	k_platform_error_EKEYREVOKED = 128,
	k_platform_error_EKEYREJECTED = 129,
	k_platform_error_EOWNERDEAD = 130,
	k_platform_error_ENOTRECOVERABLE = 131,
	k_platform_error_ERFKILL = 132,
	k_platform_error_EHWPOISON = 133,

};

#endif

Added arch/x86.lin.64/error_table.tbl version [bf50702918].











































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
EPERM  1
ENOENT  2
ESRCH  3
EINTR  4
EIO  5
ENXIO  6
E2BIG  7
ENOEXEC  8
EBADF  9
ECHILD 10
EAGAIN 11
ENOMEM 12
EACCES 13
EFAULT 14
ENOTBLK 15
EBUSY 16
EEXIST 17
EXDEV 18
ENODEV 19
ENOTDIR 20
EISDIR 21
EINVAL 22
ENFILE 23
EMFILE 24
ENOTTY 25
ETXTBSY 26
EFBIG 27
ENOSPC 28
ESPIPE 29
EROFS 30
EMLINK 31
EPIPE 32
EDOM 33
ERANGE 34
EDEADLK 35
ENAMETOOLONG 36
ENOLCK 37
ENOSYS 38
ENOTEMPTY 39
ELOOP 40
EWOULDBLOCK 11
ENOMSG 42
EIDRM 43
ECHRNG 44
EL2NSYNC 45
EL3HLT 46
EL3RST 47
ELNRNG 48
EUNATCH 49
ENOCSI 50
EL2HLT 51
EBADE 52
EBADR 53
EXFULL 54
ENOANO 55
EBADRQC 56
EBADSLT 57
EDEADLOCK 35
EBFONT 59
ENOSTR 60
ENODATA 61
ETIME 62
ENOSR 63
ENONET 64
ENOPKG 65
EREMOTE 66
ENOLINK 67
EADV 68
ESRMNT 69
ECOMM 70
EPROTO 71
EMULTIHOP 72
EDOTDOT 73
EBADMSG 74
EOVERFLOW 75
ENOTUNIQ 76
EBADFD 77
EREMCHG 78
ELIBACC 79
ELIBBAD 80
ELIBSCN 81
ELIBMAX 82
ELIBEXEC 83
EILSEQ 84
ERESTART 85
ESTRPIPE 86
EUSERS 87
ENOTSOCK 88
EDESTADDRREQ 89
EMSGSIZE 90
EPROTOTYPE 91
ENOPROTOOPT 92
EPROTONOSUPPORT 93
ESOCKTNOSUPPORT 94
EOPNOTSUPP 95
EPFNOSUPPORT 96
EAFNOSUPPORT 97
EADDRINUSE 98
EADDRNOTAVAIL 99
ENETDOWN 100
ENETUNREACH 101
ENETRESET 102
ECONNABORTED 103
ECONNRESET 104
ENOBUFS 105
EISCONN 106
ENOTCONN 107
ESHUTDOWN 108
ETOOMANYREFS 109
ETIMEDOUT 110
ECONNREFUSED 111
EHOSTDOWN 112
EHOSTUNREACH 113
EALREADY 114
EINPROGRESS 115
ESTALE 116
EUCLEAN 117
ENOTNAM 118
ENAVAIL 119
EISNAM 120
EREMOTEIO 121
EDQUOT 122
ENOMEDIUM 123
EMEDIUMTYPE 124
ECANCELED 125
ENOKEY 126
EKEYEXPIRED 127
EKEYREVOKED 128
EKEYREJECTED 129
EOWNERDEAD 130
ENOTRECOVERABLE 131
ERFKILL 132
EHWPOISON 133

Added arch/x86.lin.64/posix.h version [4a7813cd60].









>
>
>
>
1
2
3
4
/* no special changes are needed from the 
 * normal POSIX header. */

#include <arch/posix.h>

Added arch/x86.lin.64/syscall.s version [b719b03db7].











>
>
>
>
>
1
2
3
4
5
;; abi definition file for x86 linux 64-bit
; vim: ft=nasm

; linux uses the common x86-64 ABI
%include "../x86.syscall.64.s"

Added arch/x86.lin.64/system_calls.h version [82935502f3].











































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
#ifndef KIplatform_syscall
#define KIplatform_syscall

enum k_platform_syscall {

	k_platform_syscall_read = 0,
	k_platform_syscall_write = 1,
	k_platform_syscall_open = 2,
	k_platform_syscall_close = 3,
	k_platform_syscall_stat = 4,
	k_platform_syscall_fstat = 5,
	k_platform_syscall_lstat = 6,
	k_platform_syscall_poll = 7,
	k_platform_syscall_lseek = 8,
	k_platform_syscall_mmap = 9,
	k_platform_syscall_mprotect = 10,
	k_platform_syscall_munmap = 11,
	k_platform_syscall_brk = 12,
	k_platform_syscall_rt_sigaction = 13,
	k_platform_syscall_rt_sigprocmask = 14,
	k_platform_syscall_rt_sigreturn = 15,
	k_platform_syscall_ioctl = 16,
	k_platform_syscall_pread64 = 17,
	k_platform_syscall_pwrite64 = 18,
	k_platform_syscall_readv = 19,
	k_platform_syscall_writev = 20,
	k_platform_syscall_access = 21,
	k_platform_syscall_pipe = 22,
	k_platform_syscall_select = 23,
	k_platform_syscall_sched_yield = 24,
	k_platform_syscall_mremap = 25,
	k_platform_syscall_msync = 26,
	k_platform_syscall_mincore = 27,
	k_platform_syscall_madvise = 28,
	k_platform_syscall_shmget = 29,
	k_platform_syscall_shmat = 30,
	k_platform_syscall_shmctl = 31,
	k_platform_syscall_dup = 32,
	k_platform_syscall_dup2 = 33,
	k_platform_syscall_pause = 34,
	k_platform_syscall_nanosleep = 35,
	k_platform_syscall_getitimer = 36,
	k_platform_syscall_alarm = 37,
	k_platform_syscall_setitimer = 38,
	k_platform_syscall_getpid = 39,
	k_platform_syscall_sendfile = 40,
	k_platform_syscall_socket = 41,
	k_platform_syscall_connect = 42,
	k_platform_syscall_accept = 43,
	k_platform_syscall_sendto = 44,
	k_platform_syscall_recvfrom = 45,
	k_platform_syscall_sendmsg = 46,
	k_platform_syscall_recvmsg = 47,
	k_platform_syscall_shutdown = 48,
	k_platform_syscall_bind = 49,
	k_platform_syscall_listen = 50,
	k_platform_syscall_getsockname = 51,
	k_platform_syscall_getpeername = 52,
	k_platform_syscall_socketpair = 53,
	k_platform_syscall_setsockopt = 54,
	k_platform_syscall_getsockopt = 55,
	k_platform_syscall_clone = 56,
	k_platform_syscall_fork = 57,
	k_platform_syscall_vfork = 58,
	k_platform_syscall_execve = 59,
	k_platform_syscall_exit = 60,
	k_platform_syscall_wait4 = 61,
	k_platform_syscall_kill = 62,
	k_platform_syscall_uname = 63,
	k_platform_syscall_semget = 64,
	k_platform_syscall_semop = 65,
	k_platform_syscall_semctl = 66,
	k_platform_syscall_shmdt = 67,
	k_platform_syscall_msgget = 68,
	k_platform_syscall_msgsnd = 69,
	k_platform_syscall_msgrcv = 70,
	k_platform_syscall_msgctl = 71,
	k_platform_syscall_fcntl = 72,
	k_platform_syscall_flock = 73,
	k_platform_syscall_fsync = 74,
	k_platform_syscall_fdatasync = 75,
	k_platform_syscall_truncate = 76,
	k_platform_syscall_ftruncate = 77,
	k_platform_syscall_getdents = 78,
	k_platform_syscall_getcwd = 79,
	k_platform_syscall_chdir = 80,
	k_platform_syscall_fchdir = 81,
	k_platform_syscall_rename = 82,
	k_platform_syscall_mkdir = 83,
	k_platform_syscall_rmdir = 84,
	k_platform_syscall_creat = 85,
	k_platform_syscall_link = 86,
	k_platform_syscall_unlink = 87,
	k_platform_syscall_symlink = 88,
	k_platform_syscall_readlink = 89,
	k_platform_syscall_chmod = 90,
	k_platform_syscall_fchmod = 91,
	k_platform_syscall_chown = 92,
	k_platform_syscall_fchown = 93,
	k_platform_syscall_lchown = 94,
	k_platform_syscall_umask = 95,
	k_platform_syscall_gettimeofday = 96,
	k_platform_syscall_getrlimit = 97,
	k_platform_syscall_getrusage = 98,
	k_platform_syscall_sysinfo = 99,
	k_platform_syscall_times = 100,
	k_platform_syscall_ptrace = 101,
	k_platform_syscall_getuid = 102,
	k_platform_syscall_syslog = 103,
	k_platform_syscall_getgid = 104,
	k_platform_syscall_setuid = 105,
	k_platform_syscall_setgid = 106,
	k_platform_syscall_geteuid = 107,
	k_platform_syscall_getegid = 108,
	k_platform_syscall_setpgid = 109,
	k_platform_syscall_getppid = 110,
	k_platform_syscall_getpgrp = 111,
	k_platform_syscall_setsid = 112,
	k_platform_syscall_setreuid = 113,
	k_platform_syscall_setregid = 114,
	k_platform_syscall_getgroups = 115,
	k_platform_syscall_setgroups = 116,
	k_platform_syscall_setresuid = 117,
	k_platform_syscall_getresuid = 118,
	k_platform_syscall_setresgid = 119,
	k_platform_syscall_getresgid = 120,
	k_platform_syscall_getpgid = 121,
	k_platform_syscall_setfsuid = 122,
	k_platform_syscall_setfsgid = 123,
	k_platform_syscall_getsid = 124,
	k_platform_syscall_capget = 125,
	k_platform_syscall_capset = 126,
	k_platform_syscall_rt_sigpending = 127,
	k_platform_syscall_rt_sigtimedwait = 128,
	k_platform_syscall_rt_sigqueueinfo = 129,
	k_platform_syscall_rt_sigsuspend = 130,
	k_platform_syscall_sigaltstack = 131,
	k_platform_syscall_utime = 132,
	k_platform_syscall_mknod = 133,
	k_platform_syscall_uselib = 134,
	k_platform_syscall_personality = 135,
	k_platform_syscall_ustat = 136,
	k_platform_syscall_statfs = 137,
	k_platform_syscall_fstatfs = 138,
	k_platform_syscall_sysfs = 139,
	k_platform_syscall_getpriority = 140,
	k_platform_syscall_setpriority = 141,
	k_platform_syscall_sched_setparam = 142,
	k_platform_syscall_sched_getparam = 143,
	k_platform_syscall_sched_setscheduler = 144,
	k_platform_syscall_sched_getscheduler = 145,
	k_platform_syscall_sched_get_priority_max = 146,
	k_platform_syscall_sched_get_priority_min = 147,
	k_platform_syscall_sched_rr_get_interval = 148,
	k_platform_syscall_mlock = 149,
	k_platform_syscall_munlock = 150,
	k_platform_syscall_mlockall = 151,
	k_platform_syscall_munlockall = 152,
	k_platform_syscall_vhangup = 153,
	k_platform_syscall_modify_ldt = 154,
	k_platform_syscall_pivot_root = 155,
	k_platform_syscall__sysctl = 156,
	k_platform_syscall_prctl = 157,
	k_platform_syscall_arch_prctl = 158,
	k_platform_syscall_adjtimex = 159,
	k_platform_syscall_setrlimit = 160,
	k_platform_syscall_chroot = 161,
	k_platform_syscall_sync = 162,
	k_platform_syscall_acct = 163,
	k_platform_syscall_settimeofday = 164,
	k_platform_syscall_mount = 165,
	k_platform_syscall_umount2 = 166,
	k_platform_syscall_swapon = 167,
	k_platform_syscall_swapoff = 168,
	k_platform_syscall_reboot = 169,
	k_platform_syscall_sethostname = 170,
	k_platform_syscall_setdomainname = 171,
	k_platform_syscall_iopl = 172,
	k_platform_syscall_ioperm = 173,
	k_platform_syscall_create_module = 174,
	k_platform_syscall_init_module = 175,
	k_platform_syscall_delete_module = 176,
	k_platform_syscall_get_kernel_syms = 177,
	k_platform_syscall_query_module = 178,
	k_platform_syscall_quotactl = 179,
	k_platform_syscall_nfsservctl = 180,
	k_platform_syscall_getpmsg = 181,
	k_platform_syscall_putpmsg = 182,
	k_platform_syscall_afs_syscall = 183,
	k_platform_syscall_tuxcall = 184,
	k_platform_syscall_security = 185,
	k_platform_syscall_gettid = 186,
	k_platform_syscall_readahead = 187,
	k_platform_syscall_setxattr = 188,
	k_platform_syscall_lsetxattr = 189,
	k_platform_syscall_fsetxattr = 190,
	k_platform_syscall_getxattr = 191,
	k_platform_syscall_lgetxattr = 192,
	k_platform_syscall_fgetxattr = 193,
	k_platform_syscall_listxattr = 194,
	k_platform_syscall_llistxattr = 195,
	k_platform_syscall_flistxattr = 196,
	k_platform_syscall_removexattr = 197,
	k_platform_syscall_lremovexattr = 198,
	k_platform_syscall_fremovexattr = 199,
	k_platform_syscall_tkill = 200,
	k_platform_syscall_time = 201,
	k_platform_syscall_futex = 202,
	k_platform_syscall_sched_setaffinity = 203,
	k_platform_syscall_sched_getaffinity = 204,
	k_platform_syscall_set_thread_area = 205,
	k_platform_syscall_io_setup = 206,
	k_platform_syscall_io_destroy = 207,
	k_platform_syscall_io_getevents = 208,
	k_platform_syscall_io_submit = 209,
	k_platform_syscall_io_cancel = 210,
	k_platform_syscall_get_thread_area = 211,
	k_platform_syscall_lookup_dcookie = 212,
	k_platform_syscall_epoll_create = 213,
	k_platform_syscall_epoll_ctl_old = 214,
	k_platform_syscall_epoll_wait_old = 215,
	k_platform_syscall_remap_file_pages = 216,
	k_platform_syscall_getdents64 = 217,
	k_platform_syscall_set_tid_address = 218,
	k_platform_syscall_restart_syscall = 219,
	k_platform_syscall_semtimedop = 220,
	k_platform_syscall_fadvise64 = 221,
	k_platform_syscall_timer_create = 222,
	k_platform_syscall_timer_settime = 223,
	k_platform_syscall_timer_gettime = 224,
	k_platform_syscall_timer_getoverrun = 225,
	k_platform_syscall_timer_delete = 226,
	k_platform_syscall_clock_settime = 227,
	k_platform_syscall_clock_gettime = 228,
	k_platform_syscall_clock_getres = 229,
	k_platform_syscall_clock_nanosleep = 230,
	k_platform_syscall_exit_group = 231,
	k_platform_syscall_epoll_wait = 232,
	k_platform_syscall_epoll_ctl = 233,
	k_platform_syscall_tgkill = 234,
	k_platform_syscall_utimes = 235,
	k_platform_syscall_vserver = 236,
	k_platform_syscall_mbind = 237,
	k_platform_syscall_set_mempolicy = 238,
	k_platform_syscall_get_mempolicy = 239,
	k_platform_syscall_mq_open = 240,
	k_platform_syscall_mq_unlink = 241,
	k_platform_syscall_mq_timedsend = 242,
	k_platform_syscall_mq_timedreceive = 243,
	k_platform_syscall_mq_notify = 244,
	k_platform_syscall_mq_getsetattr = 245,
	k_platform_syscall_kexec_load = 246,
	k_platform_syscall_waitid = 247,
	k_platform_syscall_add_key = 248,
	k_platform_syscall_request_key = 249,
	k_platform_syscall_keyctl = 250,
	k_platform_syscall_ioprio_set = 251,
	k_platform_syscall_ioprio_get = 252,
	k_platform_syscall_inotify_init = 253,
	k_platform_syscall_inotify_add_watch = 254,
	k_platform_syscall_inotify_rm_watch = 255,
	k_platform_syscall_migrate_pages = 256,
	k_platform_syscall_openat = 257,
	k_platform_syscall_mkdirat = 258,
	k_platform_syscall_mknodat = 259,
	k_platform_syscall_fchownat = 260,
	k_platform_syscall_futimesat = 261,
	k_platform_syscall_newfstatat = 262,
	k_platform_syscall_unlinkat = 263,
	k_platform_syscall_renameat = 264,
	k_platform_syscall_linkat = 265,
	k_platform_syscall_symlinkat = 266,
	k_platform_syscall_readlinkat = 267,
	k_platform_syscall_fchmodat = 268,
	k_platform_syscall_faccessat = 269,
	k_platform_syscall_pselect6 = 270,
	k_platform_syscall_ppoll = 271,
	k_platform_syscall_unshare = 272,
	k_platform_syscall_set_robust_list = 273,
	k_platform_syscall_get_robust_list = 274,
	k_platform_syscall_splice = 275,
	k_platform_syscall_tee = 276,
	k_platform_syscall_sync_file_range = 277,
	k_platform_syscall_vmsplice = 278,
	k_platform_syscall_move_pages = 279,
	k_platform_syscall_utimensat = 280,
	k_platform_syscall_epoll_pwait = 281,
	k_platform_syscall_signalfd = 282,
	k_platform_syscall_timerfd_create = 283,
	k_platform_syscall_eventfd = 284,
	k_platform_syscall_fallocate = 285,
	k_platform_syscall_timerfd_settime = 286,
	k_platform_syscall_timerfd_gettime = 287,
	k_platform_syscall_accept4 = 288,
	k_platform_syscall_signalfd4 = 289,
	k_platform_syscall_eventfd2 = 290,
	k_platform_syscall_epoll_create1 = 291,
	k_platform_syscall_dup3 = 292,
	k_platform_syscall_pipe2 = 293,
	k_platform_syscall_inotify_init1 = 294,
	k_platform_syscall_preadv = 295,
	k_platform_syscall_pwritev = 296,
	k_platform_syscall_rt_tgsigqueueinfo = 297,
	k_platform_syscall_perf_event_open = 298,
	k_platform_syscall_recvmmsg = 299,
	k_platform_syscall_fanotify_init = 300,
	k_platform_syscall_fanotify_mark = 301,
	k_platform_syscall_prlimit64 = 302,
	k_platform_syscall_name_to_handle_at = 303,
	k_platform_syscall_open_by_handle_at = 304,
	k_platform_syscall_clock_adjtime = 305,
	k_platform_syscall_syncfs = 306,
	k_platform_syscall_sendmmsg = 307,
	k_platform_syscall_setns = 308,
	k_platform_syscall_getcpu = 309,
	k_platform_syscall_process_vm_readv = 310,
	k_platform_syscall_process_vm_writev = 311,
	k_platform_syscall_kcmp = 312,
	k_platform_syscall_finit_module = 313,
	k_platform_syscall_sched_setattr = 314,
	k_platform_syscall_sched_getattr = 315,
	k_platform_syscall_renameat2 = 316,
	k_platform_syscall_seccomp = 317,
	k_platform_syscall_getrandom = 318,
	k_platform_syscall_memfd_create = 319,
	k_platform_syscall_kexec_file_load = 320,
	k_platform_syscall_bpf = 321,
	k_platform_syscall_execveat = 322,
	k_platform_syscall_userfaultfd = 323,
	k_platform_syscall_membarrier = 324,
	k_platform_syscall_mlock2 = 325,
	k_platform_syscall_copy_file_range = 326,
	k_platform_syscall_preadv2 = 327,
	k_platform_syscall_pwritev2 = 328,
	k_platform_syscall_pkey_mprotect = 329,
	k_platform_syscall_pkey_alloc = 330,
	k_platform_syscall_pkey_free = 331,
	k_platform_syscall_statx = 332,
	k_platform_syscall_io_pgetevents = 333,
	k_platform_syscall_rseq = 334,
	k_platform_syscall_pidfd_send_signal = 424,
	k_platform_syscall_io_uring_setup = 425,
	k_platform_syscall_io_uring_enter = 426,
	k_platform_syscall_io_uring_register = 427,
	k_platform_syscall_open_tree = 428,
	k_platform_syscall_move_mount = 429,
	k_platform_syscall_fsopen = 430,
	k_platform_syscall_fsconfig = 431,
	k_platform_syscall_fsmount = 432,
	k_platform_syscall_fspick = 433,
	k_platform_syscall_pidfd_open = 434,
	k_platform_syscall_clone3 = 435,

};

#endif

Added arch/x86.lin.64/system_calls.tbl version [474283bc8d].









































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# imported from kernel source tree; original file
# at /arch/x86/entry/syscalls/syscall_64.tbl
# ----
# 64-bit system call numbers and entry vectors
#
# The format is:
# <number> <abi> <name> <entry point>
#
# The __x64_sys_*() stubs are created on-the-fly for sys_*() system calls
#
# The abi is "common", "64" or "x32" for this file.
#
0	common	read			__x64_sys_read
1	common	write			__x64_sys_write
2	common	open			__x64_sys_open
3	common	close			__x64_sys_close
4	common	stat			__x64_sys_newstat
5	common	fstat			__x64_sys_newfstat
6	common	lstat			__x64_sys_newlstat
7	common	poll			__x64_sys_poll
8	common	lseek			__x64_sys_lseek
9	common	mmap			__x64_sys_mmap
10	common	mprotect		__x64_sys_mprotect
11	common	munmap			__x64_sys_munmap
12	common	brk			__x64_sys_brk
13	64	rt_sigaction		__x64_sys_rt_sigaction
14	common	rt_sigprocmask		__x64_sys_rt_sigprocmask
15	64	rt_sigreturn		__x64_sys_rt_sigreturn/ptregs
16	64	ioctl			__x64_sys_ioctl
17	common	pread64			__x64_sys_pread64
18	common	pwrite64		__x64_sys_pwrite64
19	64	readv			__x64_sys_readv
20	64	writev			__x64_sys_writev
21	common	access			__x64_sys_access
22	common	pipe			__x64_sys_pipe
23	common	select			__x64_sys_select
24	common	sched_yield		__x64_sys_sched_yield
25	common	mremap			__x64_sys_mremap
26	common	msync			__x64_sys_msync
27	common	mincore			__x64_sys_mincore
28	common	madvise			__x64_sys_madvise
29	common	shmget			__x64_sys_shmget
30	common	shmat			__x64_sys_shmat
31	common	shmctl			__x64_sys_shmctl
32	common	dup			__x64_sys_dup
33	common	dup2			__x64_sys_dup2
34	common	pause			__x64_sys_pause
35	common	nanosleep		__x64_sys_nanosleep
36	common	getitimer		__x64_sys_getitimer
37	common	alarm			__x64_sys_alarm
38	common	setitimer		__x64_sys_setitimer
39	common	getpid			__x64_sys_getpid
40	common	sendfile		__x64_sys_sendfile64
41	common	socket			__x64_sys_socket
42	common	connect			__x64_sys_connect
43	common	accept			__x64_sys_accept
44	common	sendto			__x64_sys_sendto
45	64	recvfrom		__x64_sys_recvfrom
46	64	sendmsg			__x64_sys_sendmsg
47	64	recvmsg			__x64_sys_recvmsg
48	common	shutdown		__x64_sys_shutdown
49	common	bind			__x64_sys_bind
50	common	listen			__x64_sys_listen
51	common	getsockname		__x64_sys_getsockname
52	common	getpeername		__x64_sys_getpeername
53	common	socketpair		__x64_sys_socketpair
54	64	setsockopt		__x64_sys_setsockopt
55	64	getsockopt		__x64_sys_getsockopt
56	common	clone			__x64_sys_clone/ptregs
57	common	fork			__x64_sys_fork/ptregs
58	common	vfork			__x64_sys_vfork/ptregs
59	64	execve			__x64_sys_execve/ptregs
60	common	exit			__x64_sys_exit
61	common	wait4			__x64_sys_wait4
62	common	kill			__x64_sys_kill
63	common	uname			__x64_sys_newuname
64	common	semget			__x64_sys_semget
65	common	semop			__x64_sys_semop
66	common	semctl			__x64_sys_semctl
67	common	shmdt			__x64_sys_shmdt
68	common	msgget			__x64_sys_msgget
69	common	msgsnd			__x64_sys_msgsnd
70	common	msgrcv			__x64_sys_msgrcv
71	common	msgctl			__x64_sys_msgctl
72	common	fcntl			__x64_sys_fcntl
73	common	flock			__x64_sys_flock
74	common	fsync			__x64_sys_fsync
75	common	fdatasync		__x64_sys_fdatasync
76	common	truncate		__x64_sys_truncate
77	common	ftruncate		__x64_sys_ftruncate
78	common	getdents		__x64_sys_getdents
79	common	getcwd			__x64_sys_getcwd
80	common	chdir			__x64_sys_chdir
81	common	fchdir			__x64_sys_fchdir
82	common	rename			__x64_sys_rename
83	common	mkdir			__x64_sys_mkdir
84	common	rmdir			__x64_sys_rmdir
85	common	creat			__x64_sys_creat
86	common	link			__x64_sys_link
87	common	unlink			__x64_sys_unlink
88	common	symlink			__x64_sys_symlink
89	common	readlink		__x64_sys_readlink
90	common	chmod			__x64_sys_chmod
91	common	fchmod			__x64_sys_fchmod
92	common	chown			__x64_sys_chown
93	common	fchown			__x64_sys_fchown
94	common	lchown			__x64_sys_lchown
95	common	umask			__x64_sys_umask
96	common	gettimeofday		__x64_sys_gettimeofday
97	common	getrlimit		__x64_sys_getrlimit
98	common	getrusage		__x64_sys_getrusage
99	common	sysinfo			__x64_sys_sysinfo
100	common	times			__x64_sys_times
101	64	ptrace			__x64_sys_ptrace
102	common	getuid			__x64_sys_getuid
103	common	syslog			__x64_sys_syslog
104	common	getgid			__x64_sys_getgid
105	common	setuid			__x64_sys_setuid
106	common	setgid			__x64_sys_setgid
107	common	geteuid			__x64_sys_geteuid
108	common	getegid			__x64_sys_getegid
109	common	setpgid			__x64_sys_setpgid
110	common	getppid			__x64_sys_getppid
111	common	getpgrp			__x64_sys_getpgrp
112	common	setsid			__x64_sys_setsid
113	common	setreuid		__x64_sys_setreuid
114	common	setregid		__x64_sys_setregid
115	common	getgroups		__x64_sys_getgroups
116	common	setgroups		__x64_sys_setgroups
117	common	setresuid		__x64_sys_setresuid
118	common	getresuid		__x64_sys_getresuid
119	common	setresgid		__x64_sys_setresgid
120	common	getresgid		__x64_sys_getresgid
121	common	getpgid			__x64_sys_getpgid
122	common	setfsuid		__x64_sys_setfsuid
123	common	setfsgid		__x64_sys_setfsgid
124	common	getsid			__x64_sys_getsid
125	common	capget			__x64_sys_capget
126	common	capset			__x64_sys_capset
127	64	rt_sigpending		__x64_sys_rt_sigpending
128	64	rt_sigtimedwait		__x64_sys_rt_sigtimedwait
129	64	rt_sigqueueinfo		__x64_sys_rt_sigqueueinfo
130	common	rt_sigsuspend		__x64_sys_rt_sigsuspend
131	64	sigaltstack		__x64_sys_sigaltstack
132	common	utime			__x64_sys_utime
133	common	mknod			__x64_sys_mknod
134	64	uselib
135	common	personality		__x64_sys_personality
136	common	ustat			__x64_sys_ustat
137	common	statfs			__x64_sys_statfs
138	common	fstatfs			__x64_sys_fstatfs
139	common	sysfs			__x64_sys_sysfs
140	common	getpriority		__x64_sys_getpriority
141	common	setpriority		__x64_sys_setpriority
142	common	sched_setparam		__x64_sys_sched_setparam
143	common	sched_getparam		__x64_sys_sched_getparam
144	common	sched_setscheduler	__x64_sys_sched_setscheduler
145	common	sched_getscheduler	__x64_sys_sched_getscheduler
146	common	sched_get_priority_max	__x64_sys_sched_get_priority_max
147	common	sched_get_priority_min	__x64_sys_sched_get_priority_min
148	common	sched_rr_get_interval	__x64_sys_sched_rr_get_interval
149	common	mlock			__x64_sys_mlock
150	common	munlock			__x64_sys_munlock
151	common	mlockall		__x64_sys_mlockall
152	common	munlockall		__x64_sys_munlockall
153	common	vhangup			__x64_sys_vhangup
154	common	modify_ldt		__x64_sys_modify_ldt
155	common	pivot_root		__x64_sys_pivot_root
156	64	_sysctl			__x64_sys_sysctl
157	common	prctl			__x64_sys_prctl
158	common	arch_prctl		__x64_sys_arch_prctl
159	common	adjtimex		__x64_sys_adjtimex
160	common	setrlimit		__x64_sys_setrlimit
161	common	chroot			__x64_sys_chroot
162	common	sync			__x64_sys_sync
163	common	acct			__x64_sys_acct
164	common	settimeofday		__x64_sys_settimeofday
165	common	mount			__x64_sys_mount
166	common	umount2			__x64_sys_umount
167	common	swapon			__x64_sys_swapon
168	common	swapoff			__x64_sys_swapoff
169	common	reboot			__x64_sys_reboot
170	common	sethostname		__x64_sys_sethostname
171	common	setdomainname		__x64_sys_setdomainname
172	common	iopl			__x64_sys_iopl/ptregs
173	common	ioperm			__x64_sys_ioperm
174	64	create_module
175	common	init_module		__x64_sys_init_module
176	common	delete_module		__x64_sys_delete_module
177	64	get_kernel_syms
178	64	query_module
179	common	quotactl		__x64_sys_quotactl
180	64	nfsservctl
181	common	getpmsg
182	common	putpmsg
183	common	afs_syscall
184	common	tuxcall
185	common	security
186	common	gettid			__x64_sys_gettid
187	common	readahead		__x64_sys_readahead
188	common	setxattr		__x64_sys_setxattr
189	common	lsetxattr		__x64_sys_lsetxattr
190	common	fsetxattr		__x64_sys_fsetxattr
191	common	getxattr		__x64_sys_getxattr
192	common	lgetxattr		__x64_sys_lgetxattr
193	common	fgetxattr		__x64_sys_fgetxattr
194	common	listxattr		__x64_sys_listxattr
195	common	llistxattr		__x64_sys_llistxattr
196	common	flistxattr		__x64_sys_flistxattr
197	common	removexattr		__x64_sys_removexattr
198	common	lremovexattr		__x64_sys_lremovexattr
199	common	fremovexattr		__x64_sys_fremovexattr
200	common	tkill			__x64_sys_tkill
201	common	time			__x64_sys_time
202	common	futex			__x64_sys_futex
203	common	sched_setaffinity	__x64_sys_sched_setaffinity
204	common	sched_getaffinity	__x64_sys_sched_getaffinity
205	64	set_thread_area
206	64	io_setup		__x64_sys_io_setup
207	common	io_destroy		__x64_sys_io_destroy
208	common	io_getevents		__x64_sys_io_getevents
209	64	io_submit		__x64_sys_io_submit
210	common	io_cancel		__x64_sys_io_cancel
211	64	get_thread_area
212	common	lookup_dcookie		__x64_sys_lookup_dcookie
213	common	epoll_create		__x64_sys_epoll_create
214	64	epoll_ctl_old
215	64	epoll_wait_old
216	common	remap_file_pages	__x64_sys_remap_file_pages
217	common	getdents64		__x64_sys_getdents64
218	common	set_tid_address		__x64_sys_set_tid_address
219	common	restart_syscall		__x64_sys_restart_syscall
220	common	semtimedop		__x64_sys_semtimedop
221	common	fadvise64		__x64_sys_fadvise64
222	64	timer_create		__x64_sys_timer_create
223	common	timer_settime		__x64_sys_timer_settime
224	common	timer_gettime		__x64_sys_timer_gettime
225	common	timer_getoverrun	__x64_sys_timer_getoverrun
226	common	timer_delete		__x64_sys_timer_delete
227	common	clock_settime		__x64_sys_clock_settime
228	common	clock_gettime		__x64_sys_clock_gettime
229	common	clock_getres		__x64_sys_clock_getres
230	common	clock_nanosleep		__x64_sys_clock_nanosleep
231	common	exit_group		__x64_sys_exit_group
232	common	epoll_wait		__x64_sys_epoll_wait
233	common	epoll_ctl		__x64_sys_epoll_ctl
234	common	tgkill			__x64_sys_tgkill
235	common	utimes			__x64_sys_utimes
236	64	vserver
237	common	mbind			__x64_sys_mbind
238	common	set_mempolicy		__x64_sys_set_mempolicy
239	common	get_mempolicy		__x64_sys_get_mempolicy
240	common	mq_open			__x64_sys_mq_open
241	common	mq_unlink		__x64_sys_mq_unlink
242	common	mq_timedsend		__x64_sys_mq_timedsend
243	common	mq_timedreceive		__x64_sys_mq_timedreceive
244	64	mq_notify		__x64_sys_mq_notify
245	common	mq_getsetattr		__x64_sys_mq_getsetattr
246	64	kexec_load		__x64_sys_kexec_load
247	64	waitid			__x64_sys_waitid
248	common	add_key			__x64_sys_add_key
249	common	request_key		__x64_sys_request_key
250	common	keyctl			__x64_sys_keyctl
251	common	ioprio_set		__x64_sys_ioprio_set
252	common	ioprio_get		__x64_sys_ioprio_get
253	common	inotify_init		__x64_sys_inotify_init
254	common	inotify_add_watch	__x64_sys_inotify_add_watch
255	common	inotify_rm_watch	__x64_sys_inotify_rm_watch
256	common	migrate_pages		__x64_sys_migrate_pages
257	common	openat			__x64_sys_openat
258	common	mkdirat			__x64_sys_mkdirat
259	common	mknodat			__x64_sys_mknodat
260	common	fchownat		__x64_sys_fchownat
261	common	futimesat		__x64_sys_futimesat
262	common	newfstatat		__x64_sys_newfstatat
263	common	unlinkat		__x64_sys_unlinkat
264	common	renameat		__x64_sys_renameat
265	common	linkat			__x64_sys_linkat
266	common	symlinkat		__x64_sys_symlinkat
267	common	readlinkat		__x64_sys_readlinkat
268	common	fchmodat		__x64_sys_fchmodat
269	common	faccessat		__x64_sys_faccessat
270	common	pselect6		__x64_sys_pselect6
271	common	ppoll			__x64_sys_ppoll
272	common	unshare			__x64_sys_unshare
273	64	set_robust_list		__x64_sys_set_robust_list
274	64	get_robust_list		__x64_sys_get_robust_list
275	common	splice			__x64_sys_splice
276	common	tee			__x64_sys_tee
277	common	sync_file_range		__x64_sys_sync_file_range
278	64	vmsplice		__x64_sys_vmsplice
279	64	move_pages		__x64_sys_move_pages
280	common	utimensat		__x64_sys_utimensat
281	common	epoll_pwait		__x64_sys_epoll_pwait
282	common	signalfd		__x64_sys_signalfd
283	common	timerfd_create		__x64_sys_timerfd_create
284	common	eventfd			__x64_sys_eventfd
285	common	fallocate		__x64_sys_fallocate
286	common	timerfd_settime		__x64_sys_timerfd_settime
287	common	timerfd_gettime		__x64_sys_timerfd_gettime
288	common	accept4			__x64_sys_accept4
289	common	signalfd4		__x64_sys_signalfd4
290	common	eventfd2		__x64_sys_eventfd2
291	common	epoll_create1		__x64_sys_epoll_create1
292	common	dup3			__x64_sys_dup3
293	common	pipe2			__x64_sys_pipe2
294	common	inotify_init1		__x64_sys_inotify_init1
295	64	preadv			__x64_sys_preadv
296	64	pwritev			__x64_sys_pwritev
297	64	rt_tgsigqueueinfo	__x64_sys_rt_tgsigqueueinfo
298	common	perf_event_open		__x64_sys_perf_event_open
299	64	recvmmsg		__x64_sys_recvmmsg
300	common	fanotify_init		__x64_sys_fanotify_init
301	common	fanotify_mark		__x64_sys_fanotify_mark
302	common	prlimit64		__x64_sys_prlimit64
303	common	name_to_handle_at	__x64_sys_name_to_handle_at
304	common	open_by_handle_at	__x64_sys_open_by_handle_at
305	common	clock_adjtime		__x64_sys_clock_adjtime
306	common	syncfs			__x64_sys_syncfs
307	64	sendmmsg		__x64_sys_sendmmsg
308	common	setns			__x64_sys_setns
309	common	getcpu			__x64_sys_getcpu
310	64	process_vm_readv	__x64_sys_process_vm_readv
311	64	process_vm_writev	__x64_sys_process_vm_writev
312	common	kcmp			__x64_sys_kcmp
313	common	finit_module		__x64_sys_finit_module
314	common	sched_setattr		__x64_sys_sched_setattr
315	common	sched_getattr		__x64_sys_sched_getattr
316	common	renameat2		__x64_sys_renameat2
317	common	seccomp			__x64_sys_seccomp
318	common	getrandom		__x64_sys_getrandom
319	common	memfd_create		__x64_sys_memfd_create
320	common	kexec_file_load		__x64_sys_kexec_file_load
321	common	bpf			__x64_sys_bpf
322	64	execveat		__x64_sys_execveat/ptregs
323	common	userfaultfd		__x64_sys_userfaultfd
324	common	membarrier		__x64_sys_membarrier
325	common	mlock2			__x64_sys_mlock2
326	common	copy_file_range		__x64_sys_copy_file_range
327	64	preadv2			__x64_sys_preadv2
328	64	pwritev2		__x64_sys_pwritev2
329	common	pkey_mprotect		__x64_sys_pkey_mprotect
330	common	pkey_alloc		__x64_sys_pkey_alloc
331	common	pkey_free		__x64_sys_pkey_free
332	common	statx			__x64_sys_statx
333	common	io_pgetevents		__x64_sys_io_pgetevents
334	common	rseq			__x64_sys_rseq
# don't use numbers 387 through 423, add new calls after the last
# 'common' entry
424	common	pidfd_send_signal	__x64_sys_pidfd_send_signal
425	common	io_uring_setup		__x64_sys_io_uring_setup
426	common	io_uring_enter		__x64_sys_io_uring_enter
427	common	io_uring_register	__x64_sys_io_uring_register
428	common	open_tree		__x64_sys_open_tree
429	common	move_mount		__x64_sys_move_mount
430	common	fsopen			__x64_sys_fsopen
431	common	fsconfig		__x64_sys_fsconfig
432	common	fsmount			__x64_sys_fsmount
433	common	fspick			__x64_sys_fspick
434	common	pidfd_open		__x64_sys_pidfd_open
435	common	clone3			__x64_sys_clone3/ptregs

#
# x32-specific system call numbers start at 512 to avoid cache impact
# for native 64-bit operation. The __x32_compat_sys stubs are created
# on-the-fly for compat_sys_*() compatibility system calls if X86_X32
# is defined.
#
512	x32	rt_sigaction		__x32_compat_sys_rt_sigaction
513	x32	rt_sigreturn		sys32_x32_rt_sigreturn
514	x32	ioctl			__x32_compat_sys_ioctl
515	x32	readv			__x32_compat_sys_readv
516	x32	writev			__x32_compat_sys_writev
517	x32	recvfrom		__x32_compat_sys_recvfrom
518	x32	sendmsg			__x32_compat_sys_sendmsg
519	x32	recvmsg			__x32_compat_sys_recvmsg
520	x32	execve			__x32_compat_sys_execve/ptregs
521	x32	ptrace			__x32_compat_sys_ptrace
522	x32	rt_sigpending		__x32_compat_sys_rt_sigpending
523	x32	rt_sigtimedwait		__x32_compat_sys_rt_sigtimedwait_time64
524	x32	rt_sigqueueinfo		__x32_compat_sys_rt_sigqueueinfo
525	x32	sigaltstack		__x32_compat_sys_sigaltstack
526	x32	timer_create		__x32_compat_sys_timer_create
527	x32	mq_notify		__x32_compat_sys_mq_notify
528	x32	kexec_load		__x32_compat_sys_kexec_load
529	x32	waitid			__x32_compat_sys_waitid
530	x32	set_robust_list		__x32_compat_sys_set_robust_list
531	x32	get_robust_list		__x32_compat_sys_get_robust_list
532	x32	vmsplice		__x32_compat_sys_vmsplice
533	x32	move_pages		__x32_compat_sys_move_pages
534	x32	preadv			__x32_compat_sys_preadv64
535	x32	pwritev			__x32_compat_sys_pwritev64
536	x32	rt_tgsigqueueinfo	__x32_compat_sys_rt_tgsigqueueinfo
537	x32	recvmmsg		__x32_compat_sys_recvmmsg_time64
538	x32	sendmmsg		__x32_compat_sys_sendmmsg
539	x32	process_vm_readv	__x32_compat_sys_process_vm_readv
540	x32	process_vm_writev	__x32_compat_sys_process_vm_writev
541	x32	setsockopt		__x32_compat_sys_setsockopt
542	x32	getsockopt		__x32_compat_sys_getsockopt
543	x32	io_setup		__x32_compat_sys_io_setup
544	x32	io_submit		__x32_compat_sys_io_submit
545	x32	execveat		__x32_compat_sys_execveat/ptregs
546	x32	preadv2			__x32_compat_sys_preadv64v2
547	x32	pwritev2		__x32_compat_sys_pwritev64v2

Modified build.sh from [b5a70ac75f] to [4c9dbc8e12].

146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
...
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi
	if test "$debug" = yes; then
		local dflag="-g dwarf2"
	fi
	report $asm $flags $dflag "-f$bin_fmt" -i "$gen" -i "$PWD" "$src" -o "$output";
}
comp_co()  { comp_c $1 $2 "-c -fPIC"; }
comp_c(){
	local src=$1
	local output=$2
	local flags=$3
	if test -e "$output"; then
................................................................................
	# only rebuild the file if the source file is newer
	if test "$debug" = yes; then
		local dflag="-g"
	else
		local dflag="-O4"
	fi
	if test "$assembly" = yes; then
		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"
	else
		report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/" -ffreestanding -nostdlib "-L$to" "-o$output"
	fi
}

say "commencing libk build $build at $(timestamp)"
# set -x

# get type data
mkdir -p $gen
report $cc -D_emit_m4_include arch/typesize.c -o $gen/typesize 
$gen/typesize > gen/typesize.m

# generate syscall tables
if test $posix = yes; then
	# on posix, we simply abuse CPP to garner a list of syscalls;
	# the file arch/posix/syscalls contains a list of syscalls
	# we wish to import; we use sed to transform this into a form
	# that cpp will fill out for us, producing a table that the
	# awk scripts can handle and turn into a list of constants.
	echo '#include <sys/syscall.h>' > $gen/system_calls.t.1 # this is the magic part
	cat arch/posix/syscalls > $gen/system_calls.t.2
	sed -e 's;^\(.*\)$;\1 SYS_\1;' -i $gen/system_calls.t.2
	cat $gen/system_calls.t.1 $gen/system_calls.t.2 | cpp -P >$gen/system_calls.tbl

	# generate errno tables the same way
	echo '#include <errno.h>' > $gen/error_codes.t.1 # this is the magic part
	cat arch/posix/errnos > $gen/error_codes.t.2
	sed -e 's;^\(.*\)$;k_platform_error_\1 \1;' -i $gen/error_codes.t.2
	cat $gen/error_codes.t.1 $gen/error_codes.t.2 | cpp -P | grep "^k_platform_error" >$gen/error_codes.tbl # haaaack
else
	case $os in
		*) noimpl 'system call table generation';;
	esac
fi

# take the OS-specific system call tables that have been prepared
# for us above and feed them into awk scripts to generate C headers
awk -f arch/syscall.awk -v out=s <$gen/system_calls.tbl>$gen/system_calls.s
awk -f arch/syscall.awk -v out=h <$gen/system_calls.tbl>$gen/system_calls.h

# do the same with our error codes table
awk -f arch/errtbl.awk <$gen/error_codes.tbl >$gen/error_table.h

# generate symbol tables for error handling functions
mkdir -p "$to/k"
awk -f global/gen-conds.awk <global/modules >$to/k/internal.egroup.h
awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
comp_co $gen/internal.ident.c $to/internal.ident.o

# first pass: copy all headers into place,







|







 







|

|











<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
...
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185































186
187
188
189
190
191
192
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi
	if test "$debug" = yes; then
		local dflag="-g dwarf2"
	fi
	report $asm $flags $dflag "-f$bin_fmt" -I "$gen" -I "$PWD" -I "arch/$target" "$src" -o "$output";
}
comp_co()  { comp_c $1 $2 "-c -fPIC"; }
comp_c(){
	local src=$1
	local output=$2
	local flags=$3
	if test -e "$output"; then
................................................................................
	# only rebuild the file if the source file is newer
	if test "$debug" = yes; then
		local dflag="-g"
	else
		local dflag="-O4"
	fi
	if test "$assembly" = yes; then
		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"
	else
		report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/$target" -isystem "$PWD" -ffreestanding -nostdlib "-L$to" "-o$output"
	fi
}

say "commencing libk build $build at $(timestamp)"
# set -x

# get type data
mkdir -p $gen
report $cc -D_emit_m4_include arch/typesize.c -o $gen/typesize 
$gen/typesize > gen/typesize.m
































# generate symbol tables for error handling functions
mkdir -p "$to/k"
awk -f global/gen-conds.awk <global/modules >$to/k/internal.egroup.h
awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
comp_co $gen/internal.ident.c $to/internal.ident.o

# first pass: copy all headers into place,

Modified global/build-manpage.sh from [d03c3443d7] to [132a7e50b4].

1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash
(test -d global && test -f build.sh) || {
	echo >&2 "($0) run $me from root of libk source directory"
	exit 1
}

source global/common.sh
reqpack cmark "generate documentation"
check gen "a directory for generated build dependencies"



|







1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash
(test -d global && test -f build.sh) || {
	echo >&2 "($0) run $0 from root of libk source directory"
	exit 1
}

source global/common.sh
reqpack cmark "generate documentation"
check gen "a directory for generated build dependencies"

Modified mod/kcore/boot.rt.x86.lin.64.s from [3c036595d7] to [a74c88489c].

1
2
3
4
5
6
7
8
9
10
..
57
58
59
60
61
62
63
64
65
66
67
; vim: ft=nasm
bits 64
%include "../arch/posix/x86.lin.64.s"
global _start:function
extern _boot
extern entry

_start:
	mov rbp, 0 ; zero the stack base ptr.
	; attempted fix for a difficult-to-
................................................................................
	; regardless of the size of the
	; return value of main(), _boot always
	; returns the system word length.

	mov sys.reg.1, sys.reg.ret ; fill in
	; the return value as exit's argument

	mov sys.reg.0, sys.exit ; set %rax to
	; the syscall number of exit

	sys.call ; invoke the kernel


|







 







|



1
2
3
4
5
6
7
8
9
10
..
57
58
59
60
61
62
63
64
65
66
67
; vim: ft=nasm
bits 64
%include "syscall.s"
global _start:function
extern _boot
extern entry

_start:
	mov rbp, 0 ; zero the stack base ptr.
	; attempted fix for a difficult-to-
................................................................................
	; regardless of the size of the
	; return value of main(), _boot always
	; returns the system word length.

	mov sys.reg.1, sys.reg.ret ; fill in
	; the return value as exit's argument

	mov sys.reg.0, 60 ; set %rax to
	; the syscall number of exit

	sys.call ; invoke the kernel

Modified mod/kcore/platform.syscall.fn.c from [9c61e189e0] to [4315e80d93].

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 * implementation may vary drastically.
 */

#include <k/def.h>
#include <k/type.h>

#ifdef KFenv_posix
#	include <posix/posix.h>
#else
	Knoimpl(k_platform_syscall)
#endif

extern void k_platform_syscall_raw (
		k_platform_syscall_return* return_slot,
		k_platform_syscall_error*  error_no_slot,







|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 * implementation may vary drastically.
 */

#include <k/def.h>
#include <k/type.h>

#ifdef KFenv_posix
#	include <posix.h>
#else
	Knoimpl(k_platform_syscall)
#endif

extern void k_platform_syscall_raw (
		k_platform_syscall_return* return_slot,
		k_platform_syscall_error*  error_no_slot,

Modified mod/kcore/stop.fn.c from [1f91f150ef] to [62a3920f4e].

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

#include <k/core.h>
#include <k/def.h> // so we know what system this is
#include <k/type.h>
#ifdef KFenv_posix
#	define KFplatform_define_types
#	define KFplatform_define_constants
#	include <posix/posix.h>
#endif

/* this manual redefinition is necessary to stop gcc
 * bitching that kstop returns, which it def does not */
noreturn extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);







|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

#include <k/core.h>
#include <k/def.h> // so we know what system this is
#include <k/type.h>
#ifdef KFenv_posix
#	define KFplatform_define_types
#	define KFplatform_define_constants
#	include <posix.h>
#endif

/* this manual redefinition is necessary to stop gcc
 * bitching that kstop returns, which it def does not */
noreturn extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

Modified mod/kcore/syscall.fn.x86.lin.64.s from [9bf0ba9bf3] to [856b7532d5].

7
8
9
10
11
12
13
14





15
16
17
18
19
20
21
22
; altogether and access the error value of a
; syscall directly. invoke as:
;
; 	void k_platform_syscall_raw(s64* result, u64* errno,
;		syscall, u8 valency, s64[] args)

bits 64
%include "arch/posix/x86.lin.64.s"





%include "arch/x86.cdecl.64.s"
; vim: ft=nasm

%macro handle_arg 1
	%assign v %1+1
	mov sys.reg. %+ v, [r15 + 8 * %1]
	dec ccall.reg.3
	jz .perform_call







<
>
>
>
>
>
|







7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22
23
24
25
26
; altogether and access the error value of a
; syscall directly. invoke as:
;
; 	void k_platform_syscall_raw(s64* result, u64* errno,
;		syscall, u8 valency, s64[] args)

bits 64


; which file is included is selected via the value
; of the target tuple - arch/$target is passed to
; the assembler as an include directory
%include 'syscall.s'
%include 'cdecl.s'
; vim: ft=nasm

%macro handle_arg 1
	%assign v %1+1
	mov sys.reg. %+ v, [r15 + 8 * %1]
	dec ccall.reg.3
	jz .perform_call

Modified mod/kio/send.fn.c from [1b46213bbd] to [9e8cd30a43].

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * kiosend() writes to a channel with an open out stream
 */

/* we define all platform functions here,
 * whether or not they're for the correct
 * platform - only the ones actually called
 * by the generated code will be linked */
#include <posix/posix.h>
#include <error_table.h>

kiocond kiosend(kiochan target, ksraw string, sz* len) {
	if (target.out.kind == kiostream_closed) return kiocond_fail_closed_stream;

#	ifdef KFenv_posix
		/* issue the write syscall here and now so we can







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * kiosend() writes to a channel with an open out stream
 */

/* we define all platform functions here,
 * whether or not they're for the correct
 * platform - only the ones actually called
 * by the generated code will be linked */
#include <posix.h>
#include <error_table.h>

kiocond kiosend(kiochan target, ksraw string, sz* len) {
	if (target.out.kind == kiostream_closed) return kiocond_fail_closed_stream;

#	ifdef KFenv_posix
		/* issue the write syscall here and now so we can

Modified mod/kmem/heapa.fn.c from [99ad7a3351] to [14fc9d1a27].

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * ~ lexi hale <lexi@hale.su>
 * kmheapa() allocates a pointer on the heap à la libc malloc()
 * see also: kmheapf() "heap free"
 */

/* arch specific headers */
#ifdef KFenv_posix
#	include <posix/posix.h>
#endif

#include <error_table.h>

/* we define all our platform functions here, whether or not
 * they're for the correct platform - only the ones that are
 * called by the preprocessed form of the code will actually







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * ~ lexi hale <lexi@hale.su>
 * kmheapa() allocates a pointer on the heap à la libc malloc()
 * see also: kmheapf() "heap free"
 */

/* arch specific headers */
#ifdef KFenv_posix
#	include <posix.h>
#endif

#include <error_table.h>

/* we define all our platform functions here, whether or not
 * they're for the correct platform - only the ones that are
 * called by the preprocessed form of the code will actually

Modified mod/kmem/heapf.fn.c from [868113c60d] to [a8a4c98c3a].

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * ~ lexi hale <lexi@hale.su>
 * kmheapf() frees a region on the heap à la libc free()
 * see also: kmheapa() "heap alloc"
 */

/* arch specific headers */
#ifdef KFenv_posix
#	include <posix/posix.h>
#endif

/* we define all our platform functions here, whether or not
 * they're for the correct platform - only the ones that are
 * called by the preprocessed form of the code will actually
 * be linked, linker errors are our friend here! */
extern int kmem_platform_munmap(void* addr, unsigned long sz);







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * ~ lexi hale <lexi@hale.su>
 * kmheapf() frees a region on the heap à la libc free()
 * see also: kmheapa() "heap alloc"
 */

/* arch specific headers */
#ifdef KFenv_posix
#	include <posix.h>
#endif

/* we define all our platform functions here, whether or not
 * they're for the correct platform - only the ones that are
 * called by the preprocessed form of the code will actually
 * be linked, linker errors are our friend here! */
extern int kmem_platform_munmap(void* addr, unsigned long sz);

Modified mod/kmem/lina.fn.c from [0011a847e1] to [5feb3edaf1].

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 * this memory simply by growing the heap the proper
 * length. */

#include <k/mem.h>
#include <k/def.h>

#ifdef KFenv_posix
#	include <posix/posix.h>
#endif

kmres kmlina(sz size) {
	k_platform_syscall_arg
		   top = (sz)kmlini(),
		newbrk = top + size;








|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 * this memory simply by growing the heap the proper
 * length. */

#include <k/mem.h>
#include <k/def.h>

#ifdef KFenv_posix
#	include <posix.h>
#endif

kmres kmlina(sz size) {
	k_platform_syscall_arg
		   top = (sz)kmlini(),
		newbrk = top + size;

Modified mod/kmem/lini.fn.c from [99be01eb40] to [537b55b516].

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * value `0`. (note that the brk syscall and the libc
 * wrapper have different behavior.) */

#include <k/mem.h>
#include <k/def.h>

#ifdef KFenv_posix
#	include <posix/posix.h>
#endif

/* returns void* instead of kmres because kmlini has
 * no failure state */
void* kmlini(void) {
	k_platform_syscall_arg zero = 0;
	/* brk adjusts the heap break then returns the new







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * value `0`. (note that the brk syscall and the libc
 * wrapper have different behavior.) */

#include <k/mem.h>
#include <k/def.h>

#ifdef KFenv_posix
#	include <posix.h>
#endif

/* returns void* instead of kmres because kmlini has
 * no failure state */
void* kmlini(void) {
	k_platform_syscall_arg zero = 0;
	/* brk adjusts the heap break then returns the new