diff --git a/rmm b/rmm index ea4cfb2cbf..5f9a587968 160000 --- a/rmm +++ b/rmm @@ -1 +1 @@ -Subproject commit ea4cfb2cbffafe5b268607a00ad3d51a6fc0617d +Subproject commit 5f9a587968fc914c0dacd45c4a89a8a72c074cde diff --git a/src/acpi/hpet.rs b/src/acpi/hpet.rs index 9931f3e29c..dce60a732e 100644 --- a/src/acpi/hpet.rs +++ b/src/acpi/hpet.rs @@ -9,7 +9,7 @@ use crate::{ use super::{find_sdt, sdt::Sdt, ACPI_TABLE}; -#[repr(packed)] +#[repr(C, packed)] #[derive(Clone, Copy, Debug, Default)] pub struct GenericAddressStructure { _address_space: u8, @@ -19,7 +19,7 @@ pub struct GenericAddressStructure { pub address: u64, } -#[repr(packed)] +#[repr(C, packed)] #[derive(Clone, Copy, Debug)] pub struct Hpet { pub header: Sdt, diff --git a/src/acpi/madt.rs b/src/acpi/madt.rs index ab55f0ec46..785d82dc9d 100644 --- a/src/acpi/madt.rs +++ b/src/acpi/madt.rs @@ -221,7 +221,7 @@ impl Madt { /// MADT Local APIC #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct MadtLocalApic { /// Processor ID pub processor: u8, @@ -233,7 +233,7 @@ pub struct MadtLocalApic { /// MADT I/O APIC #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct MadtIoApic { /// I/O APIC ID pub id: u8, @@ -247,7 +247,7 @@ pub struct MadtIoApic { /// MADT Interrupt Source Override #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct MadtIntSrcOverride { /// Bus Source pub bus_source: u8, diff --git a/src/acpi/sdt.rs b/src/acpi/sdt.rs index d5d23aced1..6c7bd6cdc4 100644 --- a/src/acpi/sdt.rs +++ b/src/acpi/sdt.rs @@ -1,7 +1,7 @@ use core::mem; #[derive(Copy, Clone, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct Sdt { pub signature: [u8; 4], pub length: u32, diff --git a/src/arch/aarch64/interrupt/handler.rs b/src/arch/aarch64/interrupt/handler.rs index 97233e07ea..7083329589 100644 --- a/src/arch/aarch64/interrupt/handler.rs +++ b/src/arch/aarch64/interrupt/handler.rs @@ -1,7 +1,7 @@ use crate::syscall::IntRegisters; #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct ScratchRegisters { pub x0: usize, pub x1: usize, @@ -56,7 +56,7 @@ impl ScratchRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct PreservedRegisters { //TODO: is X30 a preserved register? pub x19: usize, @@ -91,7 +91,7 @@ impl PreservedRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct IretRegisters { // occurred // The exception vector disambiguates at which EL the interrupt @@ -111,7 +111,7 @@ impl IretRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct InterruptStack { pub iret: IretRegisters, pub scratch: ScratchRegisters, diff --git a/src/arch/aarch64/interrupt/syscall.rs b/src/arch/aarch64/interrupt/syscall.rs index d59e4d58c9..40bb7e1624 100644 --- a/src/arch/aarch64/interrupt/syscall.rs +++ b/src/arch/aarch64/interrupt/syscall.rs @@ -5,7 +5,7 @@ pub unsafe extern "C" fn do_exception_unhandled() {} pub unsafe extern "C" fn do_exception_synchronous() {} #[allow(dead_code)] -#[repr(packed)] +#[repr(C, packed)] pub struct SyscallStack { pub elr_el1: usize, pub padding: usize, diff --git a/src/arch/aarch64/rmm.rs b/src/arch/aarch64/rmm.rs index 7a741dda05..a8d09d8c3f 100644 --- a/src/arch/aarch64/rmm.rs +++ b/src/arch/aarch64/rmm.rs @@ -25,7 +25,7 @@ pub enum BootloaderMemoryKind { // Keep synced with OsMemoryEntry in bootloader #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct BootloaderMemoryEntry { pub base: u64, pub size: u64, diff --git a/src/arch/aarch64/start.rs b/src/arch/aarch64/start.rs index ab619a50cb..f21a684e62 100644 --- a/src/arch/aarch64/start.rs +++ b/src/arch/aarch64/start.rs @@ -22,7 +22,7 @@ pub static CPU_COUNT: AtomicU32 = AtomicU32::new(0); pub static AP_READY: AtomicBool = AtomicBool::new(false); static BSP_READY: AtomicBool = AtomicBool::new(false); -#[repr(packed)] +#[repr(C, packed)] pub struct KernelArgs { kernel_base: usize, kernel_size: usize, @@ -191,7 +191,7 @@ pub unsafe extern "C" fn kstart(args_ptr: *const KernelArgs) -> ! { crate::kmain(CPU_COUNT.load(Ordering::SeqCst), bootstrap); } -#[repr(packed)] +#[repr(C, packed)] #[allow(unused)] pub struct KernelArgsAp { cpu_id: u64, diff --git a/src/arch/x86/gdt.rs b/src/arch/x86/gdt.rs index c8511b6a79..d3be108a77 100644 --- a/src/arch/x86/gdt.rs +++ b/src/arch/x86/gdt.rs @@ -129,7 +129,7 @@ pub struct ProcessorControlRegion { pub _all_ones: u8, } -// NOTE: Despite not using #[repr(packed)], we do know that while there may be some padding +// NOTE: Despite not using #[repr(C, packed)], we do know that while there may be some padding // inserted before and after the TSS, the main TSS structure will remain intact. #[repr(C, align(16))] pub struct TssWrapper(pub TaskStateSegment); @@ -233,7 +233,7 @@ pub unsafe fn init_paging(stack_offset: usize, cpu_id: LogicalCpuId) { } #[derive(Copy, Clone, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct GdtEntry { pub limitl: u16, pub offsetl: u16, diff --git a/src/arch/x86/interrupt/handler.rs b/src/arch/x86/interrupt/handler.rs index ea0f7c0bd5..c8f3e27eed 100644 --- a/src/arch/x86/interrupt/handler.rs +++ b/src/arch/x86/interrupt/handler.rs @@ -5,7 +5,7 @@ use crate::{memory::ArchIntCtx, syscall::IntRegisters}; use super::super::flags::*; #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct ScratchRegisters { pub edx: usize, pub ecx: usize, @@ -21,7 +21,7 @@ impl ScratchRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct PreservedRegisters { pub ebp: usize, pub esi: usize, @@ -39,7 +39,7 @@ impl PreservedRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct IretRegisters { pub eip: usize, pub cs: usize, @@ -67,7 +67,7 @@ impl IretRegisters { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct InterruptStack { pub gs: usize, pub preserved: PreservedRegisters, @@ -177,7 +177,7 @@ impl InterruptStack { } #[derive(Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct InterruptErrorStack { pub code: usize, pub inner: InterruptStack, diff --git a/src/arch/x86/rmm.rs b/src/arch/x86/rmm.rs index 79cdec7ba1..b0ad69c8dc 100644 --- a/src/arch/x86/rmm.rs +++ b/src/arch/x86/rmm.rs @@ -25,7 +25,7 @@ pub enum BootloaderMemoryKind { // Keep synced with OsMemoryEntry in bootloader #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct BootloaderMemoryEntry { pub base: u64, pub size: u64, diff --git a/src/arch/x86/start.rs b/src/arch/x86/start.rs index 3a91671180..3654cb3932 100644 --- a/src/arch/x86/start.rs +++ b/src/arch/x86/start.rs @@ -31,7 +31,7 @@ pub static CPU_COUNT: AtomicU32 = AtomicU32::new(0); pub static AP_READY: AtomicBool = AtomicBool::new(false); static BSP_READY: AtomicBool = AtomicBool::new(false); -#[repr(packed)] +#[repr(C, packed)] pub struct KernelArgs { kernel_base: u64, kernel_size: u64, @@ -214,7 +214,7 @@ pub unsafe extern "C" fn kstart(args_ptr: *const KernelArgs) -> ! { crate::kmain(CPU_COUNT.load(Ordering::SeqCst), bootstrap); } -#[repr(packed)] +#[repr(C, packed)] pub struct KernelArgsAp { cpu_id: u64, page_table: u64, diff --git a/src/arch/x86_64/gdt.rs b/src/arch/x86_64/gdt.rs index 0b24d6617e..bb5482f9ba 100644 --- a/src/arch/x86_64/gdt.rs +++ b/src/arch/x86_64/gdt.rs @@ -266,7 +266,7 @@ pub unsafe fn init_paging(stack_offset: usize, cpu_id: LogicalCpuId) { crate::percpu::init_tlb_shootdown(cpu_id, &mut pcr.percpu); } #[derive(Copy, Clone, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct GdtEntry { pub limitl: u16, pub offsetl: u16, diff --git a/src/arch/x86_64/rmm.rs b/src/arch/x86_64/rmm.rs index 503fc273ae..372b49dd78 100644 --- a/src/arch/x86_64/rmm.rs +++ b/src/arch/x86_64/rmm.rs @@ -24,7 +24,7 @@ pub enum BootloaderMemoryKind { // Keep synced with OsMemoryEntry in bootloader #[derive(Clone, Copy, Debug)] -#[repr(packed)] +#[repr(C, packed)] pub struct BootloaderMemoryEntry { pub base: u64, pub size: u64, diff --git a/src/arch/x86_64/start.rs b/src/arch/x86_64/start.rs index c3ab2218f6..b5f48f8f7b 100644 --- a/src/arch/x86_64/start.rs +++ b/src/arch/x86_64/start.rs @@ -33,7 +33,7 @@ pub static CPU_COUNT: AtomicU32 = AtomicU32::new(0); pub static AP_READY: AtomicBool = AtomicBool::new(false); static BSP_READY: AtomicBool = AtomicBool::new(false); -#[repr(packed)] +#[repr(C, packed)] pub struct KernelArgs { kernel_base: u64, kernel_size: u64, @@ -225,7 +225,7 @@ pub unsafe extern "C" fn kstart(args_ptr: *const KernelArgs) -> ! { crate::kmain(CPU_COUNT.load(Ordering::SeqCst), bootstrap); } -#[repr(packed)] +#[repr(C, packed)] pub struct KernelArgsAp { // TODO: u32? cpu_id: u64, diff --git a/src/arch/x86_shared/device/tsc.rs b/src/arch/x86_shared/device/tsc.rs index 602dd17aaf..d4ae8ec413 100644 --- a/src/arch/x86_shared/device/tsc.rs +++ b/src/arch/x86_shared/device/tsc.rs @@ -26,7 +26,7 @@ bitflags! { } // https://www.kernel.org/doc/html/v5.9/virt/kvm/msr.html -#[repr(packed)] +#[repr(C, packed)] #[derive(Clone, Copy, Debug)] struct PvclockVcpuTimeInfo { version: u32, diff --git a/src/arch/x86_shared/idt.rs b/src/arch/x86_shared/idt.rs index 99a260cbba..54bdb2ccc3 100644 --- a/src/arch/x86_shared/idt.rs +++ b/src/arch/x86_shared/idt.rs @@ -308,7 +308,7 @@ bitflags! { } #[derive(Copy, Clone, Debug, Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct IdtEntry { offsetl: u16, selector: u16, diff --git a/syscall b/syscall index 99f49db824..227f7fd487 160000 --- a/syscall +++ b/syscall @@ -1 +1 @@ -Subproject commit 99f49db8245c326295f10676832298d6f1e7ea2a +Subproject commit 227f7fd4873b17680957c75604cf4a5a674f5792