From 2c672a0568879d73e2c255ef931a4ababecb40b5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 16 Feb 2024 20:58:54 -0700 Subject: [PATCH] More fixes for 32-bit x86 --- virtio-core/src/spec/transport_pci.rs | 4 +++- xhcid/src/main.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/virtio-core/src/spec/transport_pci.rs b/virtio-core/src/spec/transport_pci.rs index e90b9ebb72..7ef8efa8ef 100644 --- a/virtio-core/src/spec/transport_pci.rs +++ b/virtio-core/src/spec/transport_pci.rs @@ -69,7 +69,7 @@ pub enum CfgType { const_assert_eq!(core::mem::size_of::(), 1); #[derive(Debug)] -#[repr(C, packed)] +#[repr(C)] pub struct CommonCfg { // About the whole device. /// The driver uses this to select which feature bits device_feature shows. @@ -152,6 +152,8 @@ pub struct CommonCfg { pub queue_reset: VolatileCell, } +//TODO: why does this fail on x86? +#[cfg(not(target_arch = "x86"))] const_assert_eq!(core::mem::size_of::(), 64); #[derive(Debug, Copy, Clone)] diff --git a/xhcid/src/main.rs b/xhcid/src/main.rs index 9e6a71d3b0..faf50300ec 100644 --- a/xhcid/src/main.rs +++ b/xhcid/src/main.rs @@ -12,7 +12,7 @@ use std::sync::{Arc, Mutex}; use std::env; use pcid_interface::{MsiSetFeatureInfo, PcidServerHandle, PciFeature, PciFeatureInfo, SetFeatureInfo}; -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(target_arch = "x86_64")] use pcid_interface::irq_helpers::allocate_single_interrupt_vector_for_msi; use pcid_interface::irq_helpers::read_bsp_apic_id; use pcid_interface::msi::MsixTableEntry;