]> git.proxmox.com Git - mirror_edk2.git/blame - QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/SmbiosMiscEntryPoint.c
QuarkPlatformPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / SmbiosMiscDxe / SmbiosMiscEntryPoint.c
CommitLineData
b303605e
MK
1/** @file\r
2This driver parses the mSmbiosMiscDataTable structure and reports\r
3any generated data using SMBIOS protocol.\r
4\r
5Copyright (c) 2013-2015 Intel Corporation.\r
6\r
0eb3de2e 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
b303605e
MK
8\r
9\r
10**/\r
11\r
12\r
13#include "CommonHeader.h"\r
14\r
15#include "SmbiosMisc.h"\r
16\r
17\r
18extern UINT8 SmbiosMiscStrings[];\r
19EFI_HANDLE mImageHandle;\r
20\r
21EFI_HII_HANDLE mHiiHandle;\r
22\r
23\r
24\r
25/**\r
26 Standard EFI driver point. This driver parses the mSmbiosMiscDataTable\r
27 structure and reports any generated data using SMBIOS protocol.\r
28\r
29 @param ImageHandle Handle for the image of this driver\r
30 @param SystemTable Pointer to the EFI System Table\r
31\r
32 @retval EFI_SUCCESS The data was successfully stored.\r
33\r
34**/\r
35EFI_STATUS\r
36EFIAPI\r
37SmbiosMiscEntryPoint(\r
38 IN EFI_HANDLE ImageHandle,\r
39 IN EFI_SYSTEM_TABLE *SystemTable\r
40 )\r
41{\r
42 UINTN Index;\r
43 EFI_STATUS EfiStatus;\r
44 EFI_SMBIOS_PROTOCOL *Smbios;\r
45\r
46\r
47 mImageHandle = ImageHandle;\r
48\r
49 EfiStatus = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
50\r
51 if (EFI_ERROR(EfiStatus)) {\r
52 DEBUG((EFI_D_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStatus));\r
53 return EfiStatus;\r
54 }\r
55\r
56 mHiiHandle = HiiAddPackages (\r
57 &gEfiCallerIdGuid,\r
58 mImageHandle,\r
59 SmbiosMiscStrings,\r
60 NULL\r
61 );\r
62 ASSERT (mHiiHandle != NULL);\r
63\r
64 for (Index = 0; Index < mSmbiosMiscDataTableEntries; ++Index) {\r
65 //\r
66 // If the entry have a function pointer, just log the data.\r
67 //\r
68 if (mSmbiosMiscDataTable[Index].Function != NULL) {\r
69 EfiStatus = (*mSmbiosMiscDataTable[Index].Function)(\r
70 mSmbiosMiscDataTable[Index].RecordData,\r
71 Smbios\r
72 );\r
73\r
74 if (EFI_ERROR(EfiStatus)) {\r
75 DEBUG((EFI_D_ERROR, "Misc smbios store error. Index=%d, ReturnStatus=%r\n", Index, EfiStatus));\r
76 return EfiStatus;\r
77 }\r
78 }\r
79 }\r
80\r
81 return EfiStatus;\r
82}\r