@@ -5,3 +5,86 @@ s_no_extra_traits! {
5
5
priv_: [ i64 ; 4 ]
6
6
}
7
7
}
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
+ pub struct pt_regs {
19
+ pub gpr: [ :: c_ulong; 32 ] ,
20
+ pub nip: :: c_ulong,
21
+ pub msr: :: c_ulong,
22
+ pub orig_gpr3: :: c_ulong,
23
+ pub ctr: :: c_ulong,
24
+ pub link: :: c_ulong,
25
+ pub xer: :: c_ulong,
26
+ pub ccr: :: c_ulong,
27
+ pub softe: :: c_ulong,
28
+ pub trap: :: c_ulong,
29
+ pub dar: :: c_ulong,
30
+ pub dsisr: :: c_ulong,
31
+ pub result: :: c_ulong,
32
+ }
33
+
34
+ #[ repr( align( 16 ) ) ]
35
+ pub struct mcontext_t {
36
+ __glibc_reserved: [ :: c_ulong; 4 ] ,
37
+ pub signal: :: c_int,
38
+ __pad0: :: c_int,
39
+ pub handler: :: c_ulong,
40
+ pub oldmask: :: c_ulong,
41
+ pub regs: * mut pt_regs,
42
+ pub gp_regs: [ :: c_ulong; 48 ] , // # define __NGREG 48
43
+ pub fp_regs: [ :: c_double; 33 ] , // # define __NFPREG 33
44
+ pub v_regs: * mut vrregset_t,
45
+ pub vmx_reserve: [ :: c_long; 69 ] , // # define __NVRREG 34 (34*2+1)
46
+ }
47
+
48
+ #[ repr( align( 16 ) ) ]
49
+ pub struct vrregset_t {
50
+ pub vrregs: [ [ :: c_uint; 4 ] ; 32 ] ,
51
+ pub vscr: vscr_t,
52
+ pub vrsave: :: c_uint,
53
+ __pad: [ :: c_uint; 3 ] ,
54
+ }
55
+
56
+ #[ repr( align( 16 ) ) ]
57
+ pub struct vscr_t {
58
+ #[ cfg( target_endian = "big" ) ]
59
+ __pad: [ :: c_uint; 3 ] ,
60
+ #[ cfg( target_endian = "big" ) ]
61
+ pub vscr_word: :: c_uint,
62
+
63
+ #[ cfg( target_endian = "little" ) ]
64
+ pub vscr_word: :: c_uint,
65
+ #[ cfg( target_endian = "little" ) ]
66
+ __pad: [ :: c_uint; 3 ] ,
67
+ }
68
+
69
+ #[ repr( align( 8 ) ) ]
70
+ pub struct clone_args {
71
+ pub flags: :: c_ulonglong,
72
+ pub pidfd: :: c_ulonglong,
73
+ pub child_tid: :: c_ulonglong,
74
+ pub parent_tid: :: c_ulonglong,
75
+ pub exit_signal: :: c_ulonglong,
76
+ pub stack: :: c_ulonglong,
77
+ pub stack_size: :: c_ulonglong,
78
+ pub tls: :: c_ulonglong,
79
+ pub set_tid: :: c_ulonglong,
80
+ pub set_tid_size: :: c_ulonglong,
81
+ pub cgroup: :: c_ulonglong,
82
+ }
83
+ }
84
+
85
+ extern "C" {
86
+ pub fn getcontext ( ucp : * mut ucontext_t ) -> :: c_int ;
87
+ pub fn setcontext ( ucp : * const ucontext_t ) -> :: c_int ;
88
+ pub fn makecontext ( ucp : * mut ucontext_t , func : extern "C" fn ( ) , argc : :: c_int , ...) ;
89
+ pub fn swapcontext ( uocp : * mut ucontext_t , ucp : * const ucontext_t ) -> :: c_int ;
90
+ }
0 commit comments