summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DebugSupportDxe/X64
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/DebugSupportDxe/X64')
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S33
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm2
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c6
3 files changed, 20 insertions, 21 deletions
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S
index 864b6e4..7ac8a1a 100644
--- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S
+++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S
@@ -14,7 +14,6 @@
.intel_syntax noprefix
-
.globl ASM_PFX(OrigVector)
.globl ASM_PFX(InterruptEntryStub)
.globl ASM_PFX(StubSize)
@@ -146,8 +145,6 @@ ASM_PFX(InterruptEntryStub):
.globl ASM_PFX(InterruptEntryStubEnd)
ASM_PFX(InterruptEntryStubEnd):
- ret
-
#------------------------------------------------------------------------------
# CommonIdtEntry
#
@@ -199,9 +196,6 @@ ASM_PFX(InterruptEntryStubEnd):
## UINT64 R8, R9, R10, R11, R12, R13, R14, R15;
## } SYSTEM_CONTEXT_X64; // 64
ASM_PFX(CommonIdtEntry):
-
- ret
-
## NOTE: we save rsp here to prevent compiler put rip reference cause error AppRsp
push rax
mov rax, qword ptr [rsp][8] # save vector number
@@ -274,9 +268,10 @@ ExtraPushDone:
mov rax, ASM_PFX(AppRsp)
add rax, 40
# application stack has ss, rsp, rflags, cs, & rip, so
- # last actual application stack entry is
- # 40 bytes into the application stack.
+ # last actual application stack entry is 40 bytes
+ # into the application stack.
mov [rsp + 24], rax
+
## continue building context record
## UINT64 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero
mov rax, ss
@@ -361,14 +356,14 @@ ExtraPushDone:
# IMPORTANT!! The debug stack has been carefully constructed to
# insure that rsp and rdi are 16 byte aligned when we get here.
# They MUST be. If they are not, a GP fault will occur.
- # FXSTOR_RDI
- .byte 0x0f
- .byte 0xae
- .byte 0x07
+
+ # FXSTOR_RDI
+ fxsave [rdi]
## UINT64 ExceptionData;
mov rax, ASM_PFX(ExceptData)
push rax
+
# call to C code which will in turn call registered handler
# pass in the vector number
mov rdx, rsp
@@ -379,14 +374,16 @@ ExtraPushDone:
# restore context...
## UINT64 ExceptionData;
add rsp, 8
+
## FX_SAVE_STATE_X64 FxSaveState;
mov rsi, rsp
- # FXRSTOR_RSI
- .byte 0x0f
- .byte 0xae
- .byte 0x0e
+
+ # FXRSTOR_RSI
+ fxrstor [rsi]
+
add rsp, 512
-;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
+
+## UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
pop rax
mov dr0, rax
pop rax
@@ -395,10 +392,12 @@ ExtraPushDone:
mov dr2, rax
pop rax
mov dr3, rax
+
## skip restore of dr6. We cleared dr6 during the context save.
add rsp, 8
pop rax
mov dr7, rax
+
## UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;
pop rax
mov cr0, rax
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm
index d9ba0be..6b04706 100644
--- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm
+++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm
@@ -1,7 +1,7 @@
;/** @file
; Low level x64 routines used by the debug support driver.
;
-; Copyright (c) 2007 - 2008, Intel Corporation. <BR>
+; Copyright (c) 2007 - 2008, Intel Corporation.
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c b/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c
index d6173bb..3143baf 100644
--- a/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c
+++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c
@@ -1,7 +1,7 @@
/** @file
- X64 specific debug support functions
+ X64 specific functions to support Debug Support protocol.
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -103,7 +103,7 @@ CreateEntryStub (
**/
EFI_STATUS
ManageIdtEntryTable (
- VOID (*NewCallback)(),
+ VOID (*NewCallback)(),
EFI_EXCEPTION_TYPE ExceptionType
)
{