1 use PT_FIRSTMACH;
2 
3 pub type c_long = i64;
4 pub type c_ulong = u64;
5 pub type c_char = u8;
6 pub type greg_t = u64;
7 pub type __cpu_simple_lock_nv_t = ::c_uchar;
8 
9 s! {
10     pub struct __fregset {
11         #[cfg(libc_union)]
12         pub __qregs: [__c_anonymous__freg; 32],
13         pub __fpcr: u32,
14         pub __fpsr: u32,
15     }
16 
17     pub struct mcontext_t {
18         pub __gregs: [::greg_t; 32],
19         pub __fregs: __fregset,
20         __spare: [::greg_t; 8],
21     }
22 
23     pub struct ucontext_t {
24         pub uc_flags: ::c_uint,
25         pub uc_link: *mut ucontext_t,
26         pub uc_sigmask: ::sigset_t,
27         pub uc_stack: ::stack_t,
28         pub uc_mcontext: mcontext_t,
29     }
30 }
31 
32 s_no_extra_traits! {
33     #[cfg(libc_union)]
34     #[repr(align(16))]
35     pub union __c_anonymous__freg {
36         pub __b8: [u8; 16],
37         pub __h16: [u16; 8],
38         pub __s32: [u32; 4],
39         pub __d64: [u64; 2],
40         pub __q128: [u128; 1],
41     }
42 }
43 
44 cfg_if! {
45     if #[cfg(feature = "extra_traits")] {
46         #[cfg(libc_union)]
47         impl PartialEq for __c_anonymous__freg {
48             fn eq(&self, other: &__c_anonymous__freg) -> bool {
49                 unsafe {
50                 self.__b8 == other.__b8
51                     || self.__h16 == other.__h16
52                     || self.__s32 == other.__s32
53                     || self.__d64 == other.__d64
54                     || self.__q128 == other.__q128
55                 }
56             }
57         }
58         #[cfg(libc_union)]
59         impl Eq for __c_anonymous__freg {}
60         #[cfg(libc_union)]
61         impl ::fmt::Debug for __c_anonymous__freg {
62             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
63                 unsafe {
64                 f.debug_struct("__c_anonymous__freg")
65                     .field("__b8", &self.__b8)
66                     .field("__h16", &self.__h16)
67                     .field("__s32", &self.__s32)
68                     .field("__d64", &self.__d64)
69                     .field("__q128", &self.__q128)
70                     .finish()
71                 }
72             }
73         }
74         #[cfg(libc_union)]
75         impl ::hash::Hash for __c_anonymous__freg {
76             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
77                 unsafe {
78                 self.__b8.hash(state);
79                 self.__h16.hash(state);
80                 self.__s32.hash(state);
81                 self.__d64.hash(state);
82                 self.__q128.hash(state);
83                 }
84             }
85         }
86     }
87 }
88 
89 // should be pub(crate), but that requires Rust 1.18.0
90 cfg_if! {
91     if #[cfg(libc_const_size_of)] {
92         #[doc(hidden)]
93         pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
94     } else {
95         #[doc(hidden)]
96         pub const _ALIGNBYTES: usize = 4 - 1;
97     }
98 }
99 
100 pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
101 pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
102 pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
103 pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
104 
105 pub const _REG_R0: ::c_int = 0;
106 pub const _REG_R1: ::c_int = 1;
107 pub const _REG_R2: ::c_int = 2;
108 pub const _REG_R3: ::c_int = 3;
109 pub const _REG_R4: ::c_int = 4;
110 pub const _REG_R5: ::c_int = 5;
111 pub const _REG_R6: ::c_int = 6;
112 pub const _REG_R7: ::c_int = 7;
113 pub const _REG_R8: ::c_int = 8;
114 pub const _REG_R9: ::c_int = 9;
115 pub const _REG_R10: ::c_int = 10;
116 pub const _REG_R11: ::c_int = 11;
117 pub const _REG_R12: ::c_int = 12;
118 pub const _REG_R13: ::c_int = 13;
119 pub const _REG_R14: ::c_int = 14;
120 pub const _REG_R15: ::c_int = 15;
121 pub const _REG_CPSR: ::c_int = 16;
122 pub const _REG_X0: ::c_int = 0;
123 pub const _REG_X1: ::c_int = 1;
124 pub const _REG_X2: ::c_int = 2;
125 pub const _REG_X3: ::c_int = 3;
126 pub const _REG_X4: ::c_int = 4;
127 pub const _REG_X5: ::c_int = 5;
128 pub const _REG_X6: ::c_int = 6;
129 pub const _REG_X7: ::c_int = 7;
130 pub const _REG_X8: ::c_int = 8;
131 pub const _REG_X9: ::c_int = 9;
132 pub const _REG_X10: ::c_int = 10;
133 pub const _REG_X11: ::c_int = 11;
134 pub const _REG_X12: ::c_int = 12;
135 pub const _REG_X13: ::c_int = 13;
136 pub const _REG_X14: ::c_int = 14;
137 pub const _REG_X15: ::c_int = 15;
138 pub const _REG_X16: ::c_int = 16;
139 pub const _REG_X17: ::c_int = 17;
140 pub const _REG_X18: ::c_int = 18;
141 pub const _REG_X19: ::c_int = 19;
142 pub const _REG_X20: ::c_int = 20;
143 pub const _REG_X21: ::c_int = 21;
144 pub const _REG_X22: ::c_int = 22;
145 pub const _REG_X23: ::c_int = 23;
146 pub const _REG_X24: ::c_int = 24;
147 pub const _REG_X25: ::c_int = 25;
148 pub const _REG_X26: ::c_int = 26;
149 pub const _REG_X27: ::c_int = 27;
150 pub const _REG_X28: ::c_int = 28;
151 pub const _REG_X29: ::c_int = 29;
152 pub const _REG_X30: ::c_int = 30;
153 pub const _REG_X31: ::c_int = 31;
154 pub const _REG_ELR: ::c_int = 32;
155 pub const _REG_SPSR: ::c_int = 33;
156 pub const _REG_TIPDR: ::c_int = 34;
157 
158 pub const _REG_RV: ::c_int = _REG_X0;
159 pub const _REG_FP: ::c_int = _REG_X29;
160 pub const _REG_LR: ::c_int = _REG_X30;
161 pub const _REG_SP: ::c_int = _REG_X31;
162 pub const _REG_PC: ::c_int = _REG_ELR;
163