]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
ArmPlatformPkg/Sec: Clean and Move all declaration into 'SecInternal.h' (2)
[mirror_edk2.git] / ArmPlatformPkg / Library / PrePiHobListPointerLib / PrePiHobListPointer.c
CommitLineData
3c4b742c 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
15#include <PiPei.h>\r
16#include <Library/PrePiHobListPointerLib.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/PcdLib.h>\r
19\r
3c4b742c 20/**\r
21 Returns the pointer to the HOB list.\r
22\r
23 This function returns the pointer to first HOB in the list.\r
24\r
25 @return The pointer to the HOB list.\r
26\r
27**/\r
28VOID *\r
29EFIAPI\r
30PrePeiGetHobList (\r
31 VOID\r
32 )\r
33{\r
e1808603 34 return (VOID *)*(UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +\r
35 PcdGet32 (PcdCPUCoresNonSecStackSize) -\r
36 PcdGet32 (PcdPeiGlobalVariableSize) +\r
37 PcdGet32 (PcdHobListPtrGlobalOffset));\r
3c4b742c 38}\r
39\r
40\r
41\r
42/**\r
43 Updates the pointer to the HOB list.\r
44\r
45 @param HobList Hob list pointer to store\r
46 \r
47**/\r
48EFI_STATUS\r
49EFIAPI\r
50PrePeiSetHobList (\r
51 IN VOID *HobList\r
52 )\r
53{\r
e1808603 54 UINTN* HobListPtr;\r
55\r
56 HobListPtr = (UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +\r
57 PcdGet32 (PcdCPUCoresNonSecStackSize) -\r
58 PcdGet32 (PcdPeiGlobalVariableSize) +\r
59 PcdGet32 (PcdHobListPtrGlobalOffset));\r
60\r
61 *HobListPtr = (UINTN)HobList;\r
62\r
63 return EFI_SUCCESS;\r
3c4b742c 64}\r
e1808603 65\r