]>
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 | |
23 | typedef EFI_STATUS (EFIAPI SMBIOS_MISC_DATA_FUNCTION) (\r | |
24 | IN VOID *RecordData,\r | |
25 | IN EFI_SMBIOS_PROTOCOL *Smbios\r | |
26 | );\r | |
27 | \r | |
28 | \r | |
29 | //\r | |
30 | // Data table entry definition.\r | |
31 | //\r | |
32 | typedef struct {\r | |
33 | //\r | |
34 | // intermediate input data for SMBIOS record\r | |
35 | //\r | |
36 | VOID *RecordData;\r | |
37 | SMBIOS_MISC_DATA_FUNCTION *Function;\r | |
38 | } SMBIOS_MISC_DATA_TABLE;\r | |
39 | \r | |
40 | \r | |
41 | //\r | |
42 | // SMBIOS table extern definitions\r | |
43 | //\r | |
44 | #define SMBIOS_MISC_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r | |
45 | extern NAME1 NAME2 ## Data; \\r | |
46 | extern SMBIOS_MISC_DATA_FUNCTION NAME3 ## Function;\r | |
47 | \r | |
48 | \r | |
49 | //\r | |
50 | // SMBIOS data table entries\r | |
51 | //\r | |
52 | // This is used to define a pair of table structure pointer and functions\r | |
53 | // in order to iterate through the list of tables, populate them and add\r | |
54 | // them into the system.\r | |
55 | #define SMBIOS_MISC_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r | |
56 | { \\r | |
57 | & NAME1 ## Data, \\r | |
58 | NAME2 ## Function \\r | |
59 | }\r | |
60 | \r | |
61 | //\r | |
62 | // Global definition macros.\r | |
63 | //\r | |
64 | #define SMBIOS_MISC_TABLE_DATA(NAME1, NAME2) \\r | |
65 | NAME1 NAME2 ## Data\r | |
66 | \r | |
67 | #define SMBIOS_MISC_TABLE_FUNCTION(NAME2) \\r | |
68 | EFI_STATUS EFIAPI NAME2 ## Function( \\r | |
69 | IN VOID *RecordData, \\r | |
70 | IN EFI_SMBIOS_PROTOCOL *Smbios \\r | |
71 | )\r | |
72 | \r | |
73 | //\r | |
74 | // Data Table Array Entries\r | |
75 | //\r | |
76 | extern EFI_HII_HANDLE mSmbiosMiscHiiHandle;\r | |
77 | \r | |
78 | typedef struct _SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING{\r | |
79 | UINT8 *LanguageSignature;\r | |
80 | EFI_STRING_ID InstallableLanguageLongString;\r | |
81 | EFI_STRING_ID InstallableLanguageAbbreviateString;\r | |
82 | } SMBIOS_TYPE13_BIOS_LANGUAGE_INFORMATION_STRING;\r | |
83 | \r | |
84 | \r | |
85 | /**\r | |
86 | Adds an SMBIOS record.\r | |
87 | \r | |
88 | @param Buffer The data for the SMBIOS record.\r | |
89 | The format of the record is determined by\r | |
90 | EFI_SMBIOS_TABLE_HEADER.Type. The size of the\r | |
91 | formatted area is defined by EFI_SMBIOS_TABLE_HEADER.Length\r | |
92 | and either followed by a double-null (0x0000) or a set\r | |
93 | of null terminated strings and a null.\r | |
94 | @param SmbiosHandle A unique handle will be assigned to the SMBIOS record\r | |
95 | if not NULL.\r | |
96 | \r | |
97 | @retval EFI_SUCCESS Record was added.\r | |
98 | @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.\r | |
99 | @retval EFI_ALREADY_STARTED The SmbiosHandle passed in was already in use.\r | |
100 | \r | |
101 | **/\r | |
102 | EFI_STATUS\r | |
103 | SmbiosMiscAddRecord (\r | |
104 | IN UINT8 *Buffer,\r | |
105 | IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle OPTIONAL\r | |
106 | );\r | |
107 | \r | |
108 | /**\r | |
109 | Get Link Type Handle.\r | |
110 | \r | |
111 | @param [in] SmbiosType Get this Type from SMBIOS table\r | |
112 | @param [out] HandleArray Pointer to handle array which will be freed by caller\r | |
113 | @param [out] HandleCount Pointer to handle count\r | |
114 | \r | |
115 | **/\r | |
116 | VOID\r | |
117 | SmbiosMiscGetLinkTypeHandle(\r | |
118 | IN UINT8 SmbiosType,\r | |
119 | OUT UINT16 **HandleArray,\r | |
120 | OUT UINTN *HandleCount\r | |
121 | );\r | |
122 | \r | |
123 | //\r | |
124 | // Data Table Array\r | |
125 | //\r | |
126 | extern SMBIOS_MISC_DATA_TABLE mSmbiosMiscDataTable[];\r | |
127 | \r | |
128 | //\r | |
129 | // Data Table Array Entries\r | |
130 | //\r | |
131 | extern UINTN mSmbiosMiscDataTableEntries;\r | |
132 | extern UINT8 mSmbiosMiscDxeStrings[];\r | |
133 | \r | |
134 | #endif // SMBIOS_MISC_H_\r |