]>
Commit | Line | Data |
---|---|---|
e74abb32 XL |
1 | s_no_extra_traits! { |
2 | #[allow(missing_debug_implementations)] | |
3 | #[repr(align(16))] | |
4 | pub struct max_align_t { | |
5 | priv_: [f32; 8] | |
6 | } | |
7 | } | |
ba9703b0 XL |
8 | |
9 | s! { | |
10 | pub struct ucontext_t { | |
11 | pub uc_flags: ::c_ulong, | |
12 | pub uc_link: *mut ucontext_t, | |
13 | pub uc_stack: ::stack_t, | |
14 | pub uc_sigmask: ::sigset_t, | |
15 | pub uc_mcontext: mcontext_t, | |
16 | } | |
17 | ||
18 | #[repr(align(16))] | |
19 | pub struct mcontext_t { | |
20 | pub fault_address: ::c_ulonglong, | |
21 | pub regs: [::c_ulonglong; 31], | |
22 | pub sp: ::c_ulonglong, | |
23 | pub pc: ::c_ulonglong, | |
24 | pub pstate: ::c_ulonglong, | |
25 | // nested arrays to get the right size/length while being able to | |
26 | // auto-derive traits like Debug | |
27 | __reserved: [[u64; 32]; 16], | |
28 | } | |
f2b60f7d | 29 | |
f2b60f7d FG |
30 | #[repr(align(8))] |
31 | pub struct clone_args { | |
32 | pub flags: ::c_ulonglong, | |
33 | pub pidfd: ::c_ulonglong, | |
34 | pub child_tid: ::c_ulonglong, | |
35 | pub parent_tid: ::c_ulonglong, | |
36 | pub exit_signal: ::c_ulonglong, | |
37 | pub stack: ::c_ulonglong, | |
38 | pub stack_size: ::c_ulonglong, | |
39 | pub tls: ::c_ulonglong, | |
40 | pub set_tid: ::c_ulonglong, | |
41 | pub set_tid_size: ::c_ulonglong, | |
42 | pub cgroup: ::c_ulonglong, | |
43 | } | |
ba9703b0 | 44 | } |
487cf647 FG |
45 | |
46 | extern "C" { | |
47 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; | |
48 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; | |
49 | pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); | |
50 | pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; | |
51 | } |