Skip to content

Commit a6d1226

Browse files
committed
linux/aarch64: make mcontext_t.__reserved pub
The `mcontext_t.__reserved` field is documented to contain extra context, such as FP state and the ESR register. This field is 16-byte aligned, so for simplicity expose it as an array of `u128` elements (similar to how `musl` defines it as an array of `long double`s in C).
1 parent eda627e commit a6d1226

File tree

3 files changed

+3
-6
lines changed
  • src/unix/linux_like

3 files changed

+3
-6
lines changed

src/unix/linux_like/android/b64/aarch64/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ s! {
6767
pub uc_mcontext: mcontext_t,
6868
}
6969

70-
#[repr(align(16))]
7170
pub struct mcontext_t {
7271
pub fault_address: c_ulonglong,
7372
pub regs: [c_ulonglong; 31],
7473
pub sp: c_ulonglong,
7574
pub pc: c_ulonglong,
7675
pub pstate: c_ulonglong,
77-
__reserved: [u64; 512],
76+
pub __reserved: [u128; 256],
7877
}
7978

8079
pub struct user_fpsimd_struct {

src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,13 @@ s! {
212212
pub uc_mcontext: mcontext_t,
213213
}
214214

215-
#[repr(align(16))]
216215
pub struct mcontext_t {
217216
pub fault_address: c_ulonglong,
218217
pub regs: [c_ulonglong; 31],
219218
pub sp: c_ulonglong,
220219
pub pc: c_ulonglong,
221220
pub pstate: c_ulonglong,
222-
__reserved: [u64; 512],
221+
pub __reserved: [u128; 256],
223222
}
224223

225224
pub struct user_fpsimd_struct {

src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ s! {
9696
pub uc_mcontext: mcontext_t,
9797
}
9898

99-
#[repr(align(16))]
10099
pub struct mcontext_t {
101100
pub fault_address: c_ulong,
102101
pub regs: [c_ulong; 31],
103102
pub sp: c_ulong,
104103
pub pc: c_ulong,
105104
pub pstate: c_ulong,
106-
__reserved: [u64; 512],
105+
pub __reserved: [u128; 256],
107106
}
108107

109108
#[repr(align(8))]

0 commit comments

Comments
 (0)