@@ -77,8 +77,8 @@ pub use end::EndTag;
7777pub use framebuffer:: { FramebufferColor , FramebufferField , FramebufferTag , FramebufferType } ;
7878pub use image_load_addr:: ImageLoadPhysAddrTag ;
7979pub use memory_map:: {
80- BasicMemoryInfoTag , EFIMemoryAreaType , EFIMemoryDesc , EFIMemoryMapTag , MemoryArea ,
81- MemoryAreaType , MemoryAreaTypeId , MemoryMapTag ,
80+ BasicMemoryInfoTag , EFIMemoryAreaType , EFIMemoryAttribute , EFIMemoryDesc , EFIMemoryMapTag ,
81+ MemoryArea , MemoryAreaType , MemoryAreaTypeId , MemoryMapTag ,
8282} ;
8383pub use module:: { ModuleIter , ModuleTag } ;
8484pub use ptr_meta:: Pointee ;
@@ -302,7 +302,10 @@ impl<'a> BootInformation<'a> {
302302 // If the EFIBootServicesNotExited is present, then we should not use
303303 // the memory map, as it could still be in use.
304304 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+ }
306309 None => self . get_tag :: < EFIMemoryMapTag > ( ) ,
307310 }
308311 }
@@ -1450,15 +1453,15 @@ mod tests {
14501453 #[ cfg_attr( miri, ignore) ]
14511454 fn efi_memory_map ( ) {
14521455 #[ repr( C , align( 8 ) ) ]
1453- struct Bytes ( [ u8 ; 72 ] ) ;
1456+ struct Bytes ( [ u8 ; 80 ] ) ;
14541457 // test that the EFI memory map is detected.
14551458 let bytes: Bytes = Bytes ( [
1456- 72 , 0 , 0 , 0 , // size
1459+ 80 , 0 , 0 , 0 , // size
14571460 0 , 0 , 0 , 0 , // reserved
14581461 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
14601463 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
14621465 7 , 0 , 0 , 0 , // Type: EfiConventionalMemory
14631466 0 , 0 , 0 , 0 , // Padding
14641467 0 , 0 , 16 , 0 , // Physical Address: should be 0x100000
@@ -1469,6 +1472,8 @@ mod tests {
14691472 0 , 0 , 0 , 0 , // Extension of pages
14701473 0 , 0 , 0 , 0 , // Attributes of this memory range.
14711474 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
14721477 0 , 0 , 0 , 0 , // end tag type.
14731478 8 , 0 , 0 , 0 , // end tag size.
14741479 ] ) ;
0 commit comments