diff --git a/kernel/src/drivers/bus/virtio_mmio.rs b/kernel/src/drivers/bus/virtio_mmio.rs index a93ef35..b308994 100644 --- a/kernel/src/drivers/bus/virtio_mmio.rs +++ b/kernel/src/drivers/bus/virtio_mmio.rs @@ -13,7 +13,7 @@ use super::super::gpu::virtio_gpu; use super::super::net::virtio_net; // virtio 4.2.4 Legacy interface -#[repr(packed)] +#[repr(C)] #[derive(Debug)] pub struct VirtIOHeader { magic: ReadOnly, // 0x000 @@ -64,7 +64,7 @@ bitflags! { } } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] pub struct VirtIOVirtqueueDesc { pub addr: Volatile, @@ -81,7 +81,7 @@ bitflags! { } } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] pub struct VirtIOVirtqueueAvailableRing { pub flags: Volatile, @@ -90,14 +90,14 @@ pub struct VirtIOVirtqueueAvailableRing { used_event: Volatile } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] pub struct VirtIOVirtqueueUsedElem { id: Volatile, len: Volatile } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] pub struct VirtIOVirtqueueUsedRing { pub flags: Volatile, diff --git a/kernel/src/drivers/gpu/virtio_gpu.rs b/kernel/src/drivers/gpu/virtio_gpu.rs index 86ecb0a..3818f89 100644 --- a/kernel/src/drivers/gpu/virtio_gpu.rs +++ b/kernel/src/drivers/gpu/virtio_gpu.rs @@ -33,7 +33,7 @@ struct VirtIOGpu { rect: VirtIOGpuRect } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuConfig { events_read: ReadOnly, @@ -88,7 +88,7 @@ const VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID : u32 = 0x1202; const VIRTIO_GPU_FLAG_FENCE : u32 = 1 << 0; -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuCtrlHdr { hdr_type: u32, @@ -110,7 +110,7 @@ impl VirtIOGpuCtrlHdr { } } -#[repr(packed)] +#[repr(C)] #[derive(Debug, Copy, Clone, Default)] struct VirtIOGpuRect { x: u32, @@ -119,7 +119,7 @@ struct VirtIOGpuRect { height: u32 } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuRespDisplayInfo { header: VirtIOGpuCtrlHdr, @@ -130,7 +130,7 @@ struct VirtIOGpuRespDisplayInfo { const VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: u32 = 1; -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuResourceCreate2D { header: VirtIOGpuCtrlHdr, @@ -140,7 +140,7 @@ struct VirtIOGpuResourceCreate2D { height: u32 } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuResourceAttachBacking { header: VirtIOGpuCtrlHdr, @@ -151,7 +151,7 @@ struct VirtIOGpuResourceAttachBacking { padding: u32 } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuSetScanout { header: VirtIOGpuCtrlHdr, @@ -160,7 +160,7 @@ struct VirtIOGpuSetScanout { resource_id: u32 } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuTransferToHost2D { header: VirtIOGpuCtrlHdr, @@ -170,7 +170,7 @@ struct VirtIOGpuTransferToHost2D { padding: u32 } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIOGpuResourceFlush { header: VirtIOGpuCtrlHdr, diff --git a/kernel/src/drivers/net/virtio_net.rs b/kernel/src/drivers/net/virtio_net.rs index 595b6ab..d1c6049 100644 --- a/kernel/src/drivers/net/virtio_net.rs +++ b/kernel/src/drivers/net/virtio_net.rs @@ -272,7 +272,7 @@ bitflags! { } } -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIONetworkConfig { mac: [u8; 6], @@ -280,7 +280,7 @@ struct VirtIONetworkConfig { } // virtio 5.1.6 Device Operation -#[repr(packed)] +#[repr(C)] #[derive(Debug)] struct VirtIONetHeader { flags: Volatile,