Skip to content

Commit c430f08

Browse files
timrobertsdevnicholasbishop
authored andcommitted
Support ISA-specific MemoryAttributes in MemoryDescriptors
1 parent 98f80dd commit c430f08

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
slice.
1111
- Added `DeviceSubType::MESSAGING_REST_SERVICE` and
1212
`DeviceSubType::MESSAGING_NVME_OF_NAMESPACE`.
13+
- Added `MemoryAttribute::SPECIAL_PURPOSE`, `MemoryAttribute::CPU_CRYPTO`,
14+
`MemoryAttribute::ISA_VALID`, and `MemoryAttribute::ISA_MASK`.
1315

1416
### Changed
1517

src/table/boot.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,8 +1648,26 @@ bitflags! {
16481648
const MORE_RELIABLE = 0x10000;
16491649
/// This memory range can be set as read-only.
16501650
const READ_ONLY = 0x20000;
1651+
/// This memory is earmarked for specific purposes such as for specific
1652+
/// device drivers or applications. This serves as a hint to the OS to
1653+
/// avoid this memory for core OS data or code that cannot be relocated.
1654+
const SPECIAL_PURPOSE = 0x4_0000;
1655+
/// This memory region is capable of being protected with the CPU's memory
1656+
/// cryptography capabilities.
1657+
const CPU_CRYPTO = 0x8_0000;
16511658
/// This memory must be mapped by the OS when a runtime service is called.
16521659
const RUNTIME = 0x8000_0000_0000_0000;
1660+
/// This memory region is described with additional ISA-specific memory
1661+
/// attributes as specified in `MemoryAttribute::ISA_MASK`.
1662+
const ISA_VALID = 0x4000_0000_0000_0000;
1663+
/// These bits are reserved for describing optional ISA-specific cache-
1664+
/// ability attributes that are not covered by the standard UEFI Memory
1665+
/// Attribute cacheability bits such as `UNCACHEABLE`, `WRITE_COMBINE`,
1666+
/// `WRITE_THROUGH`, `WRITE_BACK`, and `UNCACHEABLE_EXPORTED`.
1667+
///
1668+
/// See Section 2.3 "Calling Conventions" in the UEFI Specification
1669+
/// for further information on each ISA that takes advantage of this.
1670+
const ISA_MASK = 0x0FFF_F000_0000_0000;
16531671
}
16541672
}
16551673

0 commit comments

Comments
 (0)