File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 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 @@ -1742,6 +1742,12 @@ impl MemoryMapBackingMemory {
1742
1742
self . 0 . as_ptr ( ) . cast ( )
1743
1743
}
1744
1744
1745
+ /// Returns a slice to the underlying memory.
1746
+ #[ must_use]
1747
+ pub fn as_slice ( & self ) -> & [ u8 ] {
1748
+ unsafe { self . 0 . as_ref ( ) }
1749
+ }
1750
+
1745
1751
/// Returns a mutable slice to the underlying memory.
1746
1752
#[ must_use]
1747
1753
pub fn as_mut_slice ( & mut self ) -> & mut [ u8 ] {
@@ -1970,6 +1976,15 @@ impl MemoryMap {
1970
1976
1971
1977
Some ( desc)
1972
1978
}
1979
+
1980
+ /// Provides access to the raw memory map.
1981
+ ///
1982
+ /// This is for example useful if you want to embed the memory map into
1983
+ /// another data structure, such as a Multiboot2 boot information.
1984
+ #[ must_use]
1985
+ pub fn as_raw ( & self ) -> ( & [ u8 ] , MemoryMapMeta ) {
1986
+ ( self . buf . as_slice ( ) , self . meta )
1987
+ }
1973
1988
}
1974
1989
1975
1990
impl core:: ops:: Index < usize > for MemoryMap {
You can’t perform that action at this time.
0 commit comments