ソースを参照

multiboot2: fix misleading doc of efi_memory_map_tag()

Philipp Schuster 2 年 前
コミット
b09c7df2d9
2 ファイル変更6 行追加1 行削除
  1. 2 0
      multiboot2/Changelog.md
  2. 4 1
      multiboot2/src/lib.rs

+ 2 - 0
multiboot2/Changelog.md

@@ -8,6 +8,8 @@
   `Option<Result<FramebufferTag, UnknownFramebufferType>>` instead of
   `Option<FramebufferTag>` which prevents a possible panic. If the `--unstable`
   feature is used, `UnknownFramebufferType` implements `core::error::Error`.
+- Fixed misleading documentation of the `BootInformation::efi_memory_map_tag`
+  tag.
 
 ## 0.14.2 (2023-03-17)
 - documentation fixes

+ 4 - 1
multiboot2/src/lib.rs

@@ -276,7 +276,10 @@ impl BootInformation {
             .map(|tag| unsafe { &*(tag as *const Tag as *const RsdpV2Tag) })
     }
 
-    /// Search for the EFI Memory map tag.
+    /// Search for the EFI Memory map tag, if the boot services were exited.
+    /// Otherwise, if the [`TagType::EfiBs`] tag is present, this returns `None`
+    /// as it is strictly recommended to get the memory map from the `uefi`
+    /// services.
     pub fn efi_memory_map_tag(&self) -> Option<&EFIMemoryMapTag> {
         // If the EFIBootServicesNotExited is present, then we should not use
         // the memory map, as it could still be in use.