Skip to content

Commit 667e57f

Browse files
committed
Preserve RUNTIME_SERVICES_* memory regions
As required by the UEFI standart.
1 parent c274be7 commit 667e57f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

uefi/src/memory_descriptor.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ impl<'a> LegacyMemoryRegion for UefiMemoryDescriptor {
3030
MemoryType::LOADER_CODE
3131
| MemoryType::LOADER_DATA
3232
| MemoryType::BOOT_SERVICES_CODE
33-
| MemoryType::BOOT_SERVICES_DATA
34-
| MemoryType::RUNTIME_SERVICES_CODE
35-
| MemoryType::RUNTIME_SERVICES_DATA => {
33+
| MemoryType::BOOT_SERVICES_DATA => {
3634
// we don't need this data anymore after the bootloader
3735
// passes control to the kernel
3836
true
3937
}
38+
MemoryType::RUNTIME_SERVICES_CODE | MemoryType::RUNTIME_SERVICES_DATA => {
39+
// the UEFI standard specifies that these should be presevered
40+
// by the bootloader and operating system
41+
false
42+
}
4043
_ => false,
4144
}
4245
}

0 commit comments

Comments
 (0)