Skip to content

Commit c83f36c

Browse files
committed
Add missing flags to PageFaultErrorCode
1 parent 27ab505 commit c83f36c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/structures/idt.rs

+19
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,10 @@ impl fmt::Debug for InterruptStackFrameValue {
890890

891891
bitflags! {
892892
/// Describes an page fault error code.
893+
///
894+
/// This structure is defined by the following manual sections:
895+
/// * AMD Volume 2: 8.4.2
896+
/// * Intel Volume 3A: 4.7
893897
#[repr(transparent)]
894898
pub struct PageFaultErrorCode: u64 {
895899
/// If this flag is set, the page fault was caused by a page-protection violation,
@@ -913,6 +917,21 @@ bitflags! {
913917
/// If this flag is set, it indicates that the access that caused the page fault was an
914918
/// instruction fetch.
915919
const INSTRUCTION_FETCH = 1 << 4;
920+
921+
/// If this flag is set, it indicates that the page fault was caused by a protection key.
922+
const PROTECTION_KEY = 1 << 5;
923+
924+
/// If this flag is set, it indicates that the page fault was caused by a shadow stack
925+
/// access.
926+
const SHADOW_STACK = 1 << 6;
927+
928+
/// If this flag is set, it indicates that the page fault was caused by SGX access-control
929+
/// requirements (Intel-only).
930+
const SGX = 1 << 15;
931+
932+
/// If this flag is set, it indicates that the page fault is a result of the processor
933+
/// encountering an RMP violation (AMD-only).
934+
const RMP = 1 << 31;
916935
}
917936
}
918937

0 commit comments

Comments
 (0)