Skip to content

Commit 10347e8

Browse files
committed
provide complete definition of __darwin_mcontext64 on aarch64
1 parent 7e7452f commit 10347e8

File tree

3 files changed

+78
-66
lines changed

3 files changed

+78
-66
lines changed

src/unix/bsd/apple/b64/aarch64.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
s! {
22
pub struct __darwin_mcontext64 {
3-
pub __es: ::__darwin_x86_exception_state64,
3+
pub __es: __darwin_arm_exception_state64,
44
pub __ss: __darwin_arm_thread_state64,
5-
pub __fs: ::__darwin_x86_float_state64,
5+
pub __ns: __darwin_arm_neon_state64,
6+
}
7+
8+
pub struct __darwin_arm_exception_state64 {
9+
pub __far: u64,
10+
pub __esr: u32,
11+
pub __exception: u32,
612
}
713

814
pub struct __darwin_arm_thread_state64 {
@@ -14,4 +20,10 @@ s! {
1420
pub __cpsr: u32,
1521
pub __pad: u32,
1622
}
23+
24+
pub struct __darwin_arm_neon_state64 {
25+
pub __v: [u128; 32],
26+
pub __fpsr: u32,
27+
pub __fpcr: u32,
28+
}
1729
}

src/unix/bsd/apple/b64/mod.rs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -58,68 +58,6 @@ s! {
5858
pub uc_mcsize: usize,
5959
pub uc_mcontext: mcontext_t,
6060
}
61-
62-
pub struct __darwin_x86_exception_state64 {
63-
pub __trapno: u16,
64-
pub __cpu: u16,
65-
pub __err: u32,
66-
pub __faultvaddr: u64,
67-
}
68-
69-
pub struct __darwin_x86_float_state64 {
70-
pub __fpu_reserved: [::c_int; 2],
71-
__fpu_fcw: ::c_short,
72-
__fpu_fsw: ::c_short,
73-
pub __fpu_ftw: u8,
74-
pub __fpu_rsrv1: u8,
75-
pub __fpu_fop: u16,
76-
pub __fpu_ip: u32,
77-
pub __fpu_cs: u16,
78-
pub __fpu_rsrv2: u16,
79-
pub __fpu_dp: u32,
80-
pub __fpu_ds: u16,
81-
pub __fpu_rsrv3: u16,
82-
pub __fpu_mxcsr: u32,
83-
pub __fpu_mxcsrmask: u32,
84-
pub __fpu_stmm0: __darwin_mmst_reg,
85-
pub __fpu_stmm1: __darwin_mmst_reg,
86-
pub __fpu_stmm2: __darwin_mmst_reg,
87-
pub __fpu_stmm3: __darwin_mmst_reg,
88-
pub __fpu_stmm4: __darwin_mmst_reg,
89-
pub __fpu_stmm5: __darwin_mmst_reg,
90-
pub __fpu_stmm6: __darwin_mmst_reg,
91-
pub __fpu_stmm7: __darwin_mmst_reg,
92-
pub __fpu_xmm0: __darwin_xmm_reg,
93-
pub __fpu_xmm1: __darwin_xmm_reg,
94-
pub __fpu_xmm2: __darwin_xmm_reg,
95-
pub __fpu_xmm3: __darwin_xmm_reg,
96-
pub __fpu_xmm4: __darwin_xmm_reg,
97-
pub __fpu_xmm5: __darwin_xmm_reg,
98-
pub __fpu_xmm6: __darwin_xmm_reg,
99-
pub __fpu_xmm7: __darwin_xmm_reg,
100-
pub __fpu_xmm8: __darwin_xmm_reg,
101-
pub __fpu_xmm9: __darwin_xmm_reg,
102-
pub __fpu_xmm10: __darwin_xmm_reg,
103-
pub __fpu_xmm11: __darwin_xmm_reg,
104-
pub __fpu_xmm12: __darwin_xmm_reg,
105-
pub __fpu_xmm13: __darwin_xmm_reg,
106-
pub __fpu_xmm14: __darwin_xmm_reg,
107-
pub __fpu_xmm15: __darwin_xmm_reg,
108-
// this field is actually [u8; 96], but defining it with a bigger type
109-
// allows us to auto-implement traits for it since the length of the
110-
// array is less than 32
111-
__fpu_rsrv4: [u32; 24],
112-
pub __fpu_reserved1: ::c_int,
113-
}
114-
115-
pub struct __darwin_mmst_reg {
116-
pub __mmst_reg: [::c_char; 10],
117-
pub __mmst_rsrv: [::c_char; 6],
118-
}
119-
120-
pub struct __darwin_xmm_reg {
121-
pub __xmm_reg: [::c_char; 16],
122-
}
12361
}
12462

