@@ -77,8 +77,8 @@ pub use end::EndTag;
77
77
pub use framebuffer:: { FramebufferColor , FramebufferField , FramebufferTag , FramebufferType } ;
78
78
pub use image_load_addr:: ImageLoadPhysAddrTag ;
79
79
pub use memory_map:: {
80
- BasicMemoryInfoTag , EFIMemoryAreaType , EFIMemoryDesc , EFIMemoryMapTag , MemoryArea ,
81
- MemoryAreaType , MemoryAreaTypeId , MemoryMapTag ,
80
+ BasicMemoryInfoTag , EFIMemoryAreaType , EFIMemoryAttribute , EFIMemoryDesc , EFIMemoryMapTag ,
81
+ MemoryArea , MemoryAreaType , MemoryAreaTypeId , MemoryMapTag ,
82
82
} ;
83
83
pub use module:: { ModuleIter , ModuleTag } ;
84
84
pub use ptr_meta:: Pointee ;
@@ -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
}
@@ -1450,15 +1453,15 @@ mod tests {
1450
1453
#[ cfg_attr( miri, ignore) ]
1451
1454
fn efi_memory_map ( ) {
1452
1455
#[ repr( C , align( 8 ) ) ]
1453
- struct Bytes ( [ u8 ; 72 ] ) ;
1456
+ struct Bytes ( [ u8 ; 80 ] ) ;
1454
1457
// test that the EFI memory map is detected.
1455
1458
let bytes: Bytes = Bytes ( [
1456
- 72 , 0 , 0 , 0 , // size
1459
+ 80 , 0 , 0 , 0 , // size
1457
1460
0 , 0 , 0 , 0 , // reserved
1458
1461
17 , 0 , 0 , 0 , // EFI memory map type
1459
- 56 , 0 , 0 , 0 , // EFI memory map size
1462
+ 64 , 0 , 0 , 0 , // EFI memory map size
1460
1463
48 , 0 , 0 , 0 , // EFI descriptor size
1461
- 1 , 0 , 0 , 0 , // EFI descriptor version, don't think this matters.
1464
+ 1 , 0 , 0 , 0 , // EFI descriptor version
1462
1465
7 , 0 , 0 , 0 , // Type: EfiConventionalMemory
1463
1466
0 , 0 , 0 , 0 , // Padding
1464
1467
0 , 0 , 16 , 0 , // Physical Address: should be 0x100000
@@ -1469,6 +1472,8 @@ mod tests {
1469
1472
0 , 0 , 0 , 0 , // Extension of pages
1470
1473
0 , 0 , 0 , 0 , // Attributes of this memory range.
1471
1474
0 , 0 , 0 , 0 , // Extension of attributes
1475
+ 0 , 0 , 0 , 0 , // More padding to extend the efi mmap to `desc_size`.
1476
+ 0 , 0 , 0 , 0 , // padding/alignment for end tag
1472
1477
0 , 0 , 0 , 0 , // end tag type.
1473
1478
8 , 0 , 0 , 0 , // end tag size.
1474
1479
] ) ;
0 commit comments