authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-06 16:48:43+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-07 16:47:57+02:00
log0b33891f4c5a1de378ff6035380b84abbebfa6e2
treec2db7eb2c33c91bbc418f21cfcd93f738e67d3b6
parent98af7f34e96ff8e2caaaf579df6ad136bb17f848
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux: add ucontext_t and mcontext_t for mips/mips64


2 files changed, 57 insertions(+), 4 deletions(-)

lib/std/os/linux/mips.zig+30-2
...@@ -9,6 +9,8 @@ const iovec_const = std.posix.iovec_const;...@@ -9,6 +9,8 @@ const iovec_const = std.posix.iovec_const;
9const uid_t = linux.uid_t;9const uid_t = linux.uid_t;
10const gid_t = linux.gid_t;10const gid_t = linux.gid_t;
11const pid_t = linux.pid_t;11const pid_t = linux.pid_t;
12const stack_t = linux.stack_t;
13const sigset_t = linux.sigset_t;
12const sockaddr = linux.sockaddr;14const sockaddr = linux.sockaddr;
13const timespec = linux.timespec;15const timespec = linux.timespec;
1416
...@@ -347,5 +349,31 @@ pub const timezone = extern struct {...@@ -347,5 +349,31 @@ pub const timezone = extern struct {
347349
348pub const Elf_Symndx = u32;350pub const Elf_Symndx = u32;
349351
350/// TODO352pub const mcontext_t = extern struct {
351pub const ucontext_t = void;353 _regmask: u32,
354 _status: u32,
355 pc: u64,
356 regs: [32]u64,
357 fpregs: [32]f64,
358 acx: u32,
359 fpc_csr: u32,
360 _fpc_eir: u32,
361 used_math: u32,
362 dsp: u32,
363 mdhi: u64,
364 mdlo: u64,
365 hi1: u32,
366 lo1: u32,
367 hi2: u32,
368 lo2: u32,
369 hi3: u32,
370 lo3: u32,
371};
372
373pub const ucontext_t = extern struct {
374 flags: u32,
375 link: ?*ucontext_t,
376 stack: stack_t,
377 mcontext: mcontext_t,
378 sigmask: sigset_t,
379};
lib/std/os/linux/mips64.zig+27-2
...@@ -9,6 +9,8 @@ const iovec_const = std.posix.iovec_const;...@@ -9,6 +9,8 @@ const iovec_const = std.posix.iovec_const;
9const uid_t = linux.uid_t;9const uid_t = linux.uid_t;
10const gid_t = linux.gid_t;10const gid_t = linux.gid_t;
11const pid_t = linux.pid_t;11const pid_t = linux.pid_t;
12const stack_t = linux.stack_t;
13const sigset_t = linux.sigset_t;
12const sockaddr = linux.sockaddr;14const sockaddr = linux.sockaddr;
13const timespec = linux.timespec;15const timespec = linux.timespec;
1416
...@@ -326,5 +328,28 @@ pub const timezone = extern struct {...@@ -326,5 +328,28 @@ pub const timezone = extern struct {
326328
327pub const Elf_Symndx = u32;329pub const Elf_Symndx = u32;
328330
329/// TODO331pub const mcontext_t = extern struct {
330pub const ucontext_t = void;332 regs: [32]u64,
333 fpregs: [32]f64,
334 mdhi: u64,
335 hi1: u64,
336 hi2: u64,
337 hi3: u64,
338 mdlo: u64,
339 lo1: u64,
340 lo2: u64,
341 lo3: u64,
342 pc: u64,
343 fpc_csr: u32,
344 used_math: u32,
345 dsp: u32,
346 _reserved: u32,
347};
348
349pub const ucontext_t = extern struct {
350 flags: u32,
351 link: ?*ucontext_t,
352 stack: stack_t,
353 mcontext: mcontext_t,
354 sigmask: sigset_t,
355};