]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Sec/X64/SecEntry.nasm
OvmfPkg Sec: Convert X64/SecEntry.asm to NASM
[mirror_edk2.git] / OvmfPkg / Sec / X64 / SecEntry.nasm
CommitLineData
49ba9447 1;------------------------------------------------------------------------------\r
2;*\r
7cb6b0e0 3;* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
56d7640a 4;* This program and the accompanying materials\r
49ba9447 5;* are licensed and made available under the terms and conditions of the BSD License\r
6;* which accompanies this distribution. The full text of the license may be found at\r
7;* http://opensource.org/licenses/bsd-license.php\r
8;*\r
9;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11;*\r
12;* CpuAsm.asm\r
13;*\r
14;* Abstract:\r
15;*\r
16;------------------------------------------------------------------------------\r
17\r
42a83e80 18#include <Base.h>\r
49ba9447 19\r
d8cfdb5f
JJ
20DEFAULT REL\r
21SECTION .text\r
49ba9447 22\r
d8cfdb5f 23extern ASM_PFX(SecCoreStartupWithStack)\r
49ba9447 24\r
25;\r
0913fadc 26; SecCore Entry Point\r
49ba9447 27;\r
0913fadc 28; Processor is in flat protected mode\r
49ba9447 29;\r
0913fadc 30; @param[in] RAX Initial value of the EAX register (BIST: Built-in Self Test)\r
31; @param[in] DI 'BP': boot-strap processor, or 'AP': application processor\r
32; @param[in] RBP Pointer to the start of the Boot Firmware Volume\r
49ba9447 33;\r
0913fadc 34; @return None This routine does not return\r
49ba9447 35;\r
d8cfdb5f
JJ
36global ASM_PFX(_ModuleEntryPoint)\r
37ASM_PFX(_ModuleEntryPoint):\r
49ba9447 38\r
39 ;\r
7cb6b0e0 40 ; Load temporary RAM stack based on PCDs\r
49ba9447 41 ;\r
d8cfdb5f 42 %define SEC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \\r
7cb6b0e0
JJ
43 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))\r
44 mov rsp, SEC_TOP_OF_STACK\r
49ba9447 45 nop\r
46\r
47 ;\r
48 ; Setup parameters and call SecCoreStartupWithStack\r
49 ; rcx: BootFirmwareVolumePtr\r
0913fadc 50 ; rdx: TopOfCurrentStack\r
49ba9447 51 ;\r
52 mov rcx, rbp\r
0913fadc 53 mov rdx, rsp\r
d8cfdb5f
JJ
54 sub rsp, 0x20\r
55 call ASM_PFX(SecCoreStartupWithStack)\r
49ba9447 56\r