12563
s_no_extra_traits! {

src/unix/bsd/apple/b64/x86_64.rs

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
s! {
22
pub struct __darwin_mcontext64 {
3-
pub __es: ::__darwin_x86_exception_state64,
3+
pub __es: __darwin_x86_exception_state64,
44
pub __ss: __darwin_x86_thread_state64,
5-
pub __fs: ::__darwin_x86_float_state64,
5+
pub __fs: __darwin_x86_float_state64,
6+
}
7+
8+
pub struct __darwin_x86_exception_state64 {
9+
pub __trapno: u16,
10+
pub __cpu: u16,
11+
pub __err: u32,
12+
pub __faultvaddr: u64,
613
}
714

815
pub struct __darwin_x86_thread_state64 {
@@ -28,4 +35,59 @@ s! {
2835
pub __fs: u64,
2936
pub __gs: u64,
3037
}
38+
39+
pub struct __darwin_x86_float_state64 {
40+
pub __fpu_reserved: [::c_int; 2],
41+
__fpu_fcw: ::c_short,
42+
__fpu_fsw: ::c_short,
43+
pub __fpu_ftw: u8,
44+
pub __fpu_rsrv1: u8,
45+
pub __fpu_fop: u16,
46+
pub __fpu_ip: u32,
47+
pub __fpu_cs: u16,
48+
pub __fpu_rsrv2: u16,
49+
pub __fpu_dp: u32,
50+
pub __fpu_ds: u16,
51+
pub __fpu_rsrv3: u16,
52+
pub __fpu_mxcsr: u32,
53+
pub __fpu_mxcsrmask: u32,
54+
pub __fpu_stmm0: __darwin_mmst_reg,
55+
pub __fpu_stmm1: __darwin_mmst_reg,
56+
pub __fpu_stmm2: __darwin_mmst_reg,
57+
pub __fpu_stmm3: __darwin_mmst_reg,
58+
pub __fpu_stmm4: __darwin_mmst_reg,
59+
pub __fpu_stmm5: __darwin_mmst_reg,
60+
pub __fpu_stmm6: __darwin_mmst_reg,
61+
pub __fpu_stmm7: __darwin_mmst_reg,
62+
pub __fpu_xmm0: __darwin_xmm_reg,
63+
pub __fpu_xmm1: __darwin_xmm_reg,
64+
pub __fpu_xmm2: __darwin_xmm_reg,
65+
pub __fpu_xmm3: __darwin_xmm_reg,
66+
pub __fpu_xmm4: __darwin_xmm_reg,
67+
pub __fpu_xmm5: __darwin_xmm_reg,
68+
pub __fpu_xmm6: __darwin_xmm_reg,
69+
pub __fpu_xmm7: __darwin_xmm_reg,
70+
pub __fpu_xmm8: __darwin_xmm_reg,
71+
pub __fpu_xmm9: __darwin_xmm_reg,
72+
pub __fpu_xmm10: __darwin_xmm_reg,
73+
pub __fpu_xmm11: __darwin_xmm_reg,
74+
pub __fpu_xmm12: __darwin_xmm_reg,
75+
pub __fpu_xmm13: __darwin_xmm_reg,
76+
pub __fpu_xmm14: __darwin_xmm_reg,
77+
pub __fpu_xmm15: __darwin_xmm_reg,
78+
// this field is actually [u8; 96], but defining it with a bigger type
79+
// allows us to auto-implement traits for it since the length of the
80+
// array is less than 32
81+
__fpu_rsrv4: [u32; 24],
82+
pub __fpu_reserved1: ::c_int,
83+
}
84+
85+
pub struct __darwin_mmst_reg {
86+
pub __mmst_reg: [::c_char; 10],
87+
pub __mmst_rsrv: [::c_char; 6],
88+
}
89+
90+
pub struct __darwin_xmm_reg {
91+
pub __xmm_reg: [::c_char; 16],
92+
}
3193
}

0 commit comments

Comments
 (0)