解决了#DE会触发#UD的问题

This commit is contained in:
fslongjin
2022-04-10 23:03:16 +08:00
parent f5f36aafd8
commit d78db8225c
6 changed files with 119 additions and 109 deletions

View File

@ -1,6 +1,6 @@
#include"../common/asm.h"
.code64
.section .text
//.section .text
R15 = 0x00
R14 = 0x08
@ -56,7 +56,7 @@ Restore_all:
ret_from_exception:
// === ===
.code64
ENTRY(ret_from_intr)
jmp Restore_all
@ -64,28 +64,27 @@ ENTRY(ret_from_intr)
Err_Code:
// =====
pushq %rax
movq %es, %rax
pushq %rax
movq %ds, %rax
pushq %rax
pushq %rax
movq %es, %rax
pushq %rax
movq %ds, %rax
pushq %rax
xorq %rax, %rax
xorq %rax, %rax
pushq %rbp
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rbx
pushq %r8
pushq %r9
pushq %r10
pushq %r11
pushq %r12
pushq %r13
pushq %r14
pushq %r15
pushq %rbp
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rbx
pushq %r8
pushq %r9
pushq %r10
pushq %r11
pushq %r12
pushq %r13
pushq %r14
pushq %r15
cld
@ -99,7 +98,7 @@ Err_Code:
movq %rsp, %rdi // rdi
callq %rdx // *
callq *%rdx // *
jmp ret_from_exception
//
@ -181,6 +180,7 @@ ENTRY(divide_error)
pushq $0 //#DE0
pushq %rax // rax
leaq do_divide_error(%rip), %rax //
xchgq %rax, (%rsp) // FUNC
jmp Err_Code