@@ -194,8 +194,8 @@ impl SystemTable<Boot> {
194
194
/// restricted `SystemTable<Runtime>` view as an output.
195
195
///
196
196
/// The memory map at the time of exiting boot services is also
197
- /// returned. The map is backed by a [`MemoryType::LOADER_DATA`]
198
- /// allocation. Since the boot services function to free that memory is no
197
+ /// returned. The map is backed by a allocation with given `memory_type`.
198
+ /// Since the boot services function to free that memory is no
199
199
/// longer available after calling `exit_boot_services`, the allocation is
200
200
/// live until the program ends. The lifetime of the memory map is therefore
201
201
/// `'static`.
@@ -221,7 +221,10 @@ impl SystemTable<Boot> {
221
221
/// [`Logger::disable`]: crate::logger::Logger::disable
222
222
/// [`uefi_services::init`]: https://docs.rs/uefi-services/latest/uefi_services/fn.init.html
223
223
#[ must_use]
224
- pub fn exit_boot_services ( self ) -> ( SystemTable < Runtime > , MemoryMap < ' static > ) {
224
+ pub fn exit_boot_services (
225
+ self ,
226
+ memory_type : MemoryType ,
227
+ ) -> ( SystemTable < Runtime > , MemoryMap < ' static > ) {
225
228
let boot_services = self . boot_services ( ) ;
226
229
227
230
// Reboot the device.
@@ -236,7 +239,7 @@ impl SystemTable<Boot> {
236
239
237
240
// Allocate a byte slice to hold the memory map. If the
238
241
// allocation fails treat it as an unrecoverable error.
239
- let buf: * mut u8 = match boot_services. allocate_pool ( MemoryType :: LOADER_DATA , buf_size) {
242
+ let buf: * mut u8 = match boot_services. allocate_pool ( memory_type , buf_size) {
240
243
Ok ( buf) => buf,
241
244
Err ( err) => reset ( err. status ( ) ) ,
242
245
} ;
0 commit comments