]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Library/MultiPlatformLib/PlatformInfoHob.c
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / Library / MultiPlatformLib / PlatformInfoHob.c
CommitLineData
3cbfba02
DW
1/** @file\r
2 Platform Hob access interface for multiplatform.\r
3\r
4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
5 \r\r
9dc8036d
MK
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
3cbfba02
DW
8 \r\r
9\r
10**/\r
11\r
12#include <MultiPlatformLib.h>\r
13\r
14/**\r
15 Returns the Platform Info of the platform from the HOB.\r
16\r
17 @param PeiServices General purpose services available to every PEIM.\r
18 @param PlatformInfoHob Pointer to the PLATFORM_INFO_HOB Pointer\r
19\r
20 @retval EFI_SUCCESS The function completed successfully.\r
21 @retval EFI_NOT_FOUND PlatformInfoHob data doesn't exist, use default instead.\r
22\r
23**/\r
24EFI_STATUS\r
25GetPlatformInfoHob (\r
26 IN CONST EFI_PEI_SERVICES **PeiServices,\r
27 OUT EFI_PLATFORM_INFO_HOB **PlatformInfoHob\r
28 )\r
29{\r
30 EFI_PEI_HOB_POINTERS GuidHob;\r
31\r
32 //\r
33 // Find the PlatformInfo HOB\r
34 //\r
35 GuidHob.Raw = GetHobList ();\r
36 if (GuidHob.Raw == NULL) {\r
37 return EFI_NOT_FOUND;\r
38 }\r
39\r
40 if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) {\r
41 *PlatformInfoHob = GET_GUID_HOB_DATA (GuidHob.Guid);\r
42 }\r
43\r
44 //\r
45 // PlatformInfo PEIM should provide this HOB data, if not ASSERT and return error.\r
46 //\r
ba53301f 47 ASSERT (*PlatformInfoHob != NULL);\r
3cbfba02
DW
48 if (!(*PlatformInfoHob)) {\r
49 return EFI_NOT_FOUND;\r
50 }\r
51\r
52 return EFI_SUCCESS;\r
53}\r
54\r