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