CorebootModulePkg/SecCore: Adding NASM files in SecCore module
[mirror_edk2.git] / CorebootModulePkg / SecCore / Ia32 / SecEntry.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php.
8 ;
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ; Abstract:
13 ;
14 ; Entry point for the coreboot UEFI payload.
15 ;
16 ;------------------------------------------------------------------------------
17
18 SECTION .text
19
20 ; C Functions
21 extern ASM_PFX(SecStartup)
22
23 ; Pcds
24 extern ASM_PFX(PcdGet32 (PcdPayloadFdMemBase))
25
26 ;
27 ; SecCore Entry Point
28 ;
29 ; Processor is in flat protected mode
30 ;
31 ; @param[in] EAX Initial value of the EAX register (BIST: Built-in Self Test)
32 ; @param[in] DI 'BP': boot-strap processor, or 'AP': application processor
33 ; @param[in] EBP Pointer to the start of the Boot Firmware Volume
34 ;
35 ; @return None This routine does not return
36 ;
37 global ASM_PFX(_ModuleEntryPoint)
38 ASM_PFX(_ModuleEntryPoint):
39 ;
40 ; Disable all the interrupts
41 ;
42 cli
43 ;
44 ; Construct the temporary memory at 0x80000, length 0x10000
45 ;
46 mov esp, (BASE_512KB + SIZE_64KB)
47
48 ;
49 ; Pass BFV into the PEI Core
50 ;
51 push DWORD [ASM_PFX(PcdGet32 (PcdPayloadFdMemBase))]
52
53 ;
54 ; Pass stack base into the PEI Core
55 ;
56 push BASE_512KB
57
58 ;
59 ; Pass stack size into the PEI Core
60 ;
61 push SIZE_64KB
62
63 ;
64 ; Pass Control into the PEI Core
65 ;
66 call ASM_PFX(SecStartup)
67
68 ;
69 ; Should never return
70 ;
71 jmp $
72