;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
; This program and the accompanying materials\r
; are licensed and made available under the terms and conditions of the BSD License\r
; which accompanies this distribution. The full text of the license may be found at\r
ASM_PFX(gSmmCr0): DD 0\r
mov cr0, rax ; enable protected mode & paging\r
DB 0x66, 0xea ; far jmp to long mode\r
-ASM_PFX(gSmmJmpAddr): DQ @LongMode\r
+ASM_PFX(gSmmJmpAddr): DQ 0;@LongMode\r
@LongMode: ; long-mode starts here\r
DB 0x48, 0xbc ; mov rsp, imm64\r
ASM_PFX(gSmmInitStack): DQ 0\r
sub ebp, 0x30000\r
jmp ebp\r
@L1:\r
- DQ ASM_PFX(SmmStartup)\r
+ DQ 0; ASM_PFX(SmmStartup)\r
\r
ASM_PFX(gcSmmInitSize): DW $ - ASM_PFX(gcSmmInitTemplate)\r
\r
;\r
db 0xff, 0x25\r
ASM_PFX(mSmmRelocationOriginalAddressPtr32): dd 0\r
+\r
+global ASM_PFX(PiSmmCpuSmmInitFixupAddress)\r
+ASM_PFX(PiSmmCpuSmmInitFixupAddress):\r
+ lea rax, [@LongMode]\r
+ lea rcx, [ASM_PFX(gSmmJmpAddr)]\r
+ mov qword [rcx], rax\r
+\r
+ lea rax, [ASM_PFX(SmmStartup)]\r
+ lea rcx, [@L1]\r
+ mov qword [rcx], rax\r
+ ret\r