Commit b77076c3 authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'ptrace' into 'master'

Fix floating-point struct

See merge request !37
parents e3fd644b 49dd2226
Pipeline #5113 passed with stage
in 18 seconds
...@@ -222,6 +222,8 @@ impl DerefMut for TimeSpec { ...@@ -222,6 +222,8 @@ impl DerefMut for TimeSpec {
#[repr(C)] #[repr(C)]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
pub struct IntRegisters { pub struct IntRegisters {
// TODO: Some of these don't get set by Redox yet. Should they?
pub r15: usize, pub r15: usize,
pub r14: usize, pub r14: usize,
pub r13: usize, pub r13: usize,
...@@ -240,15 +242,15 @@ pub struct IntRegisters { ...@@ -240,15 +242,15 @@ pub struct IntRegisters {
// pub orig_rax: usize, // pub orig_rax: usize,
pub rip: usize, pub rip: usize,
pub cs: usize, pub cs: usize,
pub eflags: usize, pub rflags: usize,
pub rsp: usize, pub rsp: usize,
pub ss: usize, pub ss: usize,
pub fs_base: usize, // pub fs_base: usize,
pub gs_base: usize, // pub gs_base: usize,
pub ds: usize, // pub ds: usize,
pub es: usize, // pub es: usize,
pub fs: usize, pub fs: usize,
pub gs: usize // pub gs: usize
} }
impl Deref for IntRegisters { impl Deref for IntRegisters {
...@@ -268,27 +270,21 @@ impl DerefMut for IntRegisters { ...@@ -268,27 +270,21 @@ impl DerefMut for IntRegisters {
} }
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Debug, Default)]
#[repr(C)] #[repr(packed)]
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
pub struct FloatRegisters { pub struct FloatRegisters {
pub cwd: u16, pub fcw: u16,
pub swd: u16, pub fsw: u16,
pub ftw: u16, pub ftw: u8,
pub _reserved: u8,
pub fop: u16, pub fop: u16,
pub rip: u64, pub fip: u64,
pub rdp: u64, pub fdp: u64,
pub mxcsr: u32, pub mxcsr: u32,
pub mxcr_mask: u32, pub mxcsr_mask: u32,
pub st_space: [u32; 32], pub st_space: [u128; 8],
pub xmm_space: [u32; 64] pub xmm_space: [u128; 16]
}
impl Default for FloatRegisters {
fn default() -> Self {
// xmm_space is not Default until const generics
unsafe { mem::zeroed() }
}
} }
impl Deref for FloatRegisters { impl Deref for FloatRegisters {
......
Markdown is supported
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