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
# 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