mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Implemented zerocopy::AsBytes for SDT structures
For structures that are used in SDT ACPI tables it is necessary for them to implement this trait for the newly safe Std::write() API. Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
committed by
Rob Bradford
parent
0d58e51a3a
commit
71d1296d09
+6
-6
@@ -41,7 +41,7 @@ pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct PciRangeEntry {
|
||||
pub base_address: u64,
|
||||
pub segment: u16,
|
||||
@@ -52,7 +52,7 @@ struct PciRangeEntry {
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct MemoryAffinity {
|
||||
pub type_: u8,
|
||||
pub length: u8,
|
||||
@@ -69,7 +69,7 @@ struct MemoryAffinity {
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct ProcessorLocalX2ApicAffinity {
|
||||
pub type_: u8,
|
||||
pub length: u8,
|
||||
@@ -83,7 +83,7 @@ struct ProcessorLocalX2ApicAffinity {
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct ProcessorGiccAffinity {
|
||||
pub type_: u8,
|
||||
pub length: u8,
|
||||
@@ -143,7 +143,7 @@ impl MemoryAffinity {
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct ViotVirtioPciNode {
|
||||
pub type_: u8,
|
||||
_reserved: u8,
|
||||
@@ -155,7 +155,7 @@ struct ViotVirtioPciNode {
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(packed)]
|
||||
#[derive(Default)]
|
||||
#[derive(Default, AsBytes)]
|
||||
struct ViotPciRangeNode {
|
||||
pub type_: u8,
|
||||
_reserved: u8,
|
||||
|
||||
Reference in New Issue
Block a user