Convert repr(packed) to repr(C, packed).

This is required by crates like bytemuck.
This commit is contained in:
4lDO2
2024-09-08 20:46:07 +02:00
parent 1d098c4e1d
commit 227f7fd487
5 changed files with 8 additions and 13 deletions
+2 -2
View File
@@ -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
View File
@@ -79,7 +79,7 @@ impl DerefMut for IntRegisters {
}
#[derive(Clone, Copy, Debug, Default)]
#[repr(packed)]
#[repr(C, packed)]
pub struct FloatRegisters {
//TODO
}
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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(),