]>
Commit | Line | Data |
---|---|---|
310b04e6 | 1 | /** @file\r |
2 | This code supports the implementation of the Smbios protocol\r | |
3 | \r | |
e63f3308 | 4 | Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r |
e5eed7d3 | 5 | This program and the accompanying materials \r |
310b04e6 | 6 | are licensed and made available under the terms and conditions of the BSD License \r |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _SMBIOS_DXE_H_\r | |
16 | #define _SMBIOS_DXE_H_\r | |
17 | \r | |
18 | \r | |
19 | #include <PiDxe.h>\r | |
20 | \r | |
21 | #include <Protocol/Smbios.h>\r | |
22 | #include <IndustryStandard/SmBios.h>\r | |
23 | #include <Guid/EventGroup.h>\r | |
24 | #include <Guid/SmBios.h>\r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/UefiDriverEntryPoint.h>\r | |
27 | #include <Library/UefiLib.h>\r | |
28 | #include <Library/BaseLib.h>\r | |
29 | #include <Library/BaseMemoryLib.h>\r | |
30 | #include <Library/MemoryAllocationLib.h>\r | |
31 | #include <Library/UefiBootServicesTableLib.h>\r | |
9f7d5b46 | 32 | #include <Library/PcdLib.h>\r |
310b04e6 | 33 | \r |
34 | #define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')\r | |
35 | typedef struct {\r | |
36 | UINT32 Signature;\r | |
37 | EFI_HANDLE Handle;\r | |
38 | //\r | |
39 | // Produced protocol\r | |
40 | //\r | |
41 | EFI_SMBIOS_PROTOCOL Smbios;\r | |
42 | //\r | |
43 | // Updates to record list must be locked.\r | |
44 | //\r | |
45 | EFI_LOCK DataLock;\r | |
46 | //\r | |
47 | // List of EFI_SMBIOS_ENTRY structures.\r | |
48 | //\r | |
49 | LIST_ENTRY DataListHead;\r | |
50 | //\r | |
51 | // List of allocated SMBIOS handle.\r | |
52 | //\r | |
53 | LIST_ENTRY AllocatedHandleListHead;\r | |
54 | } SMBIOS_INSTANCE;\r | |
55 | \r | |
56 | #define SMBIOS_INSTANCE_FROM_THIS(this) CR (this, SMBIOS_INSTANCE, Smbios, SMBIOS_INSTANCE_SIGNATURE)\r | |
57 | \r | |
58 | //\r | |
59 | // SMBIOS record Header\r | |
60 | //\r | |
61 | // An SMBIOS internal Record is an EFI_SMBIOS_RECORD_HEADER followed by (RecordSize - HeaderSize) bytes of\r | |
62 | // data. The format of the data is defined by the SMBIOS spec.\r | |
63 | //\r | |
64 | //\r | |
65 | #define EFI_SMBIOS_RECORD_HEADER_VERSION 0x0100\r | |
66 | typedef struct {\r | |
67 | UINT16 Version;\r | |
68 | UINT16 HeaderSize;\r | |
69 | UINTN RecordSize;\r | |
70 | EFI_HANDLE ProducerHandle;\r | |
71 | UINTN NumberOfStrings;\r | |
72 | } EFI_SMBIOS_RECORD_HEADER;\r | |
73 | \r | |
74 | \r | |
75 | //\r | |
76 | // Private data structure to contain the SMBIOS record. One record per\r | |
77 | // structure. SmbiosRecord is a copy of the data passed in and follows RecordHeader .\r | |
78 | //\r | |
79 | #define EFI_SMBIOS_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'r', 'e', 'c')\r | |
80 | typedef struct {\r | |
81 | UINT32 Signature;\r | |
82 | LIST_ENTRY Link;\r | |
83 | EFI_SMBIOS_RECORD_HEADER *RecordHeader;\r | |
84 | UINTN RecordSize;\r | |
e63f3308 EL |
85 | //\r |
86 | // Indicate which table this record is added to.\r | |
87 | //\r | |
88 | BOOLEAN Smbios32BitTable;\r | |
89 | BOOLEAN Smbios64BitTable;\r | |
310b04e6 | 90 | } EFI_SMBIOS_ENTRY;\r |
91 | \r | |
92 | #define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)\r | |
93 | \r | |
94 | //\r | |
95 | // Private data to contain the Smbios handle that already allocated.\r | |
96 | //\r | |
97 | #define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')\r | |
98 | \r | |
99 | typedef struct {\r | |
100 | UINT32 Signature;\r | |
101 | LIST_ENTRY Link;\r | |
102 | //\r | |
103 | // Filter driver will register what record guid filter should be used.\r | |
104 | //\r | |
105 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
106 | \r | |
107 | } SMBIOS_HANDLE_ENTRY;\r | |
108 | \r | |
109 | #define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)\r | |
110 | \r | |
111 | typedef struct {\r | |
112 | EFI_SMBIOS_TABLE_HEADER Header;\r | |
113 | UINT8 Tailing[2];\r | |
114 | } EFI_SMBIOS_TABLE_END_STRUCTURE;\r | |
115 | \r | |
0ddd8553 | 116 | /**\r |
117 | Create Smbios Table and installs the Smbios Table to the System Table.\r | |
e63f3308 EL |
118 | \r |
119 | @param Smbios32BitTable The flag to update 32-bit table.\r | |
120 | @param Smbios64BitTable The flag to update 64-bit table.\r | |
121 | \r | |
0ddd8553 | 122 | **/\r |
123 | VOID\r | |
124 | EFIAPI\r | |
125 | SmbiosTableConstruction (\r | |
e63f3308 EL |
126 | BOOLEAN Smbios32BitTable,\r |
127 | BOOLEAN Smbios64BitTable\r | |
0ddd8553 | 128 | );\r |
129 | \r | |
310b04e6 | 130 | #endif\r |