]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/PrePeiCore/MainUniCore.c
ARM Packages: Rename PcdNormal* into Pcd* PCDs
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / MainUniCore.c
1 /** @file
2 *
3 * Copyright (c) 2011, ARM Limited. All rights reserved.
4 *
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
9 *
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.
12 *
13 **/
14
15 #include <Chipset/ArmV7.h>
16
17 #include "PrePeiCore.h"
18
19 extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;
20
21 VOID
22 EFIAPI
23 SecondaryMain (
24 IN UINTN MpId
25 )
26 {
27 ASSERT(FALSE);
28 }
29
30 VOID
31 EFIAPI
32 PrimaryMain (
33 IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint
34 )
35 {
36 EFI_SEC_PEI_HAND_OFF SecCoreData;
37
38
39 //
40 // Bind this information into the SEC hand-off state
41 // Note: this must be in sync with the stuff in the asm file
42 // Note also: HOBs (pei temp ram) MUST be above stack
43 //
44 SecCoreData.DataSize = sizeof(EFI_SEC_PEI_HAND_OFF);
45 SecCoreData.BootFirmwareVolumeBase = (VOID *)(UINTN)PcdGet32 (PcdFvBaseAddress);
46 SecCoreData.BootFirmwareVolumeSize = PcdGet32 (PcdFvSize);
47 SecCoreData.TemporaryRamBase = (VOID *)(UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize); // We consider we run on the primary core (and so we use the first stack)
48 SecCoreData.TemporaryRamSize = (UINTN)(UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize);
49 SecCoreData.PeiTemporaryRamBase = (VOID *)((UINTN)(SecCoreData.TemporaryRamBase) + (SecCoreData.TemporaryRamSize / 2));
50 SecCoreData.PeiTemporaryRamSize = SecCoreData.TemporaryRamSize / 2;
51 SecCoreData.StackBase = SecCoreData.TemporaryRamBase;
52 SecCoreData.StackSize = SecCoreData.TemporaryRamSize - SecCoreData.PeiTemporaryRamSize;
53
54 // jump to pei core entry point
55 (PeiCoreEntryPoint)(&SecCoreData, (VOID *)&gSecPpiTable);
56 }