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;
9797/// don't use a file
9898pub const MAP_ANONYMOUS = 0x20;
9999
100/// For anonymous mmap, memory could be uninitialized
101pub const MAP_UNINITIALIZED = 0x4000000;
100// MAP_ 0x0100 - 0x4000 flags are per architecture
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 architecture
114/// perform synchronous page faults for the mapping
115pub const MAP_SYNC = 0x80000;
104116
105117/// MAP_FIXED which doesn't unmap underlying mapping
106118pub const MAP_FIXED_NOREPLACE = 0x100000;
107119
120/// For anonymous mmap, memory could be uninitialized
121pub const MAP_UNINITIALIZED = 0x4000000;
122
108123pub const F_OK = 0;
109124pub const X_OK = 1;
110125pub const W_OK = 2;
......@@ -377,16 +392,12 @@ pub const SO_DETACH_FILTER = 27;
377392pub const SO_GET_FILTER = SO_ATTACH_FILTER;
378393
379394pub const SO_PEERNAME = 28;
380pub const SO_TIMESTAMP = 29;
381pub const SCM_TIMESTAMP = SO_TIMESTAMP;
382
395pub const SO_TIMESTAMP_OLD = 29;
383396pub const SO_PEERSEC = 31;
384397pub const SO_PASSSEC = 34;
385pub const SO_TIMESTAMPNS = 35;
386pub const SCM_TIMESTAMPNS = SO_TIMESTAMPNS;
398pub const SO_TIMESTAMPNS_OLD = 35;
387399pub const SO_MARK = 36;
388pub const SO_TIMESTAMPING = 37;
389pub const SCM_TIMESTAMPING = SO_TIMESTAMPING;
400pub const SO_TIMESTAMPING_OLD = 37;
390401pub const SO_RXQ_OVFL = 40;
391402pub const SO_WIFI_STATUS = 41;
392403pub const SCM_WIFI_STATUS = SO_WIFI_STATUS;
......@@ -410,6 +421,15 @@ pub const SO_COOKIE = 57;
410421pub const SCM_TIMESTAMPING_PKTINFO = 58;
411422pub const SO_PEERGROUPS = 59;
412423pub 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
414434pub const SOL_SOCKET = 1;
415435
......@@ -1092,6 +1112,7 @@ pub const io_uring_sqe = extern struct {
10921112 fsync_flags: u32,
10931113 poll_events: u16,
10941114 sync_range_flags: u32,
1115 msg_flags: u32,
10951116 };
10961117 union1: union1,
10971118 user_data: u64,
......@@ -1110,6 +1131,9 @@ pub const IOSQE_FIXED_FILE = (1 << 0);
11101131/// issue after inflight IO
11111132pub const IOSQE_IO_DRAIN = (1 << 1);
11121133
1134/// links next sqe
1135pub const IOSQE_IO_LINK = (1 << 2);
1136
11131137pub const IORING_OP_NOP = 0;
11141138pub const IORING_OP_READV = 1;
11151139pub const IORING_OP_WRITEV = 2;
......@@ -1119,6 +1143,8 @@ pub const IORING_OP_WRITE_FIXED = 5;
11191143pub const IORING_OP_POLL_ADD = 6;
11201144pub const IORING_OP_POLL_REMOVE = 7;
11211145pub const IORING_OP_SYNC_FILE_RANGE = 8;
1146pub const IORING_OP_SENDMSG = 9;
1147pub const IORING_OP_RECVMSG = 10;
11221148
11231149// io_uring_sqe.fsync_flags
11241150pub 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;
389389pub const SYS_io_uring_setup = 425;
390390pub const SYS_io_uring_enter = 426;
391391pub 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
393401pub const SYS_breakpoint = 0x0f0001;
394402pub const SYS_cacheflush = 0x0f0002;
......@@ -455,21 +463,6 @@ pub const MAP_LOCKED = 0x2000;
455463/// don't check for reservations
456464pub 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
473466pub const VDSO_USEFUL = true;
474467pub const VDSO_CGT_SYM = "__vdso_clock_gettime";
475468pub const VDSO_CGT_VER = "LINUX_2.6";
std/os/bits/linux/arm64.zig+2-15
......@@ -295,6 +295,8 @@ pub const SYS_fsopen = 430;
295295pub const SYS_fsconfig = 431;
296296pub const SYS_fsmount = 432;
297297pub const SYS_fspick = 433;
298pub const SYS_pidfd_open = 434;
299pub const SYS_clone3 = 435;
298300
299301pub const O_CREAT = 0o100;
300302pub const O_EXCL = 0o200;
......@@ -352,21 +354,6 @@ pub const MAP_LOCKED = 0x2000;
352354/// don't check for reservations
353355pub 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
370357pub const VDSO_USEFUL = true;
371358pub const VDSO_CGT_SYM = "__kernel_clock_gettime";
372359pub 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;
243243pub const SYS_perf_event_open = 241;
244244pub const SYS_accept4 = 242;
245245pub const SYS_recvmmsg = 243;
246
246247pub const SYS_arch_specific_syscall = 244;
248pub const SYS_riscv_flush_icache = SYS_arch_specific_syscall + 15;
249
247250pub const SYS_wait4 = 260;
248251pub const SYS_prlimit64 = 261;
249252pub const SYS_fanotify_init = 262;
......@@ -275,5 +278,19 @@ pub const SYS_pwritev2 = 287;
275278pub const SYS_pkey_mprotect = 288;
276279pub const SYS_pkey_alloc = 289;
277280pub const SYS_pkey_free = 290;
278pub const SYS_sysriscv = 244;
279pub const SYS_riscv_flush_icache = SYS_sysriscv + 15;
281pub const SYS_statx = 291;
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;
358358pub const SYS_fsconfig = 431;
359359pub const SYS_fsmount = 432;
360360pub const SYS_fspick = 433;
361pub const SYS_pidfd_open = 434;
362pub const SYS_clone3 = 435;
361363
362364pub const O_CREAT = 0o100;
363365pub const O_EXCL = 0o200;
......@@ -418,21 +420,6 @@ pub const MAP_LOCKED = 0x2000;
418420/// don't check for reservations
419421pub 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
436423pub const VDSO_USEFUL = true;
437424pub const VDSO_CGT_SYM = "__vdso_clock_gettime";
438425pub const VDSO_CGT_VER = "LINUX_2.6";