Skip to content

Commit

Permalink
factorise ucontext type/semver
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Aug 29, 2024
1 parent 8cdb35f commit c4957c2
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 16 deletions.
47 changes: 47 additions & 0 deletions libc-test/semver/netbsd-riscv64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
_REG_A0
_REG_F0
_REG_FPCSR
_REG_GP
_REG_PC
_REG_RA
_REG_RV
_REG_S0
_REG_SP
_REG_TP
_REG_X1
_REG_X2
_REG_X3
_REG_X4
_REG_X5
_REG_X6
_REG_X7
_REG_X8
_REG_X9
_REG_X10
_REG_X11
_REG_X12
_REG_X13
_REG_X14
_REG_X15
_REG_X16
_REG_X17
_REG_X18
_REG_X19
_REG_X20
_REG_X21
_REG_X22
_REG_X23
_REG_X24
_REG_X25
_REG_X26
_REG_X27
_REG_X28
_REG_X29
_REG_X30
_REG_X31
PT_GETFPREGS
PT_GETREGS
PT_SETFPREGS
PT_SETREGS
mcontext_t
ucontext_t
8 changes: 0 additions & 8 deletions src/unix/bsd/netbsdlike/netbsd/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ s! {
pub __fregs: __fregset,
__spare: [::greg_t; 8],
}

pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
}
}

s_no_extra_traits! {
Expand Down
9 changes: 9 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,15 @@ s! {
pub tcpi_snd_zerowin: u32,
pub __tcpi_pad: [u32; 26],
}

#[cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "riscv64"))]
pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ::ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: ::mcontext_t,
}
}

s_no_extra_traits! {
Expand Down
8 changes: 0 additions & 8 deletions src/unix/bsd/netbsdlike/netbsd/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ s! {
pub _mc_tlsbase: c___greg_t,
pub __fpregs: [[::c_char;32]; 16],
}

pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ::ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: ::mcontext_t,
}
}

pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
Expand Down

0 comments on commit c4957c2

Please sign in to comment.