Skip to content

Commit

Permalink
x86_64: Use 0x516 as magic signal return address
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jan 21, 2024
1 parent d392600 commit 231f708
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kernel/arch/x86_64/idt.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ static void _page_fault(struct regs * r) {
uintptr_t faulting_address;
asm volatile("mov %%cr2, %0" : "=r"(faulting_address));

/* 8DEADBEEFh is the magic ret-from-sig address. */
if (faulting_address == 0x8DEADBEEF) {
/* magic ret-from-sig address */
if (faulting_address == 0x516) {
return_from_signal_handler(r);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/arch/x86_64/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void arch_enter_signal_handler(uintptr_t entrypoint, int signum, struct regs *r)
PUSH(ret.rsp, uint64_t, this_core->current_process->thread.fp_regs[i]);
}

PUSH(ret.rsp, uintptr_t, 0x00000008DEADBEEF);
PUSH(ret.rsp, uintptr_t, 0x516);

update_process_times_on_exit();

Expand Down

0 comments on commit 231f708

Please sign in to comment.