Skip to content

Commit b4dc94a

Browse files
committed
fix(x86_64): exception handling
1 parent 0b1deb0 commit b4dc94a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/x86_64/trap.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.altmacro
44
.macro DEF_HANDLER, i
55
.Ltrap_handler_\i:
6-
.if \i == 8 || (\i >= 10 && \i <= 14) || \i == 17
6+
.if \i == 8 || (\i >= 10 && \i <= 14) || \i == 17 || \i == 21 || \i == 29 || \i == 30
77
# error code pushed by CPU
88
push \i # interrupt vector
99
jmp .Ltrap_common

src/x86_64/trap.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ fn err_code_to_flags(err_code: u64) -> Result<PageFaultFlags, u64> {
7070
let code = PageFaultErrorCode::from_bits_truncate(err_code);
7171
let reserved_bits = (PageFaultErrorCode::CAUSED_BY_WRITE
7272
| PageFaultErrorCode::USER_MODE
73-
| PageFaultErrorCode::INSTRUCTION_FETCH)
73+
| PageFaultErrorCode::INSTRUCTION_FETCH
74+
| PageFaultErrorCode::PROTECTION_VIOLATION)
7475
.complement();
7576
if code.intersects(reserved_bits) {
7677
Err(err_code)

0 commit comments

Comments
 (0)