]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PrePeiCore/MainUniCore.c
ArmPlatformPkg: Code cleaning
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / MainUniCore.c
CommitLineData
1d5d0ae9 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
4*\r
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. The full text of the license may be found at\r
8* http://opensource.org/licenses/bsd-license.php\r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12*\r
13**/\r
14\r
1d5d0ae9 15#include <Library/DebugLib.h>\r
16#include <Library/PcdLib.h>\r
17#include <Chipset/ArmV7.h>\r
18\r
f598bf12 19#include "PrePeiCore.h"\r
20\r
1d5d0ae9 21extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;\r
22\r
23VOID\r
24EFIAPI\r
f598bf12 25SecondaryMain (\r
26 IN UINTN CoreId\r
27 )\r
1d5d0ae9 28{\r
f598bf12 29 ASSERT(FALSE);\r
1d5d0ae9 30}\r
31\r
f598bf12 32VOID\r
33EFIAPI\r
34PrimaryMain (\r
1d5d0ae9 35 IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint\r
36 )\r
37{\r
f598bf12 38 EFI_SEC_PEI_HAND_OFF SecCoreData;\r
39\r
40\r
41 //\r
42 // Bind this information into the SEC hand-off state\r
43 // Note: this must be in sync with the stuff in the asm file\r
44 // Note also: HOBs (pei temp ram) MUST be above stack\r
45 //\r
46 SecCoreData.DataSize = sizeof(EFI_SEC_PEI_HAND_OFF);\r
47 SecCoreData.BootFirmwareVolumeBase = (VOID *)(UINTN)PcdGet32 (PcdNormalFvBaseAddress);\r
48 SecCoreData.BootFirmwareVolumeSize = PcdGet32 (PcdNormalFvSize);\r
49 SecCoreData.TemporaryRamBase = (VOID *)(UINTN)PcdGet32 (PcdCPUCoresNonSecStackBase); // We consider we run on the primary core (and so we use the first stack)\r
50 SecCoreData.TemporaryRamSize = (UINTN)(UINTN)PcdGet32 (PcdCPUCoresNonSecStackSize);\r
51 SecCoreData.PeiTemporaryRamBase = (VOID *)((UINTN)(SecCoreData.TemporaryRamBase) + (SecCoreData.TemporaryRamSize / 2));\r
52 SecCoreData.PeiTemporaryRamSize = SecCoreData.TemporaryRamSize / 2;\r
53 SecCoreData.StackBase = SecCoreData.TemporaryRamBase;\r
54 SecCoreData.StackSize = SecCoreData.TemporaryRamSize - SecCoreData.PeiTemporaryRamSize;\r
55\r
56 // jump to pei core entry point\r
57 (PeiCoreEntryPoint)(&SecCoreData, (VOID *)&gSecPpiTable);\r
1d5d0ae9 58}\r