| author | |
| committer | |
| log | ee84deda988afb36f24ecd35ebea40221c1b80d8 |
| tree | b4044553d6cf49cbf69dd20f617260161f2527ac |
| parent | c262061129f0c19a276779e4102da99eca58536a |
| parent | 3e8ac8e23fce5f8468f54209dc9cc97c878edb9e |
| signature |
Get `mips64(el)-linux` working and start testing it9 files changed, 424 insertions(+), 275 deletions(-)
lib/std/c.zig+128-4| ... | ... | @@ -2722,7 +2722,39 @@ pub const SYS = switch (native_os) { |
| 2722 | 2722 | }; |
| 2723 | 2723 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name. |
| 2724 | 2724 | pub const Sigaction = switch (native_os) { |
| 2725 | .linux => linux.Sigaction, | |
| 2725 | .linux => switch (native_arch) { | |
| 2726 | .mips, | |
| 2727 | .mipsel, | |
| 2728 | .mips64, | |
| 2729 | .mips64el, | |
| 2730 | => if (builtin.target.isMusl()) | |
| 2731 | linux.Sigaction | |
| 2732 | else if (builtin.target.ptrBitWidth() == 64) extern struct { | |
| 2733 | pub const handler_fn = *align(1) const fn (i32) callconv(.C) void; | |
| 2734 | pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void; | |
| 2735 | ||
| 2736 | flags: c_uint, | |
| 2737 | handler: extern union { | |
| 2738 | handler: ?handler_fn, | |
| 2739 | sigaction: ?sigaction_fn, | |
| 2740 | }, | |
| 2741 | mask: sigset_t, | |
| 2742 | restorer: ?*const fn () callconv(.C) void = null, | |
| 2743 | } else extern struct { | |
| 2744 | pub const handler_fn = *align(1) const fn (i32) callconv(.C) void; | |
| 2745 | pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void; | |
| 2746 | ||
| 2747 | flags: c_uint, | |
| 2748 | handler: extern union { | |
| 2749 | handler: ?handler_fn, | |
| 2750 | sigaction: ?sigaction_fn, | |
| 2751 | }, | |
| 2752 | mask: sigset_t, | |
| 2753 | restorer: ?*const fn () callconv(.C) void = null, | |
| 2754 | __resv: [1]c_int = .{0}, | |
| 2755 | }, | |
| 2756 | else => linux.Sigaction, | |
| 2757 | }, | |
| 2726 | 2758 | .emscripten => emscripten.Sigaction, |
| 2727 | 2759 | .netbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct { |
| 2728 | 2760 | pub const handler_fn = *align(1) const fn (i32) callconv(.C) void; |
| ... | ... | @@ -6326,16 +6358,46 @@ pub const Stat = switch (native_os) { |
| 6326 | 6358 | return self.ctim; |
| 6327 | 6359 | } |
| 6328 | 6360 | }, |
| 6329 | .mips, .mipsel => extern struct { | |
| 6361 | .mips, .mipsel => if (builtin.target.isMusl()) extern struct { | |
| 6330 | 6362 | dev: dev_t, |
| 6331 | __pad0: [2]u32, | |
| 6363 | __pad0: [2]i32, | |
| 6332 | 6364 | ino: ino_t, |
| 6333 | 6365 | mode: mode_t, |
| 6334 | 6366 | nlink: nlink_t, |
| 6335 | 6367 | uid: uid_t, |
| 6336 | 6368 | gid: gid_t, |
| 6337 | 6369 | rdev: dev_t, |
| 6338 | __pad1: [2]u32, | |
| 6370 | __pad1: [2]i32, | |
| 6371 | size: off_t, | |
| 6372 | atim: timespec, | |
| 6373 | mtim: timespec, | |
| 6374 | ctim: timespec, | |
| 6375 | blksize: blksize_t, | |
| 6376 | __pad3: i32, | |
| 6377 | blocks: blkcnt_t, | |
| 6378 | __pad4: [14]i32, | |
| 6379 | ||
| 6380 | pub fn atime(self: @This()) timespec { | |
| 6381 | return self.atim; | |
| 6382 | } | |
| 6383 | ||
| 6384 | pub fn mtime(self: @This()) timespec { | |
| 6385 | return self.mtim; | |
| 6386 | } | |
| 6387 | ||
| 6388 | pub fn ctime(self: @This()) timespec { | |
| 6389 | return self.ctim; | |
| 6390 | } | |
| 6391 | } else extern struct { | |
| 6392 | dev: dev_t, | |
| 6393 | __pad0: [3]u32, | |
| 6394 | ino: ino_t, | |
| 6395 | mode: mode_t, | |
| 6396 | nlink: nlink_t, | |
| 6397 | uid: uid_t, | |
| 6398 | gid: gid_t, | |
| 6399 | rdev: dev_t, | |
| 6400 | __pad1: [3]u32, | |
| 6339 | 6401 | size: off_t, |
| 6340 | 6402 | atim: timespec, |
| 6341 | 6403 | mtim: timespec, |
| ... | ... | @@ -6357,6 +6419,68 @@ pub const Stat = switch (native_os) { |
| 6357 | 6419 | return self.ctim; |
| 6358 | 6420 | } |
| 6359 | 6421 | }, |
| 6422 | .mips64, .mips64el => if (builtin.target.isMusl()) extern struct { | |
| 6423 | dev: dev_t, | |
| 6424 | __pad0: [3]i32, | |
| 6425 | ino: ino_t, | |
| 6426 | mode: mode_t, | |
| 6427 | nlink: nlink_t, | |
| 6428 | uid: uid_t, | |
| 6429 | gid: gid_t, | |
| 6430 | rdev: dev_t, | |
| 6431 | __pad1: [2]u32, | |
| 6432 | size: off_t, | |
| 6433 | __pad2: i32, | |
| 6434 | atim: timespec, | |
| 6435 | mtim: timespec, | |
| 6436 | ctim: timespec, | |
| 6437 | blksize: blksize_t, | |
| 6438 | __pad3: u32, | |
| 6439 | blocks: blkcnt_t, | |
| 6440 | __pad4: [14]i32, | |
| 6441 | ||
| 6442 | pub fn atime(self: @This()) timespec { | |
| 6443 | return self.atim; | |
| 6444 | } | |
| 6445 | ||
| 6446 | pub fn mtime(self: @This()) timespec { | |
| 6447 | return self.mtim; | |
| 6448 | } | |
| 6449 | ||
| 6450 | pub fn ctime(self: @This()) timespec { | |
| 6451 | return self.ctim; | |
| 6452 | } | |
| 6453 | } else extern struct { | |
| 6454 | dev: dev_t, | |
| 6455 | __pad0: [3]u32, | |
| 6456 | ino: ino_t, | |
| 6457 | mode: mode_t, | |
| 6458 | nlink: nlink_t, | |
| 6459 | uid: uid_t, | |
| 6460 | gid: gid_t, | |
| 6461 | rdev: dev_t, | |
| 6462 | __pad1: [3]u32, | |
| 6463 | size: off_t, | |
| 6464 | atim: timespec, | |
| 6465 | mtim: timespec, | |
| 6466 | ctim: timespec, | |
| 6467 | blksize: blksize_t, | |
| 6468 | __pad3: u32, | |
| 6469 | blocks: blkcnt_t, | |
| 6470 | __pad4: [14]i32, | |
| 6471 | ||
| 6472 | pub fn atime(self: @This()) timespec { | |
| 6473 | return self.atim; | |
| 6474 | } | |
| 6475 | ||
| 6476 | pub fn mtime(self: @This()) timespec { | |
| 6477 | return self.mtim; | |
| 6478 | } | |
| 6479 | ||
| 6480 | pub fn ctime(self: @This()) timespec { | |
| 6481 | return self.ctim; | |
| 6482 | } | |
| 6483 | }, | |
| 6360 | 6484 | |
| 6361 | 6485 | else => std.os.linux.Stat, // libc stat is the same as kernel stat. |
| 6362 | 6486 | }, |
lib/std/debug.zig+2| ... | ... | @@ -56,6 +56,8 @@ pub const sys_can_stack_trace = switch (builtin.cpu.arch) { |
| 56 | 56 | // TODO: Make this work. |
| 57 | 57 | .mips, |
| 58 | 58 | .mipsel, |
| 59 | .mips64, | |
| 60 | .mips64el, | |
| 59 | 61 | => false, |
| 60 | 62 | |
| 61 | 63 | // `@returnAddress()` in LLVM 10 gives |
lib/std/os/linux.zig+161-48| ... | ... | @@ -2272,7 +2272,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize { |
| 2272 | 2272 | length_halves[0], |
| 2273 | 2273 | length_halves[1], |
| 2274 | 2274 | ); |
| 2275 | } else if (comptime native_arch == .mips or native_arch == .mipsel) { | |
| 2275 | } else if (native_arch.isMIPS32()) { | |
| 2276 | 2276 | // MIPS O32 does not deal with the register alignment issue, so pass a dummy value. |
| 2277 | 2277 | |
| 2278 | 2278 | const offset_halves = splitValue64(offset); |
| ... | ... | @@ -2382,7 +2382,7 @@ pub fn map_shadow_stack(addr: u64, size: u64, flags: u32) usize { |
| 2382 | 2382 | } |
| 2383 | 2383 | |
| 2384 | 2384 | pub const E = switch (native_arch) { |
| 2385 | .mips, .mipsel => enum(u16) { | |
| 2385 | .mips, .mipsel, .mips64, .mips64el => enum(u16) { | |
| 2386 | 2386 | /// No error occurred. |
| 2387 | 2387 | SUCCESS = 0, |
| 2388 | 2388 | |
| ... | ... | @@ -7068,53 +7068,166 @@ pub const ifreq = extern struct { |
| 7068 | 7068 | }; |
| 7069 | 7069 | |
| 7070 | 7070 | // doc comments copied from musl |
| 7071 | pub const rlimit_resource = if (native_arch.isMIPS() or native_arch.isSPARC()) | |
| 7072 | arch_bits.rlimit_resource | |
| 7073 | else | |
| 7074 | enum(c_int) { | |
| 7075 | /// Per-process CPU limit, in seconds. | |
| 7076 | CPU, | |
| 7077 | /// Largest file that can be created, in bytes. | |
| 7078 | FSIZE, | |
| 7079 | /// Maximum size of data segment, in bytes. | |
| 7080 | DATA, | |
| 7081 | /// Maximum size of stack segment, in bytes. | |
| 7082 | STACK, | |
| 7083 | /// Largest core file that can be created, in bytes. | |
| 7084 | CORE, | |
| 7085 | /// Largest resident set size, in bytes. | |
| 7086 | /// This affects swapping; processes that are exceeding their | |
| 7087 | /// resident set size will be more likely to have physical memory | |
| 7088 | /// taken from them. | |
| 7089 | RSS, | |
| 7090 | /// Number of processes. | |
| 7091 | NPROC, | |
| 7092 | /// Number of open files. | |
| 7093 | NOFILE, | |
| 7094 | /// Locked-in-memory address space. | |
| 7095 | MEMLOCK, | |
| 7096 | /// Address space limit. | |
| 7097 | AS, | |
| 7098 | /// Maximum number of file locks. | |
| 7099 | LOCKS, | |
| 7100 | /// Maximum number of pending signals. | |
| 7101 | SIGPENDING, | |
| 7102 | /// Maximum bytes in POSIX message queues. | |
| 7103 | MSGQUEUE, | |
| 7104 | /// Maximum nice priority allowed to raise to. | |
| 7105 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 7106 | /// values of this resource limit. | |
| 7107 | NICE, | |
| 7108 | /// Maximum realtime priority allowed for non-privileged | |
| 7109 | /// processes. | |
| 7110 | RTPRIO, | |
| 7111 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 7112 | /// scheduling policy may consume without making a blocking system | |
| 7113 | /// call before being forcibly descheduled. | |
| 7114 | RTTIME, | |
| 7071 | pub const rlimit_resource = if (native_arch.isMIPS()) enum(c_int) { | |
| 7072 | /// Per-process CPU limit, in seconds. | |
| 7073 | CPU = 0, | |
| 7115 | 7074 | |
| 7116 | _, | |
| 7117 | }; | |
| 7075 | /// Largest file that can be created, in bytes. | |
| 7076 | FSIZE = 1, | |
| 7077 | ||
| 7078 | /// Maximum size of data segment, in bytes. | |
| 7079 | DATA = 2, | |
| 7080 | ||
| 7081 | /// Maximum size of stack segment, in bytes. | |
| 7082 | STACK = 3, | |
| 7083 | ||
| 7084 | /// Largest core file that can be created, in bytes. | |
| 7085 | CORE = 4, | |
| 7086 | ||
| 7087 | /// Number of open files. | |
| 7088 | NOFILE = 5, | |
| 7089 | ||
| 7090 | /// Address space limit. | |
| 7091 | AS = 6, | |
| 7092 | ||
| 7093 | /// Largest resident set size, in bytes. | |
| 7094 | /// This affects swapping; processes that are exceeding their | |
| 7095 | /// resident set size will be more likely to have physical memory | |
| 7096 | /// taken from them. | |
| 7097 | RSS = 7, | |
| 7098 | ||
| 7099 | /// Number of processes. | |
| 7100 | NPROC = 8, | |
| 7101 | ||
| 7102 | /// Locked-in-memory address space. | |
| 7103 | MEMLOCK = 9, | |
| 7104 | ||
| 7105 | /// Maximum number of file locks. | |
| 7106 | LOCKS = 10, | |
| 7107 | ||
| 7108 | /// Maximum number of pending signals. | |
| 7109 | SIGPENDING = 11, | |
| 7110 | ||
| 7111 | /// Maximum bytes in POSIX message queues. | |
| 7112 | MSGQUEUE = 12, | |
| 7113 | ||
| 7114 | /// Maximum nice priority allowed to raise to. | |
| 7115 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 7116 | /// values of this resource limit. | |
| 7117 | NICE = 13, | |
| 7118 | ||
| 7119 | /// Maximum realtime priority allowed for non-privileged | |
| 7120 | /// processes. | |
| 7121 | RTPRIO = 14, | |
| 7122 | ||
| 7123 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 7124 | /// scheduling policy may consume without making a blocking system | |
| 7125 | /// call before being forcibly descheduled. | |
| 7126 | RTTIME = 15, | |
| 7127 | ||
| 7128 | _, | |
| 7129 | } else if (native_arch.isSPARC()) enum(c_int) { | |
| 7130 | /// Per-process CPU limit, in seconds. | |
| 7131 | CPU = 0, | |
| 7132 | ||
| 7133 | /// Largest file that can be created, in bytes. | |
| 7134 | FSIZE = 1, | |
| 7135 | ||
| 7136 | /// Maximum size of data segment, in bytes. | |
| 7137 | DATA = 2, | |
| 7138 | ||
| 7139 | /// Maximum size of stack segment, in bytes. | |
| 7140 | STACK = 3, | |
| 7141 | ||
| 7142 | /// Largest core file that can be created, in bytes. | |
| 7143 | CORE = 4, | |
| 7144 | ||
| 7145 | /// Largest resident set size, in bytes. | |
| 7146 | /// This affects swapping; processes that are exceeding their | |
| 7147 | /// resident set size will be more likely to have physical memory | |
| 7148 | /// taken from them. | |
| 7149 | RSS = 5, | |
| 7150 | ||
| 7151 | /// Number of open files. | |
| 7152 | NOFILE = 6, | |
| 7153 | ||
| 7154 | /// Number of processes. | |
| 7155 | NPROC = 7, | |
| 7156 | ||
| 7157 | /// Locked-in-memory address space. | |
| 7158 | MEMLOCK = 8, | |
| 7159 | ||
| 7160 | /// Address space limit. | |
| 7161 | AS = 9, | |
| 7162 | ||
| 7163 | /// Maximum number of file locks. | |
| 7164 | LOCKS = 10, | |
| 7165 | ||
| 7166 | /// Maximum number of pending signals. | |
| 7167 | SIGPENDING = 11, | |
| 7168 | ||
| 7169 | /// Maximum bytes in POSIX message queues. | |
| 7170 | MSGQUEUE = 12, | |
| 7171 | ||
| 7172 | /// Maximum nice priority allowed to raise to. | |
| 7173 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 7174 | /// values of this resource limit. | |
| 7175 | NICE = 13, | |
| 7176 | ||
| 7177 | /// Maximum realtime priority allowed for non-privileged | |
| 7178 | /// processes. | |
| 7179 | RTPRIO = 14, | |
| 7180 | ||
| 7181 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 7182 | /// scheduling policy may consume without making a blocking system | |
| 7183 | /// call before being forcibly descheduled. | |
| 7184 | RTTIME = 15, | |
| 7185 | ||
| 7186 | _, | |
| 7187 | } else enum(c_int) { | |
| 7188 | /// Per-process CPU limit, in seconds. | |
| 7189 | CPU = 0, | |
| 7190 | /// Largest file that can be created, in bytes. | |
| 7191 | FSIZE = 1, | |
| 7192 | /// Maximum size of data segment, in bytes. | |
| 7193 | DATA = 2, | |
| 7194 | /// Maximum size of stack segment, in bytes. | |
| 7195 | STACK = 3, | |
| 7196 | /// Largest core file that can be created, in bytes. | |
| 7197 | CORE = 4, | |
| 7198 | /// Largest resident set size, in bytes. | |
| 7199 | /// This affects swapping; processes that are exceeding their | |
| 7200 | /// resident set size will be more likely to have physical memory | |
| 7201 | /// taken from them. | |
| 7202 | RSS = 5, | |
| 7203 | /// Number of processes. | |
| 7204 | NPROC = 6, | |
| 7205 | /// Number of open files. | |
| 7206 | NOFILE = 7, | |
| 7207 | /// Locked-in-memory address space. | |
| 7208 | MEMLOCK = 8, | |
| 7209 | /// Address space limit. | |
| 7210 | AS = 9, | |
| 7211 | /// Maximum number of file locks. | |
| 7212 | LOCKS = 10, | |
| 7213 | /// Maximum number of pending signals. | |
| 7214 | SIGPENDING = 11, | |
| 7215 | /// Maximum bytes in POSIX message queues. | |
| 7216 | MSGQUEUE = 12, | |
| 7217 | /// Maximum nice priority allowed to raise to. | |
| 7218 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 7219 | /// values of this resource limit. | |
| 7220 | NICE = 13, | |
| 7221 | /// Maximum realtime priority allowed for non-privileged | |
| 7222 | /// processes. | |
| 7223 | RTPRIO = 14, | |
| 7224 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 7225 | /// scheduling policy may consume without making a blocking system | |
| 7226 | /// call before being forcibly descheduled. | |
| 7227 | RTTIME = 15, | |
| 7228 | ||
| 7229 | _, | |
| 7230 | }; | |
| 7118 | 7231 | |
| 7119 | 7232 | pub const rlim_t = u64; |
| 7120 | 7233 |
lib/std/os/linux/mips.zig+41-82| ... | ... | @@ -14,7 +14,8 @@ const timespec = linux.timespec; |
| 14 | 14 | pub fn syscall0(number: SYS) usize { |
| 15 | 15 | return asm volatile ( |
| 16 | 16 | \\ syscall |
| 17 | \\ blez $7, 1f | |
| 17 | \\ beq $7, $zero, 1f | |
| 18 | \\ blez $2, 1f | |
| 18 | 19 | \\ subu $2, $0, $2 |
| 19 | 20 | \\ 1: |
| 20 | 21 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -28,7 +29,7 @@ pub fn syscall_pipe(fd: *[2]i32) usize { |
| 28 | 29 | \\ .set noat |
| 29 | 30 | \\ .set noreorder |
| 30 | 31 | \\ syscall |
| 31 | \\ blez $7, 1f | |
| 32 | \\ beq $7, $zero, 1f | |
| 32 | 33 | \\ nop |
| 33 | 34 | \\ b 2f |
| 34 | 35 | \\ subu $2, $0, $2 |
| ... | ... | @@ -46,7 +47,8 @@ pub fn syscall_pipe(fd: *[2]i32) usize { |
| 46 | 47 | pub fn syscall1(number: SYS, arg1: usize) usize { |
| 47 | 48 | return asm volatile ( |
| 48 | 49 | \\ syscall |
| 49 | \\ blez $7, 1f | |
| 50 | \\ beq $7, $zero, 1f | |
| 51 | \\ blez $2, 1f | |
| 50 | 52 | \\ subu $2, $0, $2 |
| 51 | 53 | \\ 1: |
| 52 | 54 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -59,7 +61,8 @@ pub fn syscall1(number: SYS, arg1: usize) usize { |
| 59 | 61 | pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { |
| 60 | 62 | return asm volatile ( |
| 61 | 63 | \\ syscall |
| 62 | \\ blez $7, 1f | |
| 64 | \\ beq $7, $zero, 1f | |
| 65 | \\ blez $2, 1f | |
| 63 | 66 | \\ subu $2, $0, $2 |
| 64 | 67 | \\ 1: |
| 65 | 68 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -73,7 +76,8 @@ pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { |
| 73 | 76 | pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { |
| 74 | 77 | return asm volatile ( |
| 75 | 78 | \\ syscall |
| 76 | \\ blez $7, 1f | |
| 79 | \\ beq $7, $zero, 1f | |
| 80 | \\ blez $2, 1f | |
| 77 | 81 | \\ subu $2, $0, $2 |
| 78 | 82 | \\ 1: |
| 79 | 83 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -88,7 +92,8 @@ pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { |
| 88 | 92 | pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { |
| 89 | 93 | return asm volatile ( |
| 90 | 94 | \\ syscall |
| 91 | \\ blez $7, 1f | |
| 95 | \\ beq $7, $zero, 1f | |
| 96 | \\ blez $2, 1f | |
| 92 | 97 | \\ subu $2, $0, $2 |
| 93 | 98 | \\ 1: |
| 94 | 99 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -108,7 +113,8 @@ pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, |
| 108 | 113 | \\ sw %[arg5], 16($sp) |
| 109 | 114 | \\ syscall |
| 110 | 115 | \\ addu $sp, $sp, 24 |
| 111 | \\ blez $7, 1f | |
| 116 | \\ beq $7, $zero, 1f | |
| 117 | \\ blez $2, 1f | |
| 112 | 118 | \\ subu $2, $0, $2 |
| 113 | 119 | \\ 1: |
| 114 | 120 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -141,7 +147,8 @@ pub fn syscall6( |
| 141 | 147 | \\ sw %[arg6], 20($sp) |
| 142 | 148 | \\ syscall |
| 143 | 149 | \\ addu $sp, $sp, 24 |
| 144 | \\ blez $7, 1f | |
| 150 | \\ beq $7, $zero, 1f | |
| 151 | \\ blez $2, 1f | |
| 145 | 152 | \\ subu $2, $0, $2 |
| 146 | 153 | \\ 1: |
| 147 | 154 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -174,7 +181,8 @@ pub fn syscall7( |
| 174 | 181 | \\ sw %[arg7], 24($sp) |
| 175 | 182 | \\ syscall |
| 176 | 183 | \\ addu $sp, $sp, 32 |
| 177 | \\ blez $7, 1f | |
| 184 | \\ beq $7, $zero, 1f | |
| 185 | \\ blez $2, 1f | |
| 178 | 186 | \\ subu $2, $0, $2 |
| 179 | 187 | \\ 1: |
| 180 | 188 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -314,7 +322,7 @@ pub const msghdr_const = extern struct { |
| 314 | 322 | flags: i32, |
| 315 | 323 | }; |
| 316 | 324 | |
| 317 | pub const blksize_t = i32; | |
| 325 | pub const blksize_t = u32; | |
| 318 | 326 | pub const nlink_t = u32; |
| 319 | 327 | pub const time_t = i32; |
| 320 | 328 | pub const mode_t = u32; |
| ... | ... | @@ -323,36 +331,47 @@ pub const ino_t = u64; |
| 323 | 331 | pub const dev_t = u64; |
| 324 | 332 | pub const blkcnt_t = i64; |
| 325 | 333 | |
| 326 | // The `stat` definition used by the Linux kernel. | |
| 334 | // The `stat64` definition used by the Linux kernel. | |
| 327 | 335 | pub const Stat = extern struct { |
| 328 | dev: u32, | |
| 329 | __pad0: [3]u32, // Reserved for st_dev expansion | |
| 336 | dev: dev_t, | |
| 337 | __pad0: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 330 | 338 | ino: ino_t, |
| 331 | 339 | mode: mode_t, |
| 332 | 340 | nlink: nlink_t, |
| 333 | 341 | uid: uid_t, |
| 334 | 342 | gid: gid_t, |
| 335 | rdev: u32, | |
| 336 | __pad1: [3]u32, | |
| 343 | rdev: dev_t, | |
| 344 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 337 | 345 | size: off_t, |
| 338 | atim: timespec, | |
| 339 | mtim: timespec, | |
| 340 | ctim: timespec, | |
| 346 | atim: i32, | |
| 347 | atim_nsec: u32, | |
| 348 | mtim: i32, | |
| 349 | mtim_nsec: u32, | |
| 350 | ctim: i32, | |
| 351 | ctim_nsec: u32, | |
| 341 | 352 | blksize: blksize_t, |
| 342 | 353 | __pad3: u32, |
| 343 | 354 | blocks: blkcnt_t, |
| 344 | __pad4: [14]usize, | |
| 345 | 355 | |
| 346 | 356 | pub fn atime(self: @This()) timespec { |
| 347 | return self.atim; | |
| 357 | return .{ | |
| 358 | .sec = self.atim, | |
| 359 | .nsec = self.atim_nsec, | |
| 360 | }; | |
| 348 | 361 | } |
| 349 | 362 | |
| 350 | 363 | pub fn mtime(self: @This()) timespec { |
| 351 | return self.mtim; | |
| 364 | return .{ | |
| 365 | .sec = self.mtim, | |
| 366 | .nsec = self.mtim_nsec, | |
| 367 | }; | |
| 352 | 368 | } |
| 353 | 369 | |
| 354 | 370 | pub fn ctime(self: @This()) timespec { |
| 355 | return self.ctim; | |
| 371 | return .{ | |
| 372 | .sec = self.ctim, | |
| 373 | .nsec = self.ctim_nsec, | |
| 374 | }; | |
| 356 | 375 | } |
| 357 | 376 | }; |
| 358 | 377 | |
| ... | ... | @@ -368,66 +387,6 @@ pub const timezone = extern struct { |
| 368 | 387 | |
| 369 | 388 | pub const Elf_Symndx = u32; |
| 370 | 389 | |
| 371 | pub const rlimit_resource = enum(c_int) { | |
| 372 | /// Per-process CPU limit, in seconds. | |
| 373 | CPU, | |
| 374 | ||
| 375 | /// Largest file that can be created, in bytes. | |
| 376 | FSIZE, | |
| 377 | ||
| 378 | /// Maximum size of data segment, in bytes. | |
| 379 | DATA, | |
| 380 | ||
| 381 | /// Maximum size of stack segment, in bytes. | |
| 382 | STACK, | |
| 383 | ||
| 384 | /// Largest core file that can be created, in bytes. | |
| 385 | CORE, | |
| 386 | ||
| 387 | /// Number of open files. | |
| 388 | NOFILE, | |
| 389 | ||
| 390 | /// Address space limit. | |
| 391 | AS, | |
| 392 | ||
| 393 | /// Largest resident set size, in bytes. | |
| 394 | /// This affects swapping; processes that are exceeding their | |
| 395 | /// resident set size will be more likely to have physical memory | |
| 396 | /// taken from them. | |
| 397 | RSS, | |
| 398 | ||
| 399 | /// Number of processes. | |
| 400 | NPROC, | |
| 401 | ||
| 402 | /// Locked-in-memory address space. | |
| 403 | MEMLOCK, | |
| 404 | ||
| 405 | /// Maximum number of file locks. | |
| 406 | LOCKS, | |
| 407 | ||
| 408 | /// Maximum number of pending signals. | |
| 409 | SIGPENDING, | |
| 410 | ||
| 411 | /// Maximum bytes in POSIX message queues. | |
| 412 | MSGQUEUE, | |
| 413 | ||
| 414 | /// Maximum nice priority allowed to raise to. | |
| 415 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 416 | /// values of this resource limit. | |
| 417 | NICE, | |
| 418 | ||
| 419 | /// Maximum realtime priority allowed for non-privileged | |
| 420 | /// processes. | |
| 421 | RTPRIO, | |
| 422 | ||
| 423 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 424 | /// scheduling policy may consume without making a blocking system | |
| 425 | /// call before being forcibly descheduled. | |
| 426 | RTTIME, | |
| 427 | ||
| 428 | _, | |
| 429 | }; | |
| 430 | ||
| 431 | 390 | /// TODO |
| 432 | 391 | pub const ucontext_t = void; |
| 433 | 392 |
lib/std/os/linux/mips64.zig+41-81| ... | ... | @@ -14,7 +14,8 @@ const timespec = linux.timespec; |
| 14 | 14 | pub fn syscall0(number: SYS) usize { |
| 15 | 15 | return asm volatile ( |
| 16 | 16 | \\ syscall |
| 17 | \\ blez $7, 1f | |
| 17 | \\ beq $7, $zero, 1f | |
| 18 | \\ blez $2, 1f | |
| 18 | 19 | \\ dsubu $2, $0, $2 |
| 19 | 20 | \\ 1: |
| 20 | 21 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -28,7 +29,7 @@ pub fn syscall_pipe(fd: *[2]i32) usize { |
| 28 | 29 | \\ .set noat |
| 29 | 30 | \\ .set noreorder |
| 30 | 31 | \\ syscall |
| 31 | \\ blez $7, 1f | |
| 32 | \\ beq $7, $zero, 1f | |
| 32 | 33 | \\ nop |
| 33 | 34 | \\ b 2f |
| 34 | 35 | \\ subu $2, $0, $2 |
| ... | ... | @@ -46,7 +47,9 @@ pub fn syscall_pipe(fd: *[2]i32) usize { |
| 46 | 47 | pub fn syscall1(number: SYS, arg1: usize) usize { |
| 47 | 48 | return asm volatile ( |
| 48 | 49 | \\ syscall |
| 49 | \\ blez $7, 1f | |
| 50 | \\ beq $7, $zero, 1f | |
| 51 | \\ blez $2, 1f | |
| 52 | \\ nop | |
| 50 | 53 | \\ dsubu $2, $0, $2 |
| 51 | 54 | \\ 1: |
| 52 | 55 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -59,7 +62,8 @@ pub fn syscall1(number: SYS, arg1: usize) usize { |
| 59 | 62 | pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { |
| 60 | 63 | return asm volatile ( |
| 61 | 64 | \\ syscall |
| 62 | \\ blez $7, 1f | |
| 65 | \\ beq $7, $zero, 1f | |
| 66 | \\ blez $2, 1f | |
| 63 | 67 | \\ dsubu $2, $0, $2 |
| 64 | 68 | \\ 1: |
| 65 | 69 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -73,7 +77,8 @@ pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { |
| 73 | 77 | pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { |
| 74 | 78 | return asm volatile ( |
| 75 | 79 | \\ syscall |
| 76 | \\ blez $7, 1f | |
| 80 | \\ beq $7, $zero, 1f | |
| 81 | \\ blez $2, 1f | |
| 77 | 82 | \\ dsubu $2, $0, $2 |
| 78 | 83 | \\ 1: |
| 79 | 84 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -88,7 +93,8 @@ pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { |
| 88 | 93 | pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { |
| 89 | 94 | return asm volatile ( |
| 90 | 95 | \\ syscall |
| 91 | \\ blez $7, 1f | |
| 96 | \\ beq $7, $zero, 1f | |
| 97 | \\ blez $2, 1f | |
| 92 | 98 | \\ dsubu $2, $0, $2 |
| 93 | 99 | \\ 1: |
| 94 | 100 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -104,7 +110,8 @@ pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) |
| 104 | 110 | pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { |
| 105 | 111 | return asm volatile ( |
| 106 | 112 | \\ syscall |
| 107 | \\ blez $7, 1f | |
| 113 | \\ beq $7, $zero, 1f | |
| 114 | \\ blez $2, 1f | |
| 108 | 115 | \\ dsubu $2, $0, $2 |
| 109 | 116 | \\ 1: |
| 110 | 117 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -129,7 +136,8 @@ pub fn syscall6( |
| 129 | 136 | ) usize { |
| 130 | 137 | return asm volatile ( |
| 131 | 138 | \\ syscall |
| 132 | \\ blez $7, 1f | |
| 139 | \\ beq $7, $zero, 1f | |
| 140 | \\ blez $2, 1f | |
| 133 | 141 | \\ dsubu $2, $0, $2 |
| 134 | 142 | \\ 1: |
| 135 | 143 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -156,7 +164,8 @@ pub fn syscall7( |
| 156 | 164 | ) usize { |
| 157 | 165 | return asm volatile ( |
| 158 | 166 | \\ syscall |
| 159 | \\ blez $7, 1f | |
| 167 | \\ beq $7, $zero, 1f | |
| 168 | \\ blez $2, 1f | |
| 160 | 169 | \\ dsubu $2, $0, $2 |
| 161 | 170 | \\ 1: |
| 162 | 171 | : [ret] "={$2}" (-> usize), |
| ... | ... | @@ -292,7 +301,7 @@ pub const msghdr_const = extern struct { |
| 292 | 301 | flags: i32, |
| 293 | 302 | }; |
| 294 | 303 | |
| 295 | pub const blksize_t = i32; | |
| 304 | pub const blksize_t = u32; | |
| 296 | 305 | pub const nlink_t = u32; |
| 297 | 306 | pub const time_t = i32; |
| 298 | 307 | pub const mode_t = u32; |
| ... | ... | @@ -303,34 +312,45 @@ pub const blkcnt_t = i64; |
| 303 | 312 | |
| 304 | 313 | // The `stat` definition used by the Linux kernel. |
| 305 | 314 | pub const Stat = extern struct { |
| 306 | dev: u32, | |
| 307 | __pad0: [3]u32, // Reserved for st_dev expansion | |
| 315 | dev: dev_t, | |
| 316 | __pad0: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 308 | 317 | ino: ino_t, |
| 309 | 318 | mode: mode_t, |
| 310 | 319 | nlink: nlink_t, |
| 311 | 320 | uid: uid_t, |
| 312 | 321 | gid: gid_t, |
| 313 | rdev: u32, | |
| 314 | __pad1: [3]u32, | |
| 322 | rdev: dev_t, | |
| 323 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 315 | 324 | size: off_t, |
| 316 | atim: timespec, | |
| 317 | mtim: timespec, | |
| 318 | ctim: timespec, | |
| 325 | atim: u32, | |
| 326 | atim_nsec: u32, | |
| 327 | mtim: u32, | |
| 328 | mtim_nsec: u32, | |
| 329 | ctim: u32, | |
| 330 | ctim_nsec: u32, | |
| 319 | 331 | blksize: blksize_t, |
| 320 | 332 | __pad3: u32, |
| 321 | 333 | blocks: blkcnt_t, |
| 322 | __pad4: [14]usize, | |
| 323 | 334 | |
| 324 | 335 | pub fn atime(self: @This()) timespec { |
| 325 | return self.atim; | |
| 336 | return .{ | |
| 337 | .sec = self.atim, | |
| 338 | .nsec = self.atim_nsec, | |
| 339 | }; | |
| 326 | 340 | } |
| 327 | 341 | |
| 328 | 342 | pub fn mtime(self: @This()) timespec { |
| 329 | return self.mtim; | |
| 343 | return .{ | |
| 344 | .sec = self.mtim, | |
| 345 | .nsec = self.mtim_nsec, | |
| 346 | }; | |
| 330 | 347 | } |
| 331 | 348 | |
| 332 | 349 | pub fn ctime(self: @This()) timespec { |
| 333 | return self.ctim; | |
| 350 | return .{ | |
| 351 | .sec = self.ctim, | |
| 352 | .nsec = self.ctim_nsec, | |
| 353 | }; | |
| 334 | 354 | } |
| 335 | 355 | }; |
| 336 | 356 | |
| ... | ... | @@ -346,66 +366,6 @@ pub const timezone = extern struct { |
| 346 | 366 | |
| 347 | 367 | pub const Elf_Symndx = u32; |
| 348 | 368 | |
| 349 | pub const rlimit_resource = enum(c_int) { | |
| 350 | /// Per-process CPU limit, in seconds. | |
| 351 | CPU, | |
| 352 | ||
| 353 | /// Largest file that can be created, in bytes. | |
| 354 | FSIZE, | |
| 355 | ||
| 356 | /// Maximum size of data segment, in bytes. | |
| 357 | DATA, | |
| 358 | ||
| 359 | /// Maximum size of stack segment, in bytes. | |
| 360 | STACK, | |
| 361 | ||
| 362 | /// Largest core file that can be created, in bytes. | |
| 363 | CORE, | |
| 364 | ||
| 365 | /// Number of open files. | |
| 366 | NOFILE, | |
| 367 | ||
| 368 | /// Address space limit. | |
| 369 | AS, | |
| 370 | ||
| 371 | /// Largest resident set size, in bytes. | |
| 372 | /// This affects swapping; processes that are exceeding their | |
| 373 | /// resident set size will be more likely to have physical memory | |
| 374 | /// taken from them. | |
| 375 | RSS, | |
| 376 | ||
| 377 | /// Number of processes. | |
| 378 | NPROC, | |
| 379 | ||
| 380 | /// Locked-in-memory address space. | |
| 381 | MEMLOCK, | |
| 382 | ||
| 383 | /// Maximum number of file locks. | |
| 384 | LOCKS, | |
| 385 | ||
| 386 | /// Maximum number of pending signals. | |
| 387 | SIGPENDING, | |
| 388 | ||
| 389 | /// Maximum bytes in POSIX message queues. | |
| 390 | MSGQUEUE, | |
| 391 | ||
| 392 | /// Maximum nice priority allowed to raise to. | |
| 393 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 394 | /// values of this resource limit. | |
| 395 | NICE, | |
| 396 | ||
| 397 | /// Maximum realtime priority allowed for non-privileged | |
| 398 | /// processes. | |
| 399 | RTPRIO, | |
| 400 | ||
| 401 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 402 | /// scheduling policy may consume without making a blocking system | |
| 403 | /// call before being forcibly descheduled. | |
| 404 | RTTIME, | |
| 405 | ||
| 406 | _, | |
| 407 | }; | |
| 408 | ||
| 409 | 369 | /// TODO |
| 410 | 370 | pub const ucontext_t = void; |
| 411 | 371 |
lib/std/os/linux/sparc64.zig-60| ... | ... | @@ -448,63 +448,3 @@ pub const ucontext_t = extern struct { |
| 448 | 448 | |
| 449 | 449 | /// TODO |
| 450 | 450 | pub const getcontext = {}; |
| 451 | ||
| 452 | pub const rlimit_resource = enum(c_int) { | |
| 453 | /// Per-process CPU limit, in seconds. | |
| 454 | CPU, | |
| 455 | ||
| 456 | /// Largest file that can be created, in bytes. | |
| 457 | FSIZE, | |
| 458 | ||
| 459 | /// Maximum size of data segment, in bytes. | |
| 460 | DATA, | |
| 461 | ||
| 462 | /// Maximum size of stack segment, in bytes. | |
| 463 | STACK, | |
| 464 | ||
| 465 | /// Largest core file that can be created, in bytes. | |
| 466 | CORE, | |
| 467 | ||
| 468 | /// Largest resident set size, in bytes. | |
| 469 | /// This affects swapping; processes that are exceeding their | |
| 470 | /// resident set size will be more likely to have physical memory | |
| 471 | /// taken from them. | |
| 472 | RSS, | |
| 473 | ||
| 474 | /// Number of open files. | |
| 475 | NOFILE, | |
| 476 | ||
| 477 | /// Number of processes. | |
| 478 | NPROC, | |
| 479 | ||
| 480 | /// Locked-in-memory address space. | |
| 481 | MEMLOCK, | |
| 482 | ||
| 483 | /// Address space limit. | |
| 484 | AS, | |
| 485 | ||
| 486 | /// Maximum number of file locks. | |
| 487 | LOCKS, | |
| 488 | ||
| 489 | /// Maximum number of pending signals. | |
| 490 | SIGPENDING, | |
| 491 | ||
| 492 | /// Maximum bytes in POSIX message queues. | |
| 493 | MSGQUEUE, | |
| 494 | ||
| 495 | /// Maximum nice priority allowed to raise to. | |
| 496 | /// Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 497 | /// values of this resource limit. | |
| 498 | NICE, | |
| 499 | ||
| 500 | /// Maximum realtime priority allowed for non-privileged | |
| 501 | /// processes. | |
| 502 | RTPRIO, | |
| 503 | ||
| 504 | /// Maximum CPU time in µs that a process scheduled under a real-time | |
| 505 | /// scheduling policy may consume without making a blocking system | |
| 506 | /// call before being forcibly descheduled. | |
| 507 | RTTIME, | |
| 508 | ||
| 509 | _, | |
| 510 | }; |
test/behavior/maximum_minimum.zig+2| ... | ... | @@ -146,6 +146,8 @@ test "@min/max for floats" { |
| 146 | 146 | }; |
| 147 | 147 | |
| 148 | 148 | inline for (.{ f16, f32, f64, f80, f128, c_longdouble }) |T| { |
| 149 | if (T == c_longdouble and builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21090 | |
| 150 | ||
| 149 | 151 | try S.doTheTest(T); |
| 150 | 152 | try comptime S.doTheTest(T); |
| 151 | 153 | } |
test/behavior/vector.zig+1| ... | ... | @@ -773,6 +773,7 @@ test "vector reduce operation" { |
| 773 | 773 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 774 | 774 | if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; |
| 775 | 775 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 776 | if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21091 | |
| 776 | 777 | |
| 777 | 778 | const S = struct { |
| 778 | 779 | fn testReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void { |
test/tests.zig+48| ... | ... | @@ -365,6 +365,54 @@ const test_targets = blk: { |
| 365 | 365 | .slow_backend = true, |
| 366 | 366 | }, |
| 367 | 367 | |
| 368 | .{ | |
| 369 | .target = .{ | |
| 370 | .cpu_arch = .mips64, | |
| 371 | .os_tag = .linux, | |
| 372 | .abi = .none, | |
| 373 | }, | |
| 374 | }, | |
| 375 | .{ | |
| 376 | .target = .{ | |
| 377 | .cpu_arch = .mips64, | |
| 378 | .os_tag = .linux, | |
| 379 | .abi = .musl, | |
| 380 | }, | |
| 381 | .link_libc = true, | |
| 382 | }, | |
| 383 | .{ | |
| 384 | .target = .{ | |
| 385 | .cpu_arch = .mips64, | |
| 386 | .os_tag = .linux, | |
| 387 | .abi = .gnuabi64, | |
| 388 | }, | |
| 389 | .link_libc = true, | |
| 390 | }, | |
| 391 | ||
| 392 | .{ | |
| 393 | .target = .{ | |
| 394 | .cpu_arch = .mips64el, | |
| 395 | .os_tag = .linux, | |
| 396 | .abi = .none, | |
| 397 | }, | |
| 398 | }, | |
| 399 | .{ | |
| 400 | .target = .{ | |
| 401 | .cpu_arch = .mips64el, | |
| 402 | .os_tag = .linux, | |
| 403 | .abi = .musl, | |
| 404 | }, | |
| 405 | .link_libc = true, | |
| 406 | }, | |
| 407 | .{ | |
| 408 | .target = .{ | |
| 409 | .cpu_arch = .mips64el, | |
| 410 | .os_tag = .linux, | |
| 411 | .abi = .gnuabi64, | |
| 412 | }, | |
| 413 | .link_libc = true, | |
| 414 | }, | |
| 415 | ||
| 368 | 416 | .{ |
| 369 | 417 | .target = .{ |
| 370 | 418 | .cpu_arch = .powerpc, |