-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ucontext_t for powerpc64-linux #3986
Draft
mgiessing
wants to merge
4
commits into
rust-lang:main
Choose a base branch
from
mgiessing:powerpc64-linux-ucontext
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,92 @@ s_no_extra_traits! { | |
pub struct max_align_t { | ||
priv_: [i64; 4] | ||
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
pub struct ucontext_t { | ||
pub uc_flags: ::c_ulong, | ||
pub uc_link: *mut ucontext_t, | ||
pub uc_stack: ::stack_t, | ||
pub uc_sigmask: ::sigset_t, | ||
pub uc_mcontext: mcontext_t, | ||
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
pub struct pt_regs { | ||
pub gpr: [::c_ulong; 32], | ||
pub nip: ::c_ulong, | ||
pub msr: ::c_ulong, | ||
pub orig_gpr3: ::c_ulong, | ||
pub ctr: ::c_ulong, | ||
pub link: ::c_ulong, | ||
pub xer: ::c_ulong, | ||
pub ccr: ::c_ulong, | ||
pub softe: ::c_ulong, | ||
pub trap: ::c_ulong, | ||
pub dar: ::c_ulong, | ||
pub dsisr: ::c_ulong, | ||
pub result: ::c_ulong, | ||
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
#[repr(align(8))] | ||
pub struct mcontext_t { | ||
__glibc_reserved: [::c_ulong; 4], | ||
pub signal: ::c_int, | ||
__pad0: ::c_int, | ||
pub handler: ::c_ulong, | ||
pub oldmask: ::c_ulong, | ||
pub regs: *mut pt_regs, | ||
pub gp_regs: [::c_ulong; 48], // # define __NGREG 48 | ||
pub fp_regs: [::c_double; 33], // # define __NFPREG 33 | ||
pub v_regs: *mut vrregset_t, | ||
pub vmx_reserve: [::c_long; 69], // # define __NVRREG 34 (34*2+1) | ||
Comment on lines
+43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jut to be consistent, could you duplicate the C types? const _NGREG: usize = 48;
const __NFPREG: usize = 33;
const __NVRREG: usize = 34;
type gregset_t = [::c_ulong; __NGREG];
type fpregset_t = [::c_double; __NFPREG];
// in the struct
pub vmx_reserve: [::c_long; __NVRREG + __NVRREG + 1], |
||
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
#[repr(align(16))] | ||
pub struct vrregset_t { | ||
pub vrregs: [[::c_uint; 4]; 32], | ||
pub vscr: vscr_t, | ||
pub vrsave: ::c_uint, | ||
__pad: [::c_uint; 3], | ||
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
#[repr(align(4))] | ||
pub struct vscr_t { | ||
#[cfg(target_endian = "big")] | ||
__pad: [::c_uint; 3], | ||
#[cfg(target_endian = "big")] | ||
pub vscr_word: ::c_uint, | ||
|
||
#[cfg(target_endian = "little")] | ||
pub vscr_word: ::c_uint, | ||
#[cfg(target_endian = "little")] | ||
__pad: [::c_uint; 3], | ||
} | ||
} | ||
|
||
s! { | ||
#[repr(align(8))] | ||
pub struct clone_args { | ||
pub flags: ::c_ulonglong, | ||
pub pidfd: ::c_ulonglong, | ||
pub child_tid: ::c_ulonglong, | ||
pub parent_tid: ::c_ulonglong, | ||
pub exit_signal: ::c_ulonglong, | ||
pub stack: ::c_ulonglong, | ||
pub stack_size: ::c_ulonglong, | ||
pub tls: ::c_ulonglong, | ||
pub set_tid: ::c_ulonglong, | ||
pub set_tid_size: ::c_ulonglong, | ||
pub cgroup: ::c_ulonglong, | ||
} | ||
} | ||
|
||
extern "C" { | ||
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; | ||
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; | ||
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); | ||
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which
pt_regs
does this use? It doesn't look like the generic one at https://github.com/torvalds/linux/blob/f43b15692129904ccc064180fa2dd796ba3843a5/arch/arc/include/asm/ptrace.h#L65C3-L65C15