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