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