1 ;------------------------------------------------------------------------------
3 ; Main routine of the pre-SEC code up through the jump into SEC
5 ; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
6 ; This program and the accompanying materials
7 ; are licensed and made available under the terms and conditions of the BSD License
8 ; which accompanies this distribution. The full text of the license may be found at
9 ; http://opensource.org/licenses/bsd-license.php
11 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 ;------------------------------------------------------------------------------
20 ; Modified: EBX, ECX, EDX, EBP
22 ; @param[in,out] RAX/EAX Initial value of the EAX register
23 ; (BIST: Built-in Self Test)
24 ; @param[in,out] DI 'BP': boot-strap processor, or
25 ; 'AP': application processor
26 ; @param[out] RBP/EBP Address of Boot Firmware Volume (BFV)
27 ; @param[out] DS Selector allowing flat access to all addresses
28 ; @param[out] ES Selector allowing flat access to all addresses
29 ; @param[out] FS Selector allowing flat access to all addresses
30 ; @param[out] GS Selector allowing flat access to all addresses
31 ; @param[out] SS Selector allowing flat access to all addresses
33 ; @return None This routine jumps to SEC and does not return
36 OneTimeCall EarlyInit16
39 ; Transition the processor from 16-bit real mode to 32-bit flat mode
41 OneTimeCall TransitionFromReal16To32BitFlat
46 ; Search for the Boot Firmware Volume (BFV)
48 OneTimeCall Flat32SearchForBfvBase
55 ; Search for the SEC entry point
57 OneTimeCall Flat32SearchForSecEntryPoint
60 ; ESI - SEC Core entry point
67 ; Restore initial EAX value into the EAX register
72 ; Jump to the 32-bit SEC entry point
79 ; Transition the processor from 32-bit flat mode to 64-bit flat mode
81 OneTimeCall Transition32FlatTo64Flat
86 ; Some values were calculated in 32-bit mode. Make sure the upper
87 ; 32-bits of 64-bit registers are zero for these values.
89 mov rax, 0x00000000ffffffff
95 ; RSI - SEC Core entry point
100 ; Restore initial EAX value into the RAX register
105 ; Jump to the 64-bit SEC entry point