vmm: use C ABI-qualification for packed structures

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2025-01-09 02:33:14 +00:00 committed by Rob Bradford
parent abb88cf47f
commit 703e0cab04
2 changed files with 14 additions and 14 deletions

View File

@ -44,7 +44,7 @@ pub const ACPI_APIC_GENERIC_REDISTRIBUTOR: u8 = 14;
pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15;
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct PciRangeEntry {
pub base_address: u64,
@ -55,7 +55,7 @@ struct PciRangeEntry {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct MemoryAffinity {
pub type_: u8,
@ -72,7 +72,7 @@ struct MemoryAffinity {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct ProcessorLocalX2ApicAffinity {
pub type_: u8,
@ -86,7 +86,7 @@ struct ProcessorLocalX2ApicAffinity {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct ProcessorGiccAffinity {
pub type_: u8,
@ -146,7 +146,7 @@ impl MemoryAffinity {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct ViotVirtioPciNode {
pub type_: u8,
@ -158,7 +158,7 @@ struct ViotVirtioPciNode {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct ViotPciRangeNode {
pub type_: u8,

View File

@ -205,7 +205,7 @@ pub type Result<T> = result::Result<T, Error>;
#[cfg(target_arch = "x86_64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct LocalX2Apic {
pub r#type: u8,
@ -217,7 +217,7 @@ struct LocalX2Apic {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct Ioapic {
pub r#type: u8,
@ -230,7 +230,7 @@ struct Ioapic {
#[cfg(target_arch = "aarch64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct GicC {
pub r#type: u8,
@ -255,7 +255,7 @@ struct GicC {
#[cfg(target_arch = "aarch64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct GicD {
pub r#type: u8,
@ -270,7 +270,7 @@ struct GicD {
#[cfg(target_arch = "aarch64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct GicR {
pub r#type: u8,
@ -282,7 +282,7 @@ struct GicR {
#[cfg(target_arch = "aarch64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct GicIts {
pub r#type: u8,
@ -295,7 +295,7 @@ struct GicIts {
#[cfg(target_arch = "aarch64")]
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(AsBytes)]
struct ProcessorHierarchyNode {
pub r#type: u8,
@ -308,7 +308,7 @@ struct ProcessorHierarchyNode {
}
#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
#[derive(Default, AsBytes)]
struct InterruptSourceOverride {
pub r#type: u8,