mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 23:47:25 -04:00
Capture base pointer in fault handler
This commit is contained in:
parent
7f574e8117
commit
b4426249da
@ -16,6 +16,7 @@ constexpr const size_t SYSCALL_FIRST = 50;
|
||||
constexpr const size_t SYSCALL_MAX = 10;
|
||||
|
||||
struct fault_regs {
|
||||
uint64_t rbp;
|
||||
uint64_t error_no;
|
||||
uint64_t error_code;
|
||||
uint64_t rip;
|
||||
|
@ -13,6 +13,7 @@
|
||||
.global _isr\number
|
||||
_isr\number:
|
||||
push \number
|
||||
push rbp
|
||||
|
||||
jmp isr_common_handler
|
||||
.endm
|
||||
@ -24,6 +25,7 @@ _isr\number:
|
||||
|
||||
push 0 // Dummy error code
|
||||
push \number
|
||||
push rbp
|
||||
|
||||
jmp isr_common_handler
|
||||
.endm
|
||||
@ -69,6 +71,6 @@ isr_common_handler:
|
||||
// TODO At this point, it is absolutely not safe to return since most
|
||||
// registers will get trashed the fault handler must hang
|
||||
|
||||
add rsp, 8 // Cleans the pushed error number
|
||||
add rsp, 16 // Cleans the pushed base pointer and error number
|
||||
|
||||
iretq // iret will clean the other automatically pushed stuff
|
||||
|
Loading…
x
Reference in New Issue
Block a user