From 10347e8604257f5396c568d8ec69b11d15f79f5a Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Wed, 23 Dec 2020 22:00:25 +0100 Subject: [PATCH 01/11] provide complete definition of __darwin_mcontext64 on aarch64 --- src/unix/bsd/apple/b64/aarch64.rs | 16 +++++++- src/unix/bsd/apple/b64/mod.rs | 62 ----------------------------- src/unix/bsd/apple/b64/x86_64.rs | 66 ++++++++++++++++++++++++++++++- 3 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/unix/bsd/apple/b64/aarch64.rs b/src/unix/bsd/apple/b64/aarch64.rs index 27e6861217d13..ce63b18c08973 100644 --- a/src/unix/bsd/apple/b64/aarch64.rs +++ b/src/unix/bsd/apple/b64/aarch64.rs @@ -1,8 +1,14 @@ s! { pub struct __darwin_mcontext64 { - pub __es: ::__darwin_x86_exception_state64, + pub __es: __darwin_arm_exception_state64, pub __ss: __darwin_arm_thread_state64, - pub __fs: ::__darwin_x86_float_state64, + pub __ns: __darwin_arm_neon_state64, + } + + pub struct __darwin_arm_exception_state64 { + pub __far: u64, + pub __esr: u32, + pub __exception: u32, } pub struct __darwin_arm_thread_state64 { @@ -14,4 +20,10 @@ s! { pub __cpsr: u32, pub __pad: u32, } + + pub struct __darwin_arm_neon_state64 { + pub __v: [u128; 32], + pub __fpsr: u32, + pub __fpcr: u32, + } } diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index 0596ba5ef03d6..e19e4066852d3 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -58,68 +58,6 @@ s! { pub uc_mcsize: usize, pub uc_mcontext: mcontext_t, } - - pub struct __darwin_x86_exception_state64 { - pub __trapno: u16, - pub __cpu: u16, - pub __err: u32, - pub __faultvaddr: u64, - } - - pub struct __darwin_x86_float_state64 { - pub __fpu_reserved: [::c_int; 2], - __fpu_fcw: ::c_short, - __fpu_fsw: ::c_short, - pub __fpu_ftw: u8, - pub __fpu_rsrv1: u8, - pub __fpu_fop: u16, - pub __fpu_ip: u32, - pub __fpu_cs: u16, - pub __fpu_rsrv2: u16, - pub __fpu_dp: u32, - pub __fpu_ds: u16, - pub __fpu_rsrv3: u16, - pub __fpu_mxcsr: u32, - pub __fpu_mxcsrmask: u32, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_xmm8: __darwin_xmm_reg, - pub __fpu_xmm9: __darwin_xmm_reg, - pub __fpu_xmm10: __darwin_xmm_reg, - pub __fpu_xmm11: __darwin_xmm_reg, - pub __fpu_xmm12: __darwin_xmm_reg, - pub __fpu_xmm13: __darwin_xmm_reg, - pub __fpu_xmm14: __darwin_xmm_reg, - pub __fpu_xmm15: __darwin_xmm_reg, - // this field is actually [u8; 96], but defining it with a bigger type - // allows us to auto-implement traits for it since the length of the - // array is less than 32 - __fpu_rsrv4: [u32; 24], - pub __fpu_reserved1: ::c_int, - } - - pub struct __darwin_mmst_reg { - pub __mmst_reg: [::c_char; 10], - pub __mmst_rsrv: [::c_char; 6], - } - - pub struct __darwin_xmm_reg { - pub __xmm_reg: [::c_char; 16], - } } s_no_extra_traits! { diff --git a/src/unix/bsd/apple/b64/x86_64.rs b/src/unix/bsd/apple/b64/x86_64.rs index f8bb4c8f999bc..4fd0f278c425f 100644 --- a/src/unix/bsd/apple/b64/x86_64.rs +++ b/src/unix/bsd/apple/b64/x86_64.rs @@ -1,8 +1,15 @@ s! { pub struct __darwin_mcontext64 { - pub __es: ::__darwin_x86_exception_state64, + pub __es: __darwin_x86_exception_state64, pub __ss: __darwin_x86_thread_state64, - pub __fs: ::__darwin_x86_float_state64, + pub __fs: __darwin_x86_float_state64, + } + + pub struct __darwin_x86_exception_state64 { + pub __trapno: u16, + pub __cpu: u16, + pub __err: u32, + pub __faultvaddr: u64, } pub struct __darwin_x86_thread_state64 { @@ -28,4 +35,59 @@ s! { pub __fs: u64, pub __gs: u64, } + + pub struct __darwin_x86_float_state64 { + pub __fpu_reserved: [::c_int; 2], + __fpu_fcw: ::c_short, + __fpu_fsw: ::c_short, + pub __fpu_ftw: u8, + pub __fpu_rsrv1: u8, + pub __fpu_fop: u16, + pub __fpu_ip: u32, + pub __fpu_cs: u16, + pub __fpu_rsrv2: u16, + pub __fpu_dp: u32, + pub __fpu_ds: u16, + pub __fpu_rsrv3: u16, + pub __fpu_mxcsr: u32, + pub __fpu_mxcsrmask: u32, + pub __fpu_stmm0: __darwin_mmst_reg, + pub __fpu_stmm1: __darwin_mmst_reg, + pub __fpu_stmm2: __darwin_mmst_reg, + pub __fpu_stmm3: __darwin_mmst_reg, + pub __fpu_stmm4: __darwin_mmst_reg, + pub __fpu_stmm5: __darwin_mmst_reg, + pub __fpu_stmm6: __darwin_mmst_reg, + pub __fpu_stmm7: __darwin_mmst_reg, + pub __fpu_xmm0: __darwin_xmm_reg, + pub __fpu_xmm1: __darwin_xmm_reg, + pub __fpu_xmm2: __darwin_xmm_reg, + pub __fpu_xmm3: __darwin_xmm_reg, + pub __fpu_xmm4: __darwin_xmm_reg, + pub __fpu_xmm5: __darwin_xmm_reg, + pub __fpu_xmm6: __darwin_xmm_reg, + pub __fpu_xmm7: __darwin_xmm_reg, + pub __fpu_xmm8: __darwin_xmm_reg, + pub __fpu_xmm9: __darwin_xmm_reg, + pub __fpu_xmm10: __darwin_xmm_reg, + pub __fpu_xmm11: __darwin_xmm_reg, + pub __fpu_xmm12: __darwin_xmm_reg, + pub __fpu_xmm13: __darwin_xmm_reg, + pub __fpu_xmm14: __darwin_xmm_reg, + pub __fpu_xmm15: __darwin_xmm_reg, + // this field is actually [u8; 96], but defining it with a bigger type + // allows us to auto-implement traits for it since the length of the + // array is less than 32 + __fpu_rsrv4: [u32; 24], + pub __fpu_reserved1: ::c_int, + } + + pub struct __darwin_mmst_reg { + pub __mmst_reg: [::c_char; 10], + pub __mmst_rsrv: [::c_char; 6], + } + + pub struct __darwin_xmm_reg { + pub __xmm_reg: [::c_char; 16], + } } From 2ec0e61663a71840cde83a0acbfa060f248174cd Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Thu, 31 Dec 2020 12:07:20 +0100 Subject: [PATCH 02/11] use [u64; 2] with manual alignment instead of u128 --- src/unix/bsd/apple/b64/aarch64.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/apple/b64/aarch64.rs b/src/unix/bsd/apple/b64/aarch64.rs index ce63b18c08973..c48a34ddd8639 100644 --- a/src/unix/bsd/apple/b64/aarch64.rs +++ b/src/unix/bsd/apple/b64/aarch64.rs @@ -21,8 +21,9 @@ s! { pub __pad: u32, } + #[repr(align(16))] pub struct __darwin_arm_neon_state64 { - pub __v: [u128; 32], + pub __v: [[u64; 2]; 32], pub __fpsr: u32, pub __fpcr: u32, } From a7fd8a7a6b487aff77421990d8cbaee3d5f6e909 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 01:49:49 +0100 Subject: [PATCH 03/11] ignore __v field of __darwin_arm_neon_state64 in tests --- libc-test/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index d5dc0ef1ea84d..7c12ba76a7637 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -220,6 +220,7 @@ fn test_apple(target: &str) { match (struct_, field) { // FIXME: the array size has been changed since macOS 10.15 ([8] -> [7]). ("statfs", "f_reserved") => true, + ("__darwin_arm_neon_state64", "__v") => true, _ => false, } }); From a15491e3254116709dbb9cce3af802c824557323 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 01:54:37 +0100 Subject: [PATCH 04/11] move declaration of __darwin_mcontext64 etc. into align.rs --- src/unix/bsd/apple/b64/{aarch64.rs => aarch64/align.rs} | 0 src/unix/bsd/apple/b64/aarch64/mod.rs | 6 ++++++ 2 files changed, 6 insertions(+) rename src/unix/bsd/apple/b64/{aarch64.rs => aarch64/align.rs} (100%) create mode 100644 src/unix/bsd/apple/b64/aarch64/mod.rs diff --git a/src/unix/bsd/apple/b64/aarch64.rs b/src/unix/bsd/apple/b64/aarch64/align.rs similarity index 100% rename from src/unix/bsd/apple/b64/aarch64.rs rename to src/unix/bsd/apple/b64/aarch64/align.rs diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs new file mode 100644 index 0000000000000..45447da34fef0 --- /dev/null +++ b/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -0,0 +1,6 @@ +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} From 42fe29064e3030db46e880b4c30a46e159b891c8 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 02:11:48 +0100 Subject: [PATCH 05/11] provide declaration of boolean_t for macOS on aarch64 --- src/unix/bsd/apple/b64/aarch64/mod.rs | 2 ++ src/unix/bsd/apple/b64/mod.rs | 1 - src/unix/bsd/apple/b64/x86_64.rs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs index 45447da34fef0..83b62e97cf256 100644 --- a/src/unix/bsd/apple/b64/aarch64/mod.rs +++ b/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -1,3 +1,5 @@ +pub type boolean_t = ::c_int; + cfg_if! { if #[cfg(libc_align)] { mod align; diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index e19e4066852d3..6dd737282c31d 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -2,7 +2,6 @@ pub type c_long = i64; pub type c_ulong = u64; -pub type boolean_t = ::c_uint; pub type mcontext_t = *mut __darwin_mcontext64; s! { diff --git a/src/unix/bsd/apple/b64/x86_64.rs b/src/unix/bsd/apple/b64/x86_64.rs index 4fd0f278c425f..b9cb3d66ae182 100644 --- a/src/unix/bsd/apple/b64/x86_64.rs +++ b/src/unix/bsd/apple/b64/x86_64.rs @@ -1,3 +1,5 @@ +pub type boolean_t = ::c_uint; + s! { pub struct __darwin_mcontext64 { pub __es: __darwin_x86_exception_state64, From bdc755b487b39403a89db8808619a801ffdbca49 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 02:24:28 +0100 Subject: [PATCH 06/11] add declaration of max_align_t for macOS on aarch64 --- src/unix/bsd/apple/b64/aarch64/align.rs | 7 +++++++ src/unix/bsd/apple/b64/mod.rs | 7 ------- src/unix/bsd/apple/b64/x86_64/align.rs | 7 +++++++ src/unix/bsd/apple/b64/{x86_64.rs => x86_64/mod.rs} | 7 +++++++ 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 src/unix/bsd/apple/b64/x86_64/align.rs rename src/unix/bsd/apple/b64/{x86_64.rs => x86_64/mod.rs} (96%) diff --git a/src/unix/bsd/apple/b64/aarch64/align.rs b/src/unix/bsd/apple/b64/aarch64/align.rs index c48a34ddd8639..029da5f0c7c58 100644 --- a/src/unix/bsd/apple/b64/aarch64/align.rs +++ b/src/unix/bsd/apple/b64/aarch64/align.rs @@ -1,3 +1,10 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct max_align_t { + priv_: f64 + } +} + s! { pub struct __darwin_mcontext64 { pub __es: __darwin_arm_exception_state64, diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index 6dd737282c31d..b0c3d29d63eaa 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -121,13 +121,6 @@ extern "C" { ) -> ::c_int; } -cfg_if! { - if #[cfg(libc_align)] { - mod align; - pub use self::align::*; - } -} - cfg_if! { if #[cfg(target_arch = "x86_64")] { mod x86_64; diff --git a/src/unix/bsd/apple/b64/x86_64/align.rs b/src/unix/bsd/apple/b64/x86_64/align.rs new file mode 100644 index 0000000000000..ca1fe1ce29944 --- /dev/null +++ b/src/unix/bsd/apple/b64/x86_64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 2] + } +} diff --git a/src/unix/bsd/apple/b64/x86_64.rs b/src/unix/bsd/apple/b64/x86_64/mod.rs similarity index 96% rename from src/unix/bsd/apple/b64/x86_64.rs rename to src/unix/bsd/apple/b64/x86_64/mod.rs index b9cb3d66ae182..454602d5e7caf 100644 --- a/src/unix/bsd/apple/b64/x86_64.rs +++ b/src/unix/bsd/apple/b64/x86_64/mod.rs @@ -93,3 +93,10 @@ s! { pub __xmm_reg: [::c_char; 16], } } + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} From 3fc0015790747b3bd45a48556cac7e891f1efd8d Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 02:46:37 +0100 Subject: [PATCH 07/11] fix values of constants on macOS aarch64 --- src/unix/bsd/apple/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 648a968acbeec..f80e6b8770ab2 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1907,6 +1907,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2; pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1; pub const PTHREAD_CREATE_DETACHED: ::c_int = 2; +#[cfg(target_arch = "aarch64")] +pub const PTHREAD_STACK_MIN: ::size_t = 16384; +#[cfg(not(target_arch = "aarch64"))] pub const PTHREAD_STACK_MIN: ::size_t = 8192; pub const RLIMIT_CPU: ::c_int = 0; @@ -3129,6 +3132,9 @@ pub const SETALL: ::c_int = 9; // sys/shm.h pub const SHM_RDONLY: ::c_int = 0x1000; pub const SHM_RND: ::c_int = 0x2000; +#[cfg(target_arch = "aarch64")] +pub const SHMLBA: ::c_int = 16 * 1024; +#[cfg(not(target_arch = "aarch64"))] pub const SHMLBA: ::c_int = 4096; pub const SHM_R: ::c_int = IPC_R; pub const SHM_W: ::c_int = IPC_W; From ea2bc2c065911657d00aad02c87af648dadf27c9 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 02:48:07 +0100 Subject: [PATCH 08/11] add new constants for macOS Big Sur --- src/unix/bsd/apple/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index f80e6b8770ab2..581603920bc56 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2846,7 +2846,9 @@ pub const HW_L3CACHESIZE: ::c_int = 22; pub const HW_TB_FREQ: ::c_int = 23; pub const HW_MEMSIZE: ::c_int = 24; pub const HW_AVAILCPU: ::c_int = 25; -pub const HW_MAXID: ::c_int = 26; +pub const HW_TARGET: ::c_int = 26; +pub const HW_PRODUCT: ::c_int = 27; +pub const HW_MAXID: ::c_int = 28; pub const USER_CS_PATH: ::c_int = 1; pub const USER_BC_BASE_MAX: ::c_int = 2; pub const USER_BC_DIM_MAX: ::c_int = 3; From d377b52d73d7140b7aeb5379fd8b4a9cb01b9f4b Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 02:03:05 +0100 Subject: [PATCH 09/11] fix glob symbol name on macOS aarch64 --- src/unix/bsd/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 1744d8de1ab3a..caab1866fe9a2 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -632,7 +632,10 @@ extern "C" { egid: *mut ::gid_t, ) -> ::c_int; - #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")] + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "glob$INODE64") + ] #[cfg_attr(target_os = "netbsd", link_name = "__glob30")] #[cfg_attr( all(target_os = "freebsd", any(freebsd11, freebsd10)), From d57347aee3b349f6f6391f94a4afbd9a8652340a Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Fri, 1 Jan 2021 03:33:45 +0100 Subject: [PATCH 10/11] ignore changed constants in test for now --- libc-test/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 7c12ba76a7637..946d45a188cf1 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -199,6 +199,8 @@ fn test_apple(target: &str) { "SF_SETTABLE" => true, // FIXME: the value has been changed since Catalina (VM_FLAGS_RESILIENT_MEDIA is also contained now). "VM_FLAGS_USER_REMAP" => true, + // FIXME: the values have been changed since Big Sur + "HW_TARGET" | "HW_PRODUCT" | "HW_MAXID" => true, _ => false, } }); From ee84dae71cff4ae974ca711e8027c2f7255818d2 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Tue, 5 Jan 2021 11:23:48 +0100 Subject: [PATCH 11/11] move declarations of mcontext_t and ucontext_t --- src/unix/bsd/apple/b64/aarch64/align.rs | 11 +++++++++++ src/unix/bsd/apple/b64/mod.rs | 10 ---------- src/unix/bsd/apple/b64/x86_64/mod.rs | 10 ++++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/unix/bsd/apple/b64/aarch64/align.rs b/src/unix/bsd/apple/b64/aarch64/align.rs index 029da5f0c7c58..10d55039dfa7a 100644 --- a/src/unix/bsd/apple/b64/aarch64/align.rs +++ b/src/unix/bsd/apple/b64/aarch64/align.rs @@ -1,3 +1,5 @@ +pub type mcontext_t = *mut __darwin_mcontext64; + s_no_extra_traits! { #[allow(missing_debug_implementations)] pub struct max_align_t { @@ -6,6 +8,15 @@ s_no_extra_traits! { } s! { + pub struct ucontext_t { + pub uc_onstack: ::c_int, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_link: *mut ::ucontext_t, + pub uc_mcsize: usize, + pub uc_mcontext: mcontext_t, + } + pub struct __darwin_mcontext64 { pub __es: __darwin_arm_exception_state64, pub __ss: __darwin_arm_thread_state64, diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index b0c3d29d63eaa..48d94bcd6bfdc 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -2,7 +2,6 @@ pub type c_long = i64; pub type c_ulong = u64; -pub type mcontext_t = *mut __darwin_mcontext64; s! { pub struct timeval32 { @@ -48,15 +47,6 @@ s! { pub bh_datalen: u32, pub bh_hdrlen: ::c_ushort, } - - pub struct ucontext_t { - pub uc_onstack: ::c_int, - pub uc_sigmask: ::sigset_t, - pub uc_stack: ::stack_t, - pub uc_link: *mut ::ucontext_t, - pub uc_mcsize: usize, - pub uc_mcontext: mcontext_t, - } } s_no_extra_traits! { diff --git a/src/unix/bsd/apple/b64/x86_64/mod.rs b/src/unix/bsd/apple/b64/x86_64/mod.rs index 454602d5e7caf..078666658ceac 100644 --- a/src/unix/bsd/apple/b64/x86_64/mod.rs +++ b/src/unix/bsd/apple/b64/x86_64/mod.rs @@ -1,6 +1,16 @@ pub type boolean_t = ::c_uint; +pub type mcontext_t = *mut __darwin_mcontext64; s! { + pub struct ucontext_t { + pub uc_onstack: ::c_int, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_link: *mut ::ucontext_t, + pub uc_mcsize: usize, + pub uc_mcontext: mcontext_t, + } + pub struct __darwin_mcontext64 { pub __es: __darwin_x86_exception_state64, pub __ss: __darwin_x86_thread_state64,