mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: use C ABI-qualification for packed structures
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -44,7 +44,7 @@ pub const ACPI_APIC_GENERIC_REDISTRIBUTOR: u8 = 14;
|
|||||||
pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15;
|
pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct PciRangeEntry {
|
struct PciRangeEntry {
|
||||||
pub base_address: u64,
|
pub base_address: u64,
|
||||||
@@ -55,7 +55,7 @@ struct PciRangeEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct MemoryAffinity {
|
struct MemoryAffinity {
|
||||||
pub type_: u8,
|
pub type_: u8,
|
||||||
@@ -72,7 +72,7 @@ struct MemoryAffinity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct ProcessorLocalX2ApicAffinity {
|
struct ProcessorLocalX2ApicAffinity {
|
||||||
pub type_: u8,
|
pub type_: u8,
|
||||||
@@ -86,7 +86,7 @@ struct ProcessorLocalX2ApicAffinity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct ProcessorGiccAffinity {
|
struct ProcessorGiccAffinity {
|
||||||
pub type_: u8,
|
pub type_: u8,
|
||||||
@@ -146,7 +146,7 @@ impl MemoryAffinity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct ViotVirtioPciNode {
|
struct ViotVirtioPciNode {
|
||||||
pub type_: u8,
|
pub type_: u8,
|
||||||
@@ -158,7 +158,7 @@ struct ViotVirtioPciNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct ViotPciRangeNode {
|
struct ViotPciRangeNode {
|
||||||
pub type_: u8,
|
pub type_: u8,
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ pub type Result<T> = result::Result<T, Error>;
|
|||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct LocalX2Apic {
|
struct LocalX2Apic {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -217,7 +217,7 @@ struct LocalX2Apic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct Ioapic {
|
struct Ioapic {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -230,7 +230,7 @@ struct Ioapic {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct GicC {
|
struct GicC {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -255,7 +255,7 @@ struct GicC {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct GicD {
|
struct GicD {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -270,7 +270,7 @@ struct GicD {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct GicR {
|
struct GicR {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -282,7 +282,7 @@ struct GicR {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct GicIts {
|
struct GicIts {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -295,7 +295,7 @@ struct GicIts {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(AsBytes)]
|
#[derive(AsBytes)]
|
||||||
struct ProcessorHierarchyNode {
|
struct ProcessorHierarchyNode {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
@@ -308,7 +308,7 @@ struct ProcessorHierarchyNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Default, AsBytes)]
|
#[derive(Default, AsBytes)]
|
||||||
struct InterruptSourceOverride {
|
struct InterruptSourceOverride {
|
||||||
pub r#type: u8,
|
pub r#type: u8,
|
||||||
|
|||||||
Reference in New Issue
Block a user