\r
.intel_syntax noprefix\r
\r
-\r
.globl ASM_PFX(OrigVector)\r
.globl ASM_PFX(InterruptEntryStub)\r
.globl ASM_PFX(StubSize)\r
.globl ASM_PFX(InterruptEntryStubEnd)\r
ASM_PFX(InterruptEntryStubEnd):\r
\r
- ret\r
-\r
#------------------------------------------------------------------------------\r
# CommonIdtEntry\r
#\r
## UINT64 R8, R9, R10, R11, R12, R13, R14, R15;\r
## } SYSTEM_CONTEXT_X64; // 64\r
ASM_PFX(CommonIdtEntry):\r
-\r
- ret\r
-\r
## NOTE: we save rsp here to prevent compiler put rip reference cause error AppRsp\r
push rax\r
mov rax, qword ptr [rsp][8] # save vector number\r
mov rax, ASM_PFX(AppRsp)\r
add rax, 40\r
# application stack has ss, rsp, rflags, cs, & rip, so\r
- # last actual application stack entry is\r
- # 40 bytes into the application stack.\r
+ # last actual application stack entry is 40 bytes\r
+ # into the application stack.\r
mov [rsp + 24], rax\r
+\r
## continue building context record\r
## UINT64 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero\r
mov rax, ss\r
## UINT64 Gdtr[2], Idtr[2];\r
push 0\r
push 0\r
- sidt qword ptr [rsp]\r
+ sidt [rsp]\r
push 0\r
push 0\r
- sgdt qword ptr [rsp]\r
+ sgdt [rsp]\r
\r
## UINT64 Ldtr, Tr;\r
xor rax, rax\r
# IMPORTANT!! The debug stack has been carefully constructed to\r
# insure that rsp and rdi are 16 byte aligned when we get here.\r
# They MUST be. If they are not, a GP fault will occur.\r
- # FXSTOR_RDI\r
- .byte 0x0f\r
- .byte 0xae\r
- .byte 0x07\r
+ \r
+ # FXSTOR_RDI\r
+ fxsave [rdi]\r
\r
## UINT64 ExceptionData;\r
mov rax, ASM_PFX(ExceptData)\r
push rax\r
+\r
# call to C code which will in turn call registered handler\r
# pass in the vector number\r
mov rdx, rsp\r
# restore context...\r
## UINT64 ExceptionData;\r
add rsp, 8\r
+\r
## FX_SAVE_STATE_X64 FxSaveState;\r
mov rsi, rsp\r
- # FXRSTOR_RSI\r
- .byte 0x0f\r
- .byte 0xae\r
- .byte 0x0e\r
+ \r
+ # FXRSTOR_RSI\r
+ fxrstor [rsi]\r
+\r
add rsp, 512\r
-;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
+\r
+## UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;\r
pop rax\r
mov dr0, rax\r
pop rax\r
mov dr2, rax\r
pop rax\r
mov dr3, rax\r
+\r
## skip restore of dr6. We cleared dr6 during the context save.\r
add rsp, 8\r
pop rax\r
mov dr7, rax\r
+\r
## UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;\r
pop rax\r
mov cr0, rax\r