@@ -302,7 +302,10 @@ impl<'a> BootInformation<'a> {
302
302
// If the EFIBootServicesNotExited is present, then we should not use
303
303
// the memory map, as it could still be in use.
304
304
match self . get_tag :: < EFIBootServicesNotExitedTag > ( ) {
305
- Some ( _tag) => None ,
305
+ Some ( _tag) => {
306
+ log:: debug!( "The EFI memory map is present but the UEFI Boot Services Not Existed Tag is present. Returning None." ) ;
307
+ None
308
+ }
306
309
None => self . get_tag :: < EFIMemoryMapTag > ( ) ,
307
310
}
308
311
}
@@ -1447,18 +1450,17 @@ mod tests {
1447
1450
}
1448
1451
1449
1452
#[ test]
1450
- #[ cfg_attr( miri, ignore) ]
1451
1453
fn efi_memory_map ( ) {
1452
1454
#[ repr( C , align( 8 ) ) ]
1453
- struct Bytes ( [ u8 ; 72 ] ) ;
1455
+ struct Bytes ( [ u8 ; 80 ] ) ;
1454
1456
// test that the EFI memory map is detected.
1455
1457
let bytes: Bytes = Bytes ( [
1456
- 72 , 0 , 0 , 0 , // size
1458
+ 80 , 0 , 0 , 0 , // size
1457
1459
0 , 0 , 0 , 0 , // reserved
1458
1460
17 , 0 , 0 , 0 , // EFI memory map type
1459
- 56 , 0 , 0 , 0 , // EFI memory map size
1461
+ 64 , 0 , 0 , 0 , // EFI memory map size
1460
1462
48 , 0 , 0 , 0 , // EFI descriptor size
1461
- 1 , 0 , 0 , 0 , // EFI descriptor version, don't think this matters.
1463
+ 1 , 0 , 0 , 0 , // EFI descriptor version
1462
1464
7 , 0 , 0 , 0 , // Type: EfiConventionalMemory
1463
1465
0 , 0 , 0 , 0 , // Padding
1464
1466
0 , 0 , 16 , 0 , // Physical Address: should be 0x100000
@@ -1469,6 +1471,8 @@ mod tests {
1469
1471
0 , 0 , 0 , 0 , // Extension of pages
1470
1472
0 , 0 , 0 , 0 , // Attributes of this memory range.
1471
1473
0 , 0 , 0 , 0 , // Extension of attributes
1474
+ 0 , 0 , 0 , 0 , // More padding to extend the efi mmap to `desc_size`.
1475
+ 0 , 0 , 0 , 0 , // padding/alignment for end tag
1472
1476
0 , 0 , 0 , 0 , // end tag type.
1473
1477
8 , 0 , 0 , 0 , // end tag size.
1474
1478
] ) ;
0 commit comments