]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S
fixed one bug to pass GCC.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / X64 / AsmFuncs.S
index 864b6e41127126ecb887763668bbfa90dd9df8d3..7c854c1c888ba9ea710836b02084f127f2d72a48 100644 (file)
@@ -14,7 +14,6 @@
 \r
 .intel_syntax noprefix\r
 \r
-\r
 .globl ASM_PFX(OrigVector)\r
 .globl ASM_PFX(InterruptEntryStub)\r
 .globl ASM_PFX(StubSize)\r
@@ -146,8 +145,6 @@ ASM_PFX(InterruptEntryStub):
 .globl ASM_PFX(InterruptEntryStubEnd)\r
 ASM_PFX(InterruptEntryStubEnd):\r
 \r
-        ret\r
-\r
 #------------------------------------------------------------------------------\r
 # CommonIdtEntry\r
 #\r
@@ -199,9 +196,6 @@ ASM_PFX(InterruptEntryStubEnd):
 ##   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
@@ -274,9 +268,10 @@ ExtraPushDone:
                 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
@@ -301,10 +296,10 @@ ExtraPushDone:
 ## 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
@@ -361,14 +356,14 @@ ExtraPushDone:
                 # 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
@@ -379,14 +374,16 @@ ExtraPushDone:
 # 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
@@ -395,10 +392,12 @@ ExtraPushDone:
                 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