]>
Commit | Line | Data |
---|---|---|
ecc267fe RC |
1 | /** @file\r |
2 | Header file for the SmbiosMisc Driver.\r | |
3 | \r | |
4 | Based on files under Nt32Pkg/MiscSubClassPlatformDxe/\r | |
5 | \r | |
6 | Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r | |
7 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
8 | Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>\r | |
9 | Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>\r | |
10 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
11 | \r | |
12 | **/\r | |
13 | \r | |
14 | #ifndef SMBIOS_MISC_H_\r | |
15 | #define SMBIOS_MISC_H_\r | |
16 | \r | |
17 | #include <Protocol/Smbios.h>\r | |
18 | #include <IndustryStandard/SmBios.h>\r | |
19 | \r | |
20 | //\r | |
21 | // Data table entry update function.\r | |
22 | //\r | |
429309e0 | 23 | typedef EFI_STATUS (EFIAPI SMBIOS_MISC_DATA_FUNCTION)(\r |
ecc267fe RC |
24 | IN VOID *RecordData,\r |
25 | IN EFI_SMBIOS_PROTOCOL *Smbios\r | |
26 | );\r | |
27 | \r | |
ecc267fe RC |
28 | //\r |
29 | // Data table entry definition.\r | |
30 | //\r | |
31 | typedef struct {\r | |
32 | //\r | |
33 | // intermediate input data for SMBIOS record\r | |
34 | //\r | |
429309e0 MK |
35 | VOID *RecordData;\r |
36 | SMBIOS_MISC_DATA_FUNCTION *Function;\r | |
ecc267fe RC |
37 | } SMBIOS_MISC_DATA_TABLE;\r |
38 | \r | |
ecc267fe RC |
39 | //\r |
40 | // SMBIOS table extern definitions\r | |
41 | //\r | |
42 | #define SMBIOS_MISC_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r | |
43 | extern NAME1 NAME2 ## Data; \\r | |
44 | extern SMBIOS_MISC_DATA_FUNCTION NAME3 ## Function;\r | |
45 | \r | |
ecc267fe RC |
46 | //\r |
47 | // SMBIOS data table entries\r | |
48 | //\r | |
49 | // This is used to define a pair of table structure pointer and functions\r | |
50 | // in order to iterate through the list of tables, populate them and add\r | |
51 | // them into the system.\r | |
52 | #define SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r | |
53 | { \\r | |
54 | & NAME1 ## Data, \\r | |
55 | NAME2 ## Function \\r | |
56 | }\r | |
57 | \r | |
58 | //\r | |
59 | // Global definition macros.\r | |
60 | //\r | |
61 | #define SMBIOS_MISC_TABLE_DATA(NAME1, NAME2) \\r | |
62 | NAME1 NAME2 ## Data\r | |
63 | \r | |
64 | #define SMBIOS_MISC_TABLE_FUNCTION(NAME2) \\r | |
65 | EFI_STATUS EFIAPI NAME2 ## Function( \\r | |
66 | IN VOID *RecordData, \\r | |
67 | IN EFI_SMBIOS_PROTOCOL *Smbios \\r | |
68 | )\r | |
69 | \r | |
70 | //\r | |
71 | // Data Table Array Entries\r | |
72 | //\r | |
429309e0 | 73 | extern EFI_HII_HANDLE mSmbiosMiscHiiHandle;\r |
ecc267fe | 74 | \r |
429309e0 MK |
75 | typedef struct _SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING {\r |
76 | UINT8 *LanguageSignature;\r | |
77 | EFI_STRING_ID InstallableLanguageLongString;\r | |
78 | EFI_STRING_ID InstallableLanguageAbbreviateString;\r | |
ecc267fe RC |
79 | } SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING;\r |
80 | \r | |
ecc267fe RC |
81 | /**\r |
82 | Adds an SMBIOS record.\r | |
83 | \r | |
84 | @param Buffer The data for the SMBIOS record.\r | |
85 | The format of the record is determined by\r | |
86 | EFI_SMBIOS_TABLE_HEADER.Type. The size of the\r | |
87 | formatted area is defined by EFI_SMBIOS_TABLE_HEADER.Length\r | |
88 | and either followed by a double-null (0x0000) or a set\r | |
89 | of null terminated strings and a null.\r | |
90 | @param SmbiosHandle A unique handle will be assigned to the SMBIOS record\r | |
91 | if not NULL.\r | |
92 | \r | |
93 | @retval EFI_SUCCESS Record was added.\r | |
94 | @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.\r | |
95 | @retval EFI_ALREADY_STARTED The SmbiosHandle passed in was already in use.\r | |
96 | \r | |
97 | **/\r | |
98 | EFI_STATUS\r | |
99 | SmbiosMiscAddRecord (\r | |
429309e0 MK |
100 | IN UINT8 *Buffer,\r |
101 | IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL\r | |
ecc267fe RC |
102 | );\r |
103 | \r | |
104 | /**\r | |
105 | Get Link Type Handle.\r | |
106 | \r | |
107 | @param [in] SmbiosType Get this Type from SMBIOS table\r | |
108 | @param [out] HandleArray Pointer to handle array which will be freed by caller\r | |
109 | @param [out] HandleCount Pointer to handle count\r | |
110 | \r | |
111 | **/\r | |
112 | VOID\r | |
429309e0 MK |
113 | SmbiosMiscGetLinkTypeHandle (\r |
114 | IN UINT8 SmbiosType,\r | |
115 | OUT UINT16 **HandleArray,\r | |
116 | OUT UINTN *HandleCount\r | |
ecc267fe RC |
117 | );\r |
118 | \r | |
119 | //\r | |
120 | // Data Table Array\r | |
121 | //\r | |
429309e0 | 122 | extern SMBIOS_MISC_DATA_TABLE mSmbiosMiscDataTable[];\r |
ecc267fe RC |
123 | \r |
124 | //\r | |
125 | // Data Table Array Entries\r | |
126 | //\r | |
429309e0 MK |
127 | extern UINTN mSmbiosMiscDataTableEntries;\r |
128 | extern UINT8 mSmbiosMiscDxeStrings[];\r | |
ecc267fe RC |
129 | \r |
130 | #endif // SMBIOS_MISC_H_\r |