Commit ca6aea91 authored by 4lDO2's avatar 4lDO2 🖖
Browse files

Merge branch 'fsgsbase' into 'master'

Add fsbase/gsbase reg struct and more ELF auxiliary vectors.

See merge request !67
parents 841b5f42 519a09e9
Pipeline #9592 failed with stages
in 2 minutes and 14 seconds
......@@ -109,7 +109,8 @@ pub struct FloatRegisters {
pub mxcsr: u32,
pub mxcsr_mask: u32,
pub st_space: [u128; 8],
pub xmm_space: [u128; 16]
pub xmm_space: [u128; 16],
// TODO: YMM/ZMM
}
impl Deref for FloatRegisters {
......@@ -128,3 +129,26 @@ impl DerefMut for FloatRegisters {
}
}
}
#[derive(Clone, Copy, Debug, Default)]
#[repr(packed)]
pub struct EnvRegisters {
pub fsbase: u64,
pub gsbase: u64,
// TODO: PKRU?
}
impl Deref for EnvRegisters {
type Target = [u8];
fn deref(&self) -> &[u8] {
unsafe {
slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::<EnvRegisters>())
}
}
}
impl DerefMut for EnvRegisters {
fn deref_mut(&mut self) -> &mut [u8] {
unsafe {
slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::<EnvRegisters>())
}
}
}
......@@ -295,6 +295,8 @@ bitflags! {
// Auxiliery vector types
pub const AT_NULL: usize = 0;
pub const AT_PHDR: usize = 3;
pub const AT_PHENT: usize = 4;
pub const AT_PHNUM: usize = 5;
pub const AT_ENTRY: usize = 9;
bitflags! {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment