Convert repr(packed) to repr(C, packed).
This is required by crates like bytemuck.
This commit is contained in:
+2
-2
@@ -111,7 +111,7 @@ impl DerefMut for IntRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct FloatRegisters {
|
||||
pub fp_simd_regs: [u128; 32],
|
||||
pub fpsr: u32,
|
||||
@@ -142,7 +142,7 @@ impl DerefMut for FloatRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct EnvRegisters {
|
||||
pub tpidr_el0: usize,
|
||||
pub tpidrro_el0: usize,
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ impl DerefMut for IntRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct FloatRegisters {
|
||||
//TODO
|
||||
}
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ impl DerefMut for IntRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct FloatRegisters {
|
||||
pub fcw: u16,
|
||||
pub fsw: u16,
|
||||
@@ -179,7 +179,7 @@ impl DerefMut for FloatRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct EnvRegisters {
|
||||
pub fsbase: u32,
|
||||
pub gsbase: u32,
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ impl DerefMut for IntRegisters {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct FloatRegisters {
|
||||
pub fcw: u16,
|
||||
pub fsw: u16,
|
||||
@@ -129,7 +129,7 @@ impl DerefMut for FloatRegisters {
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[repr(packed)]
|
||||
#[repr(C, packed)]
|
||||
pub struct EnvRegisters {
|
||||
pub fsbase: u64,
|
||||
pub gsbase: u64,
|
||||
|
||||
+1
-6
@@ -4,17 +4,12 @@ use core::{mem::MaybeUninit, ptr};
|
||||
|
||||
use super::io::Io;
|
||||
|
||||
#[repr(packed)]
|
||||
#[repr(transparent)]
|
||||
pub struct Mmio<T> {
|
||||
value: MaybeUninit<T>,
|
||||
}
|
||||
|
||||
impl<T> Mmio<T> {
|
||||
/// Create a new Mmio without initializing
|
||||
#[deprecated = "unsound because it's possible to read even though it's uninitialized"]
|
||||
pub fn new() -> Self {
|
||||
unsafe { Self::uninit() }
|
||||
}
|
||||
pub unsafe fn zeroed() -> Self {
|
||||
Self {
|
||||
value: MaybeUninit::zeroed(),
|
||||
|
||||
Reference in New Issue
Block a user