1 #------------------------------------------------------------------------------
3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #------------------------------------------------------------------------------
15 #include <AsmMacroIoLib.h>
16 #include <Library/PcdLib.h>
21 .globl ASM_PFX(CEntryPoint)
22 .globl ASM_PFX(_ModuleEntryPoint)
24 ASM_PFX(_ModuleEntryPoint):
27 // Set stack based on PCD values. Need to do it this way to make C code work
28 // when it runs from FLASH.
30 LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) /* stack base arg2 */
31 LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) /* stack size arg3 */
34 //Enter SVC mode and set up SVC stack pointer
35 mov r0,#0x13|0x80|0x40
41 LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) /* memory size arg1 */
42 LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) /* memory size arg0 */
44 blx ASM_PFX(CEntryPoint) /* Assume C code is ARM */
47 /* _CEntryPoint should never return */