]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.S
Move SmmDebug feature from ASM to C.
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / Ia32 / SmiEntry.S
index 6fcf41a677d6adef13b4247179b663a4d3aac2a9..fbaa0725f0bc8baf3633fc2bc2e36ac6be66f9ee 100644 (file)
@@ -24,7 +24,6 @@ ASM_GLOBAL  ASM_PFX(gcSmiHandlerSize)
 ASM_GLOBAL  ASM_PFX(gSmiCr3)\r
 ASM_GLOBAL  ASM_PFX(gSmiStack)\r
 ASM_GLOBAL  ASM_PFX(gSmbase)\r
-ASM_GLOBAL  ASM_PFX(FeaturePcdGet (PcdCpuSmmDebug))\r
 ASM_GLOBAL  ASM_PFX(FeaturePcdGet (PcdCpuSmmStackGuard))\r
 ASM_GLOBAL  ASM_PFX(gSmiHandlerIdtr)\r
 \r
@@ -148,43 +147,22 @@ L5:
 #   jmp     _SmiHandler                 # instruction is not needed\r
 \r
 _SmiHandler:\r
-    cmpb    $0, ASM_PFX(FeaturePcdGet (PcdCpuSmmDebug))\r
-    jz      L3\r
-\r
-L6:\r
-    call    L1\r
-L1:\r
-    popl    %ebp\r
-    movl    $0x80000001, %eax\r
-    cpuid\r
-    btl     $29, %edx                   # check cpuid to identify X64 or IA32\r
-    leal    (0x7fc8 - (L1 - _SmiEntryPoint))(%ebp), %edi\r
-    leal    4(%edi), %esi\r
-    jnc     L2\r
-    addl    $4, %esi\r
-L2:\r
-    movl    (%esi), %ecx\r
-    movl    (%edi), %edx\r
-L7:\r
-    movl    %ecx, %dr6\r
-    movl    %edx, %dr7                  # restore DR6 & DR7 before running C code\r
-L3:\r
-\r
-    pushl   (%esp)\r
+    movl    (%esp), %ebx\r
 \r
+    pushl   %ebx\r
+    movl    $ASM_PFX(CpuSmmDebugEntry), %eax\r
+    call    *%eax\r
+    popl    %ecx\r
+    \r
+    pushl   %ebx\r
     movl    $ASM_PFX(SmiRendezvous), %eax\r
     call    *%eax\r
     popl    %ecx\r
 \r
-\r
-    cmpb    $0, ASM_PFX(FeaturePcdGet (PcdCpuSmmDebug))\r
-    jz      L4\r
-\r
-    movl    %dr6, %ecx\r
-    movl    %dr7, %edx\r
-    movl    %ecx, (%esi)\r
-    movl    %edx, (%edi)\r
-L4:\r
+    pushl   %ebx\r
+    movl    $ASM_PFX(CpuSmmDebugExit), %eax\r
+    call    *%eax\r
+    popl    %ecx\r
 \r
     rsm\r
 \r