| 1 |
pub type boolean_t = ::c_uint; |
| 2 |
pub type mcontext_t = *mut __darwin_mcontext64; |
| 3 |
|
| 4 |
s! { |
| 5 |
pub struct ucontext_t { |
| 6 |
pub uc_onstack: ::c_int, |
| 7 |
pub uc_sigmask: ::sigset_t, |
| 8 |
pub uc_stack: ::stack_t, |
| 9 |
pub uc_link: *mut ::ucontext_t, |
| 10 |
pub uc_mcsize: usize, |
| 11 |
pub uc_mcontext: mcontext_t, |
| 12 |
} |
| 13 |
|
| 14 |
pub struct __darwin_mcontext64 { |
| 15 |
pub __es: __darwin_x86_exception_state64, |
| 16 |
pub __ss: __darwin_x86_thread_state64, |
| 17 |
pub __fs: __darwin_x86_float_state64, |
| 18 |
} |
| 19 |
|
| 20 |
pub struct __darwin_x86_exception_state64 { |
| 21 |
pub __trapno: u16, |
| 22 |
pub __cpu: u16, |
| 23 |
pub __err: u32, |
| 24 |
pub __faultvaddr: u64, |
| 25 |
} |
| 26 |
|
| 27 |
pub struct __darwin_x86_thread_state64 { |
| 28 |
pub __rax: u64, |
| 29 |
pub __rbx: u64, |
| 30 |
pub __rcx: u64, |
| 31 |
pub __rdx: u64, |
| 32 |
pub __rdi: u64, |
| 33 |
pub __rsi: u64, |
| 34 |
pub __rbp: u64, |
| 35 |
pub __rsp: u64, |
| 36 |
pub __r8: u64, |
| 37 |
pub __r9: u64, |
| 38 |
pub __r10: u64, |
| 39 |
pub __r11: u64, |
| 40 |
pub __r12: u64, |
| 41 |
pub __r13: u64, |
| 42 |
pub __r14: u64, |
| 43 |
pub __r15: u64, |
| 44 |
pub __rip: u64, |
| 45 |
pub __rflags: u64, |
| 46 |
pub __cs: u64, |
| 47 |
pub __fs: u64, |
| 48 |
pub __gs: u64, |
| 49 |
} |
| 50 |
|
| 51 |
pub struct __darwin_x86_float_state64 { |
| 52 |
pub __fpu_reserved: [::c_int; 2], |
| 53 |
__fpu_fcw: ::c_short, |
| 54 |
__fpu_fsw: ::c_short, |
| 55 |
pub __fpu_ftw: u8, |
| 56 |
pub __fpu_rsrv1: u8, |
| 57 |
pub __fpu_fop: u16, |
| 58 |
pub __fpu_ip: u32, |
| 59 |
pub __fpu_cs: u16, |
| 60 |
pub __fpu_rsrv2: u16, |
| 61 |
pub __fpu_dp: u32, |
| 62 |
pub __fpu_ds: u16, |
| 63 |
pub __fpu_rsrv3: u16, |
| 64 |
pub __fpu_mxcsr: u32, |
| 65 |
pub __fpu_mxcsrmask: u32, |
| 66 |
pub __fpu_stmm0: __darwin_mmst_reg, |
| 67 |
pub __fpu_stmm1: __darwin_mmst_reg, |
| 68 |
pub __fpu_stmm2: __darwin_mmst_reg, |
| 69 |
pub __fpu_stmm3: __darwin_mmst_reg, |
| 70 |
pub __fpu_stmm4: __darwin_mmst_reg, |
| 71 |
pub __fpu_stmm5: __darwin_mmst_reg, |
| 72 |
pub __fpu_stmm6: __darwin_mmst_reg, |
| 73 |
pub __fpu_stmm7: __darwin_mmst_reg, |
| 74 |
pub __fpu_xmm0: __darwin_xmm_reg, |
| 75 |
pub __fpu_xmm1: __darwin_xmm_reg, |
| 76 |
pub __fpu_xmm2: __darwin_xmm_reg, |
| 77 |
pub __fpu_xmm3: __darwin_xmm_reg, |
| 78 |
pub __fpu_xmm4: __darwin_xmm_reg, |
| 79 |
pub __fpu_xmm5: __darwin_xmm_reg, |
| 80 |
pub __fpu_xmm6: __darwin_xmm_reg, |
| 81 |
pub __fpu_xmm7: __darwin_xmm_reg, |
| 82 |
pub __fpu_xmm8: __darwin_xmm_reg, |
| 83 |
pub __fpu_xmm9: __darwin_xmm_reg, |
| 84 |
pub __fpu_xmm10: __darwin_xmm_reg, |
| 85 |
pub __fpu_xmm11: __darwin_xmm_reg, |
| 86 |
pub __fpu_xmm12: __darwin_xmm_reg, |
| 87 |
pub __fpu_xmm13: __darwin_xmm_reg, |
| 88 |
pub __fpu_xmm14: __darwin_xmm_reg, |
| 89 |
pub __fpu_xmm15: __darwin_xmm_reg, |
| 90 |
// this field is actually [u8; 96], but defining it with a bigger type |
| 91 |
// allows us to auto-implement traits for it since the length of the |
| 92 |
// array is less than 32 |
| 93 |
__fpu_rsrv4: [u32; 24], |
| 94 |
pub __fpu_reserved1: ::c_int, |
| 95 |
} |
| 96 |
|
| 97 |
pub struct __darwin_mmst_reg { |
| 98 |
pub __mmst_reg: [::c_char; 10], |
| 99 |
pub __mmst_rsrv: [::c_char; 6], |
| 100 |
} |
| 101 |
|
| 102 |
pub struct __darwin_xmm_reg { |
| 103 |
pub __xmm_reg: [::c_char; 16], |
| 104 |
} |
| 105 |
|
| 106 |
pub struct malloc_introspection_t { |
| 107 |
_private: [::uintptr_t; 16], // FIXME: keeping private for now |
| 108 |
} |
| 109 |
|
| 110 |
pub struct malloc_zone_t { |
| 111 |
_reserved1: *mut ::c_void, |
| 112 |
_reserved2: *mut ::c_void, |
| 113 |
pub size: ::Option<unsafe extern "C" fn( |
| 114 |
zone: *mut malloc_zone_t, |
| 115 |
ptr: *const ::c_void, |
| 116 |
) -> ::size_t>, |
| 117 |
pub malloc: ::Option<unsafe extern "C" fn( |
| 118 |
zone: *mut malloc_zone_t, |
| 119 |
size: ::size_t, |
| 120 |
) -> *mut ::c_void>, |
| 121 |
pub calloc: ::Option<unsafe extern "C" fn( |
| 122 |
zone: *mut malloc_zone_t, |
| 123 |
num_items: ::size_t, |
| 124 |
size: ::size_t, |
| 125 |
) -> *mut ::c_void>, |
| 126 |
pub valloc: ::Option<unsafe extern "C" fn( |
| 127 |
zone: *mut malloc_zone_t, |
| 128 |
size: ::size_t |
| 129 |
) -> *mut ::c_void>, |
| 130 |
pub free: ::Option<unsafe extern "C" fn( |
| 131 |
zone: *mut malloc_zone_t, |
| 132 |
ptr: *mut ::c_void |
| 133 |
)>, |
| 134 |
pub realloc: ::Option<unsafe extern "C" fn( |
| 135 |
zone: *mut malloc_zone_t, |
| 136 |
ptr: *mut ::c_void, |
| 137 |
size: ::size_t, |
| 138 |
) -> *mut ::c_void>, |
| 139 |
pub destroy: ::Option<unsafe extern "C" fn(zone: *mut malloc_zone_t)>, |
| 140 |
pub zone_name: *const ::c_char, |
| 141 |
pub batch_malloc: ::Option<unsafe extern "C" fn( |
| 142 |
zone: *mut malloc_zone_t, |
| 143 |
size: ::size_t, |
| 144 |
results: *mut *mut ::c_void, |
| 145 |
num_requested: ::c_uint, |
| 146 |
) -> ::c_uint>, |
| 147 |
pub batch_free: ::Option<unsafe extern "C" fn( |
| 148 |
zone: *mut malloc_zone_t, |
| 149 |
to_be_freed: *mut *mut ::c_void, |
| 150 |
num_to_be_freed: ::c_uint, |
| 151 |
)>, |
| 152 |
pub introspect: *mut malloc_introspection_t, |
| 153 |
pub version: ::c_uint, |
| 154 |
pub memalign: ::Option<unsafe extern "C" fn( |
| 155 |
zone: *mut malloc_zone_t, |
| 156 |
alignment: ::size_t, |
| 157 |
size: ::size_t, |
| 158 |
) -> *mut ::c_void>, |
| 159 |
pub free_definite_size: ::Option<unsafe extern "C" fn( |
| 160 |
zone: *mut malloc_zone_t, |
| 161 |
ptr: *mut ::c_void, |
| 162 |
size: ::size_t |
| 163 |
)>, |
| 164 |
pub pressure_relief: ::Option<unsafe extern "C" fn( |
| 165 |
zone: *mut malloc_zone_t, |
| 166 |
goal: ::size_t, |
| 167 |
) -> ::size_t>, |
| 168 |
pub claimed_address: ::Option<unsafe extern "C" fn( |
| 169 |
zone: *mut malloc_zone_t, |
| 170 |
ptr: *mut ::c_void, |
| 171 |
) -> ::boolean_t>, |
| 172 |
} |
| 173 |
} |
| 174 |
|
| 175 |
cfg_if! { |
| 176 |
if #[cfg(libc_align)] { |
| 177 |
mod align; |
| 178 |
pub use self::align::*; |
| 179 |
} |
| 180 |
} |