authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-20 15:10:25-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-20 15:10:25-04:00
logea776c287b21286af393a7678240478caa8fa4f5
tree6a2bbf78ee5c3222cf6b4ddcb80da9effca6285b
parent74d0b5bf7c5bdb5013cec7d6eb6b474fe1ad703a
parentaab1ec5c43ffe4a916e4f8e8d0037ac7572cab3c
signaturelock-open Commit is signed but in an unrecognized format.

Merge branch 'daurnimator-linux-5.3'

closes #3266

5 files changed, 67 insertions(+), 57 deletions(-)

std/os/bits/linux.zig+36-10
...@@ -97,14 +97,29 @@ pub const MAP_FIXED = 0x10;...@@ -97,14 +97,29 @@ pub const MAP_FIXED = 0x10;
97/// don't use a file97/// don't use a file
98pub const MAP_ANONYMOUS = 0x20;98pub const MAP_ANONYMOUS = 0x20;
9999
100/// For anonymous mmap, memory could be uninitialized100// MAP_ 0x0100 - 0x4000 flags are per architecture
101pub const MAP_UNINITIALIZED = 0x4000000;101
102/// populate (prefault) pagetables
103pub const MAP_POPULATE = 0x8000;
104
105/// do not block on IO
106pub const MAP_NONBLOCK = 0x10000;
107
108/// give out an address that is best suited for process/thread stacks
109pub const MAP_STACK = 0x20000;
110
111/// create a huge page mapping
112pub const MAP_HUGETLB = 0x40000;
102113
103// MAP_ 0x0100 - 0x80000 flags are per architecture114/// perform synchronous page faults for the mapping
115pub const MAP_SYNC = 0x80000;
104116
105/// MAP_FIXED which doesn't unmap underlying mapping117/// MAP_FIXED which doesn't unmap underlying mapping
106pub const MAP_FIXED_NOREPLACE = 0x100000;118pub const MAP_FIXED_NOREPLACE = 0x100000;
107119
120/// For anonymous mmap, memory could be uninitialized
121pub const MAP_UNINITIALIZED = 0x4000000;
122
108pub const F_OK = 0;123pub const F_OK = 0;
109pub const X_OK = 1;124pub const X_OK = 1;
110pub const W_OK = 2;125pub const W_OK = 2;
...@@ -377,16 +392,12 @@ pub const SO_DETACH_FILTER = 27;...@@ -377,16 +392,12 @@ pub const SO_DETACH_FILTER = 27;
377pub const SO_GET_FILTER = SO_ATTACH_FILTER;392pub const SO_GET_FILTER = SO_ATTACH_FILTER;
378393
379pub const SO_PEERNAME = 28;394pub const SO_PEERNAME = 28;
380pub const SO_TIMESTAMP = 29;395pub const SO_TIMESTAMP_OLD = 29;
381pub const SCM_TIMESTAMP = SO_TIMESTAMP;
382
383pub const SO_PEERSEC = 31;396pub const SO_PEERSEC = 31;
384pub const SO_PASSSEC = 34;397pub const SO_PASSSEC = 34;
385pub const SO_TIMESTAMPNS = 35;398pub const SO_TIMESTAMPNS_OLD = 35;
386pub const SCM_TIMESTAMPNS = SO_TIMESTAMPNS;
387pub const SO_MARK = 36;399pub const SO_MARK = 36;
388pub const SO_TIMESTAMPING = 37;400pub const SO_TIMESTAMPING_OLD = 37;
389pub const SCM_TIMESTAMPING = SO_TIMESTAMPING;
390pub const SO_RXQ_OVFL = 40;401pub const SO_RXQ_OVFL = 40;
391pub const SO_WIFI_STATUS = 41;402pub const SO_WIFI_STATUS = 41;
392pub const SCM_WIFI_STATUS = SO_WIFI_STATUS;403pub const SCM_WIFI_STATUS = SO_WIFI_STATUS;
...@@ -410,6 +421,15 @@ pub const SO_COOKIE = 57;...@@ -410,6 +421,15 @@ pub const SO_COOKIE = 57;
410pub const SCM_TIMESTAMPING_PKTINFO = 58;421pub const SCM_TIMESTAMPING_PKTINFO = 58;
411pub const SO_PEERGROUPS = 59;422pub const SO_PEERGROUPS = 59;
412pub const SO_ZEROCOPY = 60;423pub const SO_ZEROCOPY = 60;
424pub const SO_TXTIME = 61;
425pub const SCM_TXTIME = SO_TXTIME;
426pub const SO_BINDTOIFINDEX = 62;
427pub const SO_TIMESTAMP_NEW = 63;
428pub const SO_TIMESTAMPNS_NEW = 64;
429pub const SO_TIMESTAMPING_NEW = 65;
430pub const SO_RCVTIMEO_NEW = 66;
431pub const SO_SNDTIMEO_NEW = 67;
432pub const SO_DETACH_REUSEPORT_BPF = 68;
413433
414pub const SOL_SOCKET = 1;434pub const SOL_SOCKET = 1;
415435
...@@ -1092,6 +1112,7 @@ pub const io_uring_sqe = extern struct {...@@ -1092,6 +1112,7 @@ pub const io_uring_sqe = extern struct {
1092 fsync_flags: u32,1112 fsync_flags: u32,
1093 poll_events: u16,1113 poll_events: u16,
1094 sync_range_flags: u32,1114 sync_range_flags: u32,
1115 msg_flags: u32,
1095 };1116 };
1096 union1: union1,1117 union1: union1,
1097 user_data: u64,1118 user_data: u64,
...@@ -1110,6 +1131,9 @@ pub const IOSQE_FIXED_FILE = (1 << 0);...@@ -1110,6 +1131,9 @@ pub const IOSQE_FIXED_FILE = (1 << 0);
1110/// issue after inflight IO1131/// issue after inflight IO
1111pub const IOSQE_IO_DRAIN = (1 << 1);1132pub const IOSQE_IO_DRAIN = (1 << 1);
11121133
1134/// links next sqe
1135pub const IOSQE_IO_LINK = (1 << 2);
1136
1113pub const IORING_OP_NOP = 0;1137pub const IORING_OP_NOP = 0;
1114pub const IORING_OP_READV = 1;1138pub const IORING_OP_READV = 1;
1115pub const IORING_OP_WRITEV = 2;1139pub const IORING_OP_WRITEV = 2;
...@@ -1119,6 +1143,8 @@ pub const IORING_OP_WRITE_FIXED = 5;...@@ -1119,6 +1143,8 @@ pub const IORING_OP_WRITE_FIXED = 5;
1119pub const IORING_OP_POLL_ADD = 6;1143pub const IORING_OP_POLL_ADD = 6;
1120pub const IORING_OP_POLL_REMOVE = 7;1144pub const IORING_OP_POLL_REMOVE = 7;
1121pub const IORING_OP_SYNC_FILE_RANGE = 8;1145pub const IORING_OP_SYNC_FILE_RANGE = 8;
1146pub const IORING_OP_SENDMSG = 9;
1147pub const IORING_OP_RECVMSG = 10;
11221148
1123// io_uring_sqe.fsync_flags1149// io_uring_sqe.fsync_flags
1124pub const IORING_FSYNC_DATASYNC = (1 << 0);1150pub const IORING_FSYNC_DATASYNC = (1 << 0);
std/os/bits/linux/arm-eabi.zig+8-15
...@@ -389,6 +389,14 @@ pub const SYS_pidfd_send_signal = 424;...@@ -389,6 +389,14 @@ pub const SYS_pidfd_send_signal = 424;
389pub const SYS_io_uring_setup = 425;389pub const SYS_io_uring_setup = 425;
390pub const SYS_io_uring_enter = 426;390pub const SYS_io_uring_enter = 426;
391pub const SYS_io_uring_register = 427;391pub const SYS_io_uring_register = 427;
392pub const SYS_open_tree = 428;
393pub const SYS_move_mount = 429;
394pub const SYS_fsopen = 430;
395pub const SYS_fsconfig = 431;
396pub const SYS_fsmount = 432;
397pub const SYS_fspick = 433;
398pub const SYS_pidfd_open = 434;
399pub const SYS_clone3 = 435;
392400
393pub const SYS_breakpoint = 0x0f0001;401pub const SYS_breakpoint = 0x0f0001;
394pub const SYS_cacheflush = 0x0f0002;402pub const SYS_cacheflush = 0x0f0002;
...@@ -455,21 +463,6 @@ pub const MAP_LOCKED = 0x2000;...@@ -455,21 +463,6 @@ pub const MAP_LOCKED = 0x2000;
455/// don't check for reservations463/// don't check for reservations
456pub const MAP_NORESERVE = 0x4000;464pub const MAP_NORESERVE = 0x4000;
457465
458/// populate (prefault) pagetables
459pub const MAP_POPULATE = 0x8000;
460
461/// do not block on IO
462pub const MAP_NONBLOCK = 0x10000;
463
464/// give out an address that is best suited for process/thread stacks
465pub const MAP_STACK = 0x20000;
466
467/// create a huge page mapping
468pub const MAP_HUGETLB = 0x40000;
469
470/// perform synchronous page faults for the mapping
471pub const MAP_SYNC = 0x80000;
472
473pub const VDSO_USEFUL = true;466pub const VDSO_USEFUL = true;
474pub const VDSO_CGT_SYM = "__vdso_clock_gettime";467pub const VDSO_CGT_SYM = "__vdso_clock_gettime";
475pub const VDSO_CGT_VER = "LINUX_2.6";468pub const VDSO_CGT_VER = "LINUX_2.6";
std/os/bits/linux/arm64.zig+2-15
...@@ -295,6 +295,8 @@ pub const SYS_fsopen = 430;...@@ -295,6 +295,8 @@ pub const SYS_fsopen = 430;
295pub const SYS_fsconfig = 431;295pub const SYS_fsconfig = 431;
296pub const SYS_fsmount = 432;296pub const SYS_fsmount = 432;
297pub const SYS_fspick = 433;297pub const SYS_fspick = 433;
298pub const SYS_pidfd_open = 434;
299pub const SYS_clone3 = 435;
298300
299pub const O_CREAT = 0o100;301pub const O_CREAT = 0o100;
300pub const O_EXCL = 0o200;302pub const O_EXCL = 0o200;
...@@ -352,21 +354,6 @@ pub const MAP_LOCKED = 0x2000;...@@ -352,21 +354,6 @@ pub const MAP_LOCKED = 0x2000;
352/// don't check for reservations354/// don't check for reservations
353pub const MAP_NORESERVE = 0x4000;355pub const MAP_NORESERVE = 0x4000;
354356
355/// populate (prefault) pagetables
356pub const MAP_POPULATE = 0x8000;
357
358/// do not block on IO
359pub const MAP_NONBLOCK = 0x10000;
360
361/// give out an address that is best suited for process/thread stacks
362pub const MAP_STACK = 0x20000;
363
364/// create a huge page mapping
365pub const MAP_HUGETLB = 0x40000;
366
367/// perform synchronous page faults for the mapping
368pub const MAP_SYNC = 0x80000;
369
370pub const VDSO_USEFUL = true;357pub const VDSO_USEFUL = true;
371pub const VDSO_CGT_SYM = "__kernel_clock_gettime";358pub const VDSO_CGT_SYM = "__kernel_clock_gettime";
372pub const VDSO_CGT_VER = "LINUX_2.6.39";359pub const VDSO_CGT_VER = "LINUX_2.6.39";
std/os/bits/linux/riscv64.zig+19-2
...@@ -243,7 +243,10 @@ pub const SYS_rt_tgsigqueueinfo = 240;...@@ -243,7 +243,10 @@ pub const SYS_rt_tgsigqueueinfo = 240;
243pub const SYS_perf_event_open = 241;243pub const SYS_perf_event_open = 241;
244pub const SYS_accept4 = 242;244pub const SYS_accept4 = 242;
245pub const SYS_recvmmsg = 243;245pub const SYS_recvmmsg = 243;
246
246pub const SYS_arch_specific_syscall = 244;247pub const SYS_arch_specific_syscall = 244;
248pub const SYS_riscv_flush_icache = SYS_arch_specific_syscall + 15;
249
247pub const SYS_wait4 = 260;250pub const SYS_wait4 = 260;
248pub const SYS_prlimit64 = 261;251pub const SYS_prlimit64 = 261;
249pub const SYS_fanotify_init = 262;252pub const SYS_fanotify_init = 262;
...@@ -275,5 +278,19 @@ pub const SYS_pwritev2 = 287;...@@ -275,5 +278,19 @@ pub const SYS_pwritev2 = 287;
275pub const SYS_pkey_mprotect = 288;278pub const SYS_pkey_mprotect = 288;
276pub const SYS_pkey_alloc = 289;279pub const SYS_pkey_alloc = 289;
277pub const SYS_pkey_free = 290;280pub const SYS_pkey_free = 290;
278pub const SYS_sysriscv = 244;281pub const SYS_statx = 291;
279pub const SYS_riscv_flush_icache = SYS_sysriscv + 15;282pub const SYS_io_pgetevents = 292;
283pub const SYS_rseq = 293;
284pub const SYS_kexec_file_load = 294;
285pub const SYS_pidfd_send_signal = 424;
286pub const SYS_io_uring_setup = 425;
287pub const SYS_io_uring_enter = 426;
288pub const SYS_io_uring_register = 427;
289pub const SYS_open_tree = 428;
290pub const SYS_move_mount = 429;
291pub const SYS_fsopen = 430;
292pub const SYS_fsconfig = 431;
293pub const SYS_fsmount = 432;
294pub const SYS_fspick = 433;
295pub const SYS_pidfd_open = 434;
296pub const SYS_clone3 = 435;
std/os/bits/linux/x86_64.zig+2-15
...@@ -358,6 +358,8 @@ pub const SYS_fsopen = 430;...@@ -358,6 +358,8 @@ pub const SYS_fsopen = 430;
358pub const SYS_fsconfig = 431;358pub const SYS_fsconfig = 431;
359pub const SYS_fsmount = 432;359pub const SYS_fsmount = 432;
360pub const SYS_fspick = 433;360pub const SYS_fspick = 433;
361pub const SYS_pidfd_open = 434;
362pub const SYS_clone3 = 435;
361363
362pub const O_CREAT = 0o100;364pub const O_CREAT = 0o100;
363pub const O_EXCL = 0o200;365pub const O_EXCL = 0o200;
...@@ -418,21 +420,6 @@ pub const MAP_LOCKED = 0x2000;...@@ -418,21 +420,6 @@ pub const MAP_LOCKED = 0x2000;
418/// don't check for reservations420/// don't check for reservations
419pub const MAP_NORESERVE = 0x4000;421pub const MAP_NORESERVE = 0x4000;
420422
421/// populate (prefault) pagetables
422pub const MAP_POPULATE = 0x8000;
423
424/// do not block on IO
425pub const MAP_NONBLOCK = 0x10000;
426
427/// give out an address that is best suited for process/thread stacks
428pub const MAP_STACK = 0x20000;
429
430/// create a huge page mapping
431pub const MAP_HUGETLB = 0x40000;
432
433/// perform synchronous page faults for the mapping
434pub const MAP_SYNC = 0x80000;
435
436pub const VDSO_USEFUL = true;423pub const VDSO_USEFUL = true;
437pub const VDSO_CGT_SYM = "__vdso_clock_gettime";424pub const VDSO_CGT_SYM = "__vdso_clock_gettime";
438pub const VDSO_CGT_VER = "LINUX_2.6";425pub const VDSO_CGT_VER = "LINUX_2.6";