]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
EmbeddedPkg/AndroidFastbootTransportTcpDxe: remove broken hostname handling
[mirror_edk2.git] / EmbeddedPkg / Library / PrePiHobListPointerLib / PrePiHobListPointer.c
CommitLineData
32f718cf 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
32f718cf 4*\r
3402aac7
RC
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
32f718cf 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
1e57a462 20//\r
21// Have to use build system to set the original value in case we are running\r
22// from FLASH and globals don't work. So if you do a GetHobList() and gHobList\r
23// and gHobList is NULL the PCD default values are used.\r
24//\r
32f718cf 25VOID *gHobList = NULL;\r
26\r
27\r
28/**\r
29 Returns the pointer to the HOB list.\r
30\r
31 This function returns the pointer to first HOB in the list.\r
32\r
33 @return The pointer to the HOB list.\r
34\r
35**/\r
36VOID *\r
37EFIAPI\r
38PrePeiGetHobList (\r
39 VOID\r
40 )\r
41{\r
42 if (gHobList == NULL) {\r
43 return (VOID *)*(UINTN*)PcdGet32 (PcdPrePiHobBase);\r
44 } else {\r
45 return gHobList;\r
46 }\r
47}\r
48\r
49\r
50\r
51/**\r
52 Updates the pointer to the HOB list.\r
53\r
54 @param HobList Hob list pointer to store\r
3402aac7 55\r
32f718cf 56**/\r
57EFI_STATUS\r
58EFIAPI\r
59PrePeiSetHobList (\r
60 IN VOID *HobList\r
61 )\r
62{\r
63 gHobList = HobList;\r
3402aac7 64\r
32f718cf 65 //\r
66 // If this code is running from ROM this could fail\r
67 //\r
68 return (gHobList == HobList) ? EFI_SUCCESS: EFI_UNSUPPORTED;\r
69}\r