8000 Get mutable references to the memory information by YtvwlD · Pull Request #140 · rust-osdev/multiboot2 · GitHub
[go: up one dir, main page]

Skip to content

Get mutable references to the memory information #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
multiboot2: Get a mutable reference to the basic memory information tag
  • Loading branch information
YtvwlD committed Apr 15, 2024
commit 42b30599a947e174cfa174da2db22cfc6a9df2e0
5 changes: 5 additions & 0 deletions multiboot2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ impl<T: AsRef<BootInformationInner> + AsMut<BootInformationInner>> BootInformati
self.get_tag_mut::<MemoryMapTag, _>(TagType::Mmap)
}

/// Search for the basic memory info tag, return a mutable reference.
pub fn basic_memory_info_tag_mut(&mut self) -> Option<&mut BasicMemoryInfoTag> {
self.get_tag_mut::<BasicMemoryInfoTag, _>(TagType::BasicMeminfo)
}

fn get_tag_mut<TagT: TagTrait + ?Sized, TagType: Into<TagTypeId>>(
&mut self,
typ: TagType,
Expand Down
0