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 11
11
- Added ` table::{set_system_table, system_table_boot, system_table_runtime} ` .
12
12
This provides an initial API for global tables that do not require passing
13
13
around a reference.
14
+ - ` MemoryMap::as_raw ` which provides raw access to the memory map. This is for
15
+ example useful if you create your own Multiboot2 bootloader that embeds the
16
+ EFI mmap in a Multiboot2 boot information structure.
14
17
15
18
## Changed
16
19
- ` SystemTable::exit_boot_services ` is now ` unsafe ` . See that method's
Original file line number Diff line number Diff line change @@ -1738,6 +1738,12 @@ impl MemoryMapBackingMemory {
1738
1738
self . 0 . as_ptr ( ) . cast ( )
1739
1739
}
1740
1740
1741
+ /// Returns a slice to the underlying memory.
1742
+ #[ must_use]
1743
+ pub fn as_slice ( & self ) -> & [ u8 ] {
1744
+ unsafe { self . 0 . as_ref ( ) }
1745
+ }
1746
+
1741
1747
/// Returns a mutable slice to the underlying memory.
1742
1748
#[ must_use]
1743
1749
pub fn as_mut_slice ( & mut self ) -> & mut [ u8 ] {
@@ -1966,6 +1972,15 @@ impl MemoryMap {
1966
1972
1967
1973
Some ( desc)
1968
1974
}
1975
+
1976
+ /// Provides access to the raw memory map.
1977
+ ///
1978
+ /// This is for example useful if you want to embed the memory map into
1979
+ /// another data structure, such as a Multiboot2 boot information.
1980
+ #[ must_use]
1981
+ pub fn as_raw ( & self ) -> ( & [ u8 ] , MemoryMapMeta ) {
1982
+ ( self . buf . as_slice ( ) , self . meta )
1983
+ }
1969
1984
}
1970
1985
1971
1986
impl core:: ops:: Index < usize > for MemoryMap {
You can’t perform that action at this time.
0 commit comments