]>
Commit | Line | Data |
---|---|---|
804405e7 | 1 | /*++\r |
2 | \r | |
a762a877 | 3 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
124f761f | 4 | This program and the accompanying materials\r |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
804405e7 | 11 | \r |
12 | Module Name:\r | |
13 | \r | |
14 | MiscSubclassDriver.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Header file for MiscSubclass Driver.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _MISC_SUBCLASS_DRIVER_H\r | |
23 | #define _MISC_SUBCLASS_DRIVER_H\r | |
24 | \r | |
25 | #include <FrameworkDxe.h>\r | |
26 | #include <UnixDxe.h>\r | |
27 | #include <Guid/DataHubRecords.h>\r | |
aaa2cc19 | 28 | #include <IndustryStandard/SmBios.h>\r |
29 | #include <Protocol/Smbios.h>\r | |
804405e7 | 30 | #include <Protocol/UnixIo.h>\r |
31 | #include <Library/BaseLib.h>\r | |
32 | #include <Library/DebugLib.h>\r | |
a2f39d47 | 33 | #include <Library/HiiLib.h>\r |
804405e7 | 34 | #include <Library/UefiLib.h>\r |
35 | #include <Library/UefiDriverEntryPoint.h>\r | |
36 | #include <Library/BaseMemoryLib.h>\r | |
37 | #include <Library/MemoryAllocationLib.h>\r | |
38 | #include <Library/UefiBootServicesTableLib.h>\r | |
39 | #include <Library/DevicePathLib.h>\r | |
40 | #include <Library/PcdLib.h>\r | |
41 | \r | |
42 | \r | |
43 | #include <MiscDevicePath.h>\r | |
804405e7 | 44 | #include <Protocol/FrameworkHii.h>\r |
45 | #include <Library/HiiLib.h>\r | |
46 | \r | |
47 | //\r | |
48 | // Data table entry update function.\r | |
49 | //\r | |
aaa2cc19 | 50 | typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (\r |
51 | IN VOID *RecordData,\r | |
52 | IN EFI_SMBIOS_PROTOCOL *Smbios\r | |
804405e7 | 53 | );\r |
54 | \r | |
55 | //\r | |
56 | // Data table entry definition.\r | |
57 | //\r | |
58 | typedef struct {\r | |
aaa2cc19 | 59 | //\r |
60 | // intermediat input data for SMBIOS record\r | |
61 | //\r | |
62 | VOID *RecordData;\r | |
63 | EFI_MISC_SMBIOS_DATA_FUNCTION *Function;\r | |
64 | } EFI_MISC_SMBIOS_DATA_TABLE;\r | |
804405e7 | 65 | \r |
66 | //\r | |
67 | // Data Table extern definitions.\r | |
68 | //\r | |
aaa2cc19 | 69 | #define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r |
70 | extern NAME1 NAME2 ## Data; \\r | |
71 | extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function\r | |
72 | \r | |
804405e7 | 73 | \r |
74 | //\r | |
75 | // Data Table entries\r | |
76 | //\r | |
aaa2cc19 | 77 | #define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r |
78 | { \\r | |
79 | & NAME1 ## Data, \\r | |
80 | & NAME2 ## Function \\r | |
81 | }\r | |
804405e7 | 82 | \r |
83 | //\r | |
84 | // Global definition macros.\r | |
85 | //\r | |
aaa2cc19 | 86 | #define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \\r |
87 | NAME1 NAME2 ## Data\r | |
804405e7 | 88 | \r |
aaa2cc19 | 89 | #define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \\r |
90 | EFI_STATUS EFIAPI NAME2 ## Function( \\r | |
91 | IN VOID *RecordData, \\r | |
92 | IN EFI_SMBIOS_PROTOCOL *Smbios \\r | |
804405e7 | 93 | )\r |
94 | \r | |
aaa2cc19 | 95 | \r |
804405e7 | 96 | //\r |
97 | // Data Table Array\r | |
98 | //\r | |
aaa2cc19 | 99 | extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];\r |
804405e7 | 100 | \r |
101 | //\r | |
102 | // Data Table Array Entries\r | |
103 | //\r | |
aaa2cc19 | 104 | extern UINTN mMiscSubclassDataTableEntries;\r |
105 | extern UINT8 MiscSubclassStrings[];\r | |
106 | extern EFI_HII_HANDLE mHiiHandle;\r | |
107 | \r | |
a762a877 SZ |
108 | /**\r |
109 | Add an SMBIOS record.\r | |
110 | \r | |
111 | @param Smbios The EFI_SMBIOS_PROTOCOL instance.\r | |
112 | @param SmbiosHandle A unique handle will be assigned to the SMBIOS record.\r | |
113 | @param Record The data for the fixed portion of the SMBIOS record. The format of the record is\r | |
114 | determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r | |
115 | by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r | |
116 | a set of null terminated strings and a null.\r | |
117 | \r | |
118 | @retval EFI_SUCCESS Record was added.\r | |
119 | @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.\r | |
120 | \r | |
121 | **/\r | |
aaa2cc19 | 122 | EFI_STATUS\r |
a762a877 SZ |
123 | AddSmbiosRecord (\r |
124 | IN EFI_SMBIOS_PROTOCOL *Smbios,\r | |
125 | OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r | |
126 | IN EFI_SMBIOS_TABLE_HEADER *Record\r | |
aaa2cc19 | 127 | );\r |
128 | \r | |
804405e7 | 129 | #endif /* _MISC_SUBCLASS_DRIVER_H */\r |
130 | \r | |
131 | /* eof - MiscSubclassDriver.h */\r |