mirror of
https://github.com/ziglang/zig.git
synced 2026-01-27 09:45:27 +00:00
darwin: update mcontext_t definition for aarch64 to add neon state
This commit is contained in:
parent
412cd789bf
commit
576ffaa329
@ -151,11 +151,7 @@ pub const ucontext_t = extern struct {
|
||||
__mcontext_data: mcontext_t,
|
||||
};
|
||||
|
||||
pub const mcontext_t = extern struct {
|
||||
es: arch_bits.exception_state,
|
||||
ss: arch_bits.thread_state,
|
||||
fs: arch_bits.float_state,
|
||||
};
|
||||
pub const mcontext_t = arch_bits.mcontext_t;
|
||||
|
||||
extern "c" fn __error() *c_int;
|
||||
pub extern "c" fn NSVersionOfRunTimeLibrary(library_name: [*:0]const u8) u32;
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
// See C headers in
|
||||
// lib/libc/include/aarch64-macos.12-gnu/mach/arm/_structs.h
|
||||
// lib/libc/include/aarch64-macos.13-none/arm/_mcontext.h
|
||||
|
||||
pub const mcontext_t = extern struct {
|
||||
es: exception_state,
|
||||
ss: thread_state,
|
||||
ns: neon_state,
|
||||
};
|
||||
|
||||
pub const exception_state = extern struct {
|
||||
far: u64, // Virtual Fault Address
|
||||
@ -17,6 +24,12 @@ pub const thread_state = extern struct {
|
||||
__pad: u32,
|
||||
};
|
||||
|
||||
pub const neon_state = extern struct {
|
||||
q: [32]u128,
|
||||
fpsr: u32,
|
||||
fpcr: u32,
|
||||
};
|
||||
|
||||
pub const EXC_TYPES_COUNT = 14;
|
||||
pub const EXC_MASK_MACHINE = 0;
|
||||
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
const c = @import("../darwin.zig");
|
||||
|
||||
pub const mcontext_t = extern struct {
|
||||
es: exception_state,
|
||||
ss: thread_state,
|
||||
fs: float_state,
|
||||
};
|
||||
|
||||
pub const exception_state = extern struct {
|
||||
trapno: u16,
|
||||
cpu: u16,
|
||||
|
||||
@ -445,7 +445,14 @@ pub inline fn getContext(context: *StackTraceContext) bool {
|
||||
}
|
||||
|
||||
const result = have_getcontext and os.system.getcontext(context) == 0;
|
||||
if (native_os == .macos) assert(context.mcsize == @sizeOf(std.c.mcontext_t));
|
||||
if (native_os == .macos) {
|
||||
// TODO: Temp, to discover this size via aarch64 CI
|
||||
if (context.mcsize != @sizeOf(std.c.mcontext_t)) {
|
||||
print("context.mcsize does not match! {} vs {}\n", .{ context.mcsize, @sizeOf(std.c.mcontext_t)});
|
||||
}
|
||||
|
||||
assert(context.mcsize == @sizeOf(std.c.mcontext_t));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user