Skip to content

Commit fbcd9df

Browse files
committed
Added missing linux/user.h structures.
Added equivalents for user_regs_struct and user_struct from linux/user.h for x86 and x86_64.
1 parent fda4049 commit fbcd9df

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

src/unix/notbsd/linux/other/b32/x86.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,44 @@ s! {
1919
pub _st: [_libc_fpreg; 8],
2020
pub status: ::c_ulong,
2121
}
22+
23+
pub struct _libc_state {
24+
pub ebx: ::c_long,
25+
pub ecx: ::c_long,
26+
pub edx: ::c_long,
27+
pub esi: ::c_long,
28+
pub edi: ::c_long,
29+
pub ebp: ::c_long,
30+
pub eax: ::c_long,
31+
pub xds: ::c_long,
32+
pub xes: ::c_long,
33+
pub xfs: ::c_long,
34+
pub xgs: ::c_long,
35+
pub orig_eax: ::c_long,
36+
pub eip: ::c_long,
37+
pub xcs: ::c_long,
38+
pub eflags: u32,
39+
pub esp: ::c_long,
40+
pub xss: ::c_long,
41+
}
42+
43+
pub struct _libc_user {
44+
pub regs: _libc_state,
45+
pub u_fpvalid: i32,
46+
pub i387: _libc_fpstate,
47+
pub u_tsize: u32,
48+
pub u_dsize: u32,
49+
pub u_ssize: u32,
50+
pub start_code: u32,
51+
pub start_stack: u32,
52+
pub signal: i32,
53+
__reserved: i32,
54+
pub u_ar0: *mut _libc_state,
55+
pub u_fpstate: *mut _libc_fpstate,
56+
pub magic: u32,
57+
pub u_comm: [c_char; 32],
58+
pub u_debugreg: [i32; 8],
59+
}
2260

2361
pub struct mcontext_t {
2462
pub gregs: [greg_t; 19],

src/unix/notbsd/linux/other/b64/x86_64.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,54 @@ s! {
7878
__private: [u64; 12],
7979
}
8080

81+
pub struct _libc_state {
82+
pub r15: u64,
83+
pub r14: u64,
84+
pub r13: u64,
85+
pub r12: u64,
86+
pub rbp: u64,
87+
pub rbx: u64,
88+
pub r11: u64,
89+
pub r10: u64,
90+
pub r9: u64,
91+
pub r8: u64,
92+
pub rax: u64,
93+
pub rcx: u64,
94+
pub rdx: u64,
95+
pub rsi: u64,
96+
pub rdi: u64,
97+
pub orig_rax: u64,
98+
pub rip: u64,
99+
pub cs: u64,
100+
pub eflags: u64,
101+
pub rsp: u64,
102+
pub ss: u64,
103+
pub fs_base: u64,
104+
pub gs_base: u64,
105+
pub ds: u64,
106+
pub es: u64,
107+
pub fs: u64,
108+
pub gs: u64,
109+
}
110+
111+
pub struct _libc_user {
112+
pub regs: _libc_state,
113+
pub u_fpvalid: ::c_int,
114+
pub i387: _libc_fpstate,
115+
pub u_tsize: u64,
116+
pub u_dsize: u64,
117+
pub u_ssize: u64,
118+
pub start_code: u64,
119+
pub start_stack: u64,
120+
pub signal: i64,
121+
__reserved: ::c_int,
122+
pub u_ar0: *mut _libc_state,
123+
pub u_fpstate: *mut _libc_fpstate,
124+
pub magic: u64,
125+
pub u_comm: [::c_char; 32],
126+
pub u_debugreg: [u64; 8],
127+
}
128+
81129
pub struct mcontext_t {
82130
pub gregs: [greg_t; 23],
83131
pub fpregs: *mut _libc_fpstate,

0 commit comments

Comments
 (0)