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)
28 ; @return None This routine jumps to SEC and does not return
31 OneTimeCall EarlyInit16
34 ; Transition the processor from 16-bit real mode to 32-bit flat mode
36 OneTimeCall TransitionFromReal16To32BitFlat
41 ; Search for the Boot Firmware Volume (BFV)
43 OneTimeCall Flat32SearchForBfvBase
50 ; Search for the SEC entry point
52 OneTimeCall Flat32SearchForSecEntryPoint
55 ; ESI - SEC Core entry point
62 ; Restore initial EAX value into the EAX register
67 ; Jump to the 32-bit SEC entry point
74 ; Transition the processor from 32-bit flat mode to 64-bit flat mode
76 OneTimeCall Transition32FlatTo64Flat
81 ; Some values were calculated in 32-bit mode. Make sure the upper
82 ; 32-bits of 64-bit registers are zero for these values.
84 mov rax, 0x00000000ffffffff
90 ; RSI - SEC Core entry point
95 ; Restore initial EAX value into the RAX register
100 ; Jump to the 64-bit SEC entry point