Skip to content

Commit e8f3e73

Browse files
committed
multiboot2: Get a mutable reference to the basic memory information tag
1 parent 1971bc9 commit e8f3e73

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

multiboot2/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ impl BootInformation {
236236
.map(|tag| unsafe { &*(tag as *const Tag as *const BasicMemoryInfoTag) })
237237
}
238238

239+
/// Search for the basic memory info tag, return a mutable reference.
240+
pub fn basic_memory_info_tag_mut(&mut self) -> Option<&mut BasicMemoryInfoTag> {
241+
self.get_tag(TagType::BasicMeminfo)
242+
.map(|tag| unsafe { &mut *(tag as *const Tag as *mut BasicMemoryInfoTag) })
243+
}
244+
239245
/// Search for the ELF Sections tag.
240246
pub fn elf_sections_tag(&self) -> Option<&ElfSectionsTag> {
241247
self.get_tag(TagType::ElfSections)

0 commit comments

Comments
 (0)