Replace repr(packed) with repr(C, packed).

This commit is contained in:
4lDO2
2024-09-08 20:56:50 +02:00
parent 815ac3da4a
commit 652cdc7ef2
18 changed files with 32 additions and 32 deletions
+1 -1
Submodule rmm updated: ea4cfb2cbf...5f9a587968
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+1 -1
View File
@@ -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,
+4 -4
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+5 -5
View File
@@ -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,
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -308,7 +308,7 @@ bitflags! {
}
#[derive(Copy, Clone, Debug, Default)]
#[repr(packed)]
#[repr(C, packed)]
pub struct IdtEntry {
offsetl: u16,
selector: u16,
+1 -1
Submodule syscall updated: 99f49db824...227f7fd487