diff options
author | Daniel McKenna <danielmckenna93@gmail.com> | 2017-05-23 17:18:55 +0100 |
---|---|---|
committer | Daniel McKenna <danielmckenna93@gmail.com> | 2017-05-23 17:18:55 +0100 |
commit | fbcd9df1cf002b9e4c07b0d793a102c2bbde69ad (patch) | |
tree | 31c8aabbdc8385d0d6af51ee45b2599e367359ac /src | |
parent | fda4049c11e75871a9e583fa5eea55f9be0f9972 (diff) | |
download | rust-libc-fbcd9df1cf002b9e4c07b0d793a102c2bbde69ad.tar.gz |
Added missing linux/user.h structures.
Added equivalents for user_regs_struct and user_struct from linux/user.h for x86 and x86_64.
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/notbsd/linux/other/b32/x86.rs | 38 | ||||
-rw-r--r-- | src/unix/notbsd/linux/other/b64/x86_64.rs | 48 |
2 files changed, 86 insertions, 0 deletions
diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs index 263e1406b7..2b2d16560c 100644 --- a/src/unix/notbsd/linux/other/b32/x86.rs +++ b/src/unix/notbsd/linux/other/b32/x86.rs @@ -19,6 +19,44 @@ s! { pub _st: [_libc_fpreg; 8], pub status: ::c_ulong, } + + pub struct _libc_state { + pub ebx: ::c_long, + pub ecx: ::c_long, + pub edx: ::c_long, + pub esi: ::c_long, + pub edi: ::c_long, + pub ebp: ::c_long, + pub eax: ::c_long, + pub xds: ::c_long, + pub xes: ::c_long, + pub xfs: ::c_long, + pub xgs: ::c_long, + pub orig_eax: ::c_long, + pub eip: ::c_long, + pub xcs: ::c_long, + pub eflags: u32, + pub esp: ::c_long, + pub xss: ::c_long, + } + + pub struct _libc_user { + pub regs: _libc_state, + pub u_fpvalid: i32, + pub i387: _libc_fpstate, + pub u_tsize: u32, + pub u_dsize: u32, + pub u_ssize: u32, + pub start_code: u32, + pub start_stack: u32, + pub signal: i32, + __reserved: i32, + pub u_ar0: *mut _libc_state, + pub u_fpstate: *mut _libc_fpstate, + pub magic: u32, + pub u_comm: [c_char; 32], + pub u_debugreg: [i32; 8], + } pub struct mcontext_t { pub gregs: [greg_t; 19], diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs index b39ccb3916..7d2766da4a 100644 --- a/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -78,6 +78,54 @@ s! { __private: [u64; 12], } + pub struct _libc_state { + pub r15: u64, + pub r14: u64, + pub r13: u64, + pub r12: u64, + pub rbp: u64, + pub rbx: u64, + pub r11: u64, + pub r10: u64, + pub r9: u64, + pub r8: u64, + pub rax: u64, + pub rcx: u64, + pub rdx: u64, + pub rsi: u64, + pub rdi: u64, + pub orig_rax: u64, + pub rip: u64, + pub cs: u64, + pub eflags: u64, + pub rsp: u64, + pub ss: u64, + pub fs_base: u64, + pub gs_base: u64, + pub ds: u64, + pub es: u64, + pub fs: u64, + pub gs: u64, + } + + pub struct _libc_user { + pub regs: _libc_state, + pub u_fpvalid: ::c_int, + pub i387: _libc_fpstate, + pub u_tsize: u64, + pub u_dsize: u64, + pub u_ssize: u64, + pub start_code: u64, + pub start_stack: u64, + pub signal: i64, + __reserved: ::c_int, + pub u_ar0: *mut _libc_state, + pub u_fpstate: *mut _libc_fpstate, + pub magic: u64, + pub u_comm: [::c_char; 32], + pub u_debugreg: [u64; 8], + } + pub struct mcontext_t { pub gregs: [greg_t; 23], pub fpregs: *mut _libc_fpstate, |