File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 17
17
- Re-exported ` CapsuleFlags ` .
18
18
- One can now specify in ` TimeError ` what fields of ` Time ` are outside its valid
19
19
range. ` Time::is_valid ` has been updated accordingly.
20
+ - ` MemoryMap::as_raw ` which provides raw access to the memory map. This is for
21
+ example useful if you create your own Multiboot2 bootloader that embeds the
22
+ EFI mmap in a Multiboot2 boot information structure.
20
23
21
24
## Changed
22
25
- ` SystemTable::exit_boot_services ` is now ` unsafe ` . See that method's
Original file line number Diff line number Diff line change @@ -1729,6 +1729,12 @@ impl MemoryMapBackingMemory {
1729
1729
self . 0 . as_ptr ( ) . cast ( )
1730
1730
}
1731
1731
1732
+ /// Returns a slice to the underlying memory.
1733
+ #[ must_use]
1734
+ pub fn as_slice ( & self ) -> & [ u8 ] {
1735
+ unsafe { self . 0 . as_ref ( ) }
1736
+ }
1737
+
1732
1738
/// Returns a mutable slice to the underlying memory.
1733
1739
#[ must_use]
1734
1740
pub fn as_mut_slice ( & mut self ) -> & mut [ u8 ] {
@@ -1972,6 +1978,15 @@ impl MemoryMap {
1972
1978
1973
1979
Some ( desc)
1974
1980
}
1981
+
1982
+ /// Provides access to the raw memory map.
1983
+ ///
1984
+ /// This is for example useful if you want to embed the memory map into
1985
+ /// another data structure, such as a Multiboot2 boot information.
1986
+ #[ must_use]
1987
+ pub fn as_raw ( & self ) -> ( & [ u8 ] , MemoryMapMeta ) {
1988
+ ( self . buf . as_slice ( ) , self . meta )
1989
+ }
1975
1990
}
1976
1991
1977
1992
impl core:: ops:: Index < usize > for MemoryMap {
You can’t perform that action at this time.
0 commit comments