diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 2e1b36b2c..2f4382667 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -498,6 +498,7 @@ mod tests { let descs = [ MemoryDescriptor { ty: MemoryType::CONVENTIONAL, + _pad0: 0, phys_start: 0x1000, virt_start: 0x1000, page_count: 1, diff --git a/uefi/src/mem/memory_map/impl_.rs b/uefi/src/mem/memory_map/impl_.rs index 21814cae5..dfa3e2ab8 100644 --- a/uefi/src/mem/memory_map/impl_.rs +++ b/uefi/src/mem/memory_map/impl_.rs @@ -432,6 +432,7 @@ mod tests { const BASE_MMAP_UNSORTED: [MemoryDescriptor; 3] = [ MemoryDescriptor { ty: MemoryType::CONVENTIONAL, + _pad0: 0, phys_start: 0x3000, virt_start: 0x3000, page_count: 1, @@ -439,6 +440,7 @@ mod tests { }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, + _pad0: 0, phys_start: 0x2000, virt_start: 0x2000, page_count: 1, @@ -446,6 +448,7 @@ mod tests { }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, + _pad0: 0, phys_start: 0x1000, virt_start: 0x1000, page_count: 1, diff --git a/uefi/src/mem/memory_map/mod.rs b/uefi/src/mem/memory_map/mod.rs index 46cd82903..e454506f9 100644 --- a/uefi/src/mem/memory_map/mod.rs +++ b/uefi/src/mem/memory_map/mod.rs @@ -131,6 +131,7 @@ mod tests_mmap_artificial { const BASE: MemoryDescriptor = MemoryDescriptor { ty: TY, + _pad0: 0, phys_start: 0, virt_start: 0, page_count: 0, @@ -169,6 +170,7 @@ mod tests_mmap_artificial { const BASE: MemoryDescriptor = MemoryDescriptor { ty: TY, + _pad0: 0, phys_start: 0, virt_start: 0, page_count: 0, @@ -278,6 +280,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -288,6 +291,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::BOOT_SERVICES_DATA, @@ -298,6 +302,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -308,6 +313,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -318,6 +324,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::ACPI_NON_VOLATILE, @@ -328,6 +335,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -338,6 +346,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::ACPI_NON_VOLATILE, @@ -348,6 +357,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -358,6 +368,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::ACPI_NON_VOLATILE, @@ -368,6 +379,7 @@ mod tests_mmap_real { | MemoryAttribute::WRITE_COMBINE | MemoryAttribute::WRITE_THROUGH | MemoryAttribute::WRITE_BACK, + ..Default::default() }, ]; assert_eq!(entries.as_slice(), &expected); diff --git a/uefi/tests/memory_map.rs b/uefi/tests/memory_map.rs index 0d7be6191..c41cdd83f 100644 --- a/uefi/tests/memory_map.rs +++ b/uefi/tests/memory_map.rs @@ -12,6 +12,7 @@ fn parse_boot_information_efi_mmap() { virt_start: 0x3000, page_count: 1, att: MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -19,6 +20,7 @@ fn parse_boot_information_efi_mmap() { virt_start: 0x2000, page_count: 1, att: MemoryAttribute::WRITE_BACK, + ..Default::default() }, MemoryDescriptor { ty: MemoryType::CONVENTIONAL, @@ -26,6 +28,7 @@ fn parse_boot_information_efi_mmap() { virt_start: 0x1000, page_count: 1, att: MemoryAttribute::WRITE_BACK, + ..Default::default() }, ]; let map_size = mmap_source.len() * desc_size;