Skip to content

Commit a2cc2da

Browse files
CUB3DAkhilTThomas
authored andcommitted
Fix alignment of uc_ucontext fields on arm64 android (rust-lang#3894)
[ change `core` to `::core` and move ucontext_t to s_no_extra_traits for backport - Trevor ] (backport <rust-lang#3894>) (cherry picked from commit 707d32c)
1 parent 8535dc4 commit a2cc2da

File tree

1 file changed

+31
-0
lines changed
  • src/unix/linux_like/android/b64/aarch64

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
8+
#[allow(missing_debug_implementations)]
9+
pub struct ucontext_t {
10+
pub uc_flags: ::c_ulong,
11+
pub uc_link: *mut ucontext_t,
12+
pub uc_stack: ::stack_t,
13+
pub uc_sigmask: ::sigset_t,
14+
pub __pad: [u8; 1024 / 8 - ::core::mem::size_of::<::sigset_t>()],
15+
pub uc_mcontext: mcontext_t,
16+
}
17+
}
18+
19+
s! {
20+
#[repr(align(16))]
21+
pub struct mcontext_t {
22+
pub fault_address: ::c_ulonglong,
23+
pub regs: [::c_ulonglong; 31],
24+
pub sp: ::c_ulonglong,
25+
pub pc: ::c_ulonglong,
26+
pub pstate: ::c_ulonglong,
27+
// nested arrays to get the right size/length while being able to
28+
// auto-derive traits like Debug
29+
__reserved: [[u64; 32]; 16],
30+
}
31+
}

0 commit comments

Comments
 (0)