]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.h
MdeModulePkg: Add UNI file for PlatformBootManagerLibNull library.
[mirror_edk2.git] / MdeModulePkg / Universal / SmbiosDxe / SmbiosDxe.h
CommitLineData
310b04e6 1/** @file\r
2 This code supports the implementation of the Smbios protocol\r
3 \r
e63f3308 4Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials \r
310b04e6 6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT 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
4233bf70
SZ
34//\r
35// The length of the entire structure table (including all strings) must be reported\r
36// in the Structure Table Length field of the SMBIOS Structure Table Entry Point,\r
37// which is a WORD field limited to 65,535 bytes.\r
38//\r
39#define SMBIOS_TABLE_MAX_LENGTH 0xFFFF\r
40\r
e63f3308
EL
41//\r
42// For SMBIOS 3.0, Structure table maximum size in Entry Point structure is DWORD field limited to 0xFFFFFFFF bytes.\r
43//\r
44#define SMBIOS_3_0_TABLE_MAX_LENGTH 0xFFFFFFFF\r
45\r
310b04e6 46#define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')\r
47typedef struct {\r
48 UINT32 Signature;\r
49 EFI_HANDLE Handle;\r
50 //\r
51 // Produced protocol\r
52 //\r
53 EFI_SMBIOS_PROTOCOL Smbios;\r
54 //\r
55 // Updates to record list must be locked.\r
56 //\r
57 EFI_LOCK DataLock;\r
58 //\r
59 // List of EFI_SMBIOS_ENTRY structures.\r
60 //\r
61 LIST_ENTRY DataListHead;\r
62 //\r
63 // List of allocated SMBIOS handle.\r
64 //\r
65 LIST_ENTRY AllocatedHandleListHead;\r
66} SMBIOS_INSTANCE;\r
67\r
68#define SMBIOS_INSTANCE_FROM_THIS(this) CR (this, SMBIOS_INSTANCE, Smbios, SMBIOS_INSTANCE_SIGNATURE)\r
69\r
70//\r
71// SMBIOS record Header\r
72//\r
73// An SMBIOS internal Record is an EFI_SMBIOS_RECORD_HEADER followed by (RecordSize - HeaderSize) bytes of\r
74// data. The format of the data is defined by the SMBIOS spec.\r
75//\r
76//\r
77#define EFI_SMBIOS_RECORD_HEADER_VERSION 0x0100\r
78typedef struct {\r
79 UINT16 Version;\r
80 UINT16 HeaderSize;\r
81 UINTN RecordSize;\r
82 EFI_HANDLE ProducerHandle;\r
83 UINTN NumberOfStrings;\r
84} EFI_SMBIOS_RECORD_HEADER;\r
85\r
86\r
87//\r
88// Private data structure to contain the SMBIOS record. One record per\r
89// structure. SmbiosRecord is a copy of the data passed in and follows RecordHeader .\r
90//\r
91#define EFI_SMBIOS_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'r', 'e', 'c')\r
92typedef struct {\r
93 UINT32 Signature;\r
94 LIST_ENTRY Link;\r
95 EFI_SMBIOS_RECORD_HEADER *RecordHeader;\r
96 UINTN RecordSize;\r
e63f3308
EL
97 //\r
98 // Indicate which table this record is added to.\r
99 //\r
100 BOOLEAN Smbios32BitTable;\r
101 BOOLEAN Smbios64BitTable;\r
310b04e6 102} EFI_SMBIOS_ENTRY;\r
103\r
104#define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)\r
105\r
106//\r
107// Private data to contain the Smbios handle that already allocated.\r
108//\r
109#define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')\r
110\r
111typedef struct {\r
112 UINT32 Signature;\r
113 LIST_ENTRY Link;\r
114 //\r
115 // Filter driver will register what record guid filter should be used.\r
116 //\r
117 EFI_SMBIOS_HANDLE SmbiosHandle;\r
118\r
119} SMBIOS_HANDLE_ENTRY;\r
120\r
121#define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)\r
122\r
123typedef struct {\r
124 EFI_SMBIOS_TABLE_HEADER Header;\r
125 UINT8 Tailing[2];\r
126} EFI_SMBIOS_TABLE_END_STRUCTURE;\r
127\r
0ddd8553 128/**\r
129 Create Smbios Table and installs the Smbios Table to the System Table.\r
e63f3308
EL
130 \r
131 @param Smbios32BitTable The flag to update 32-bit table.\r
132 @param Smbios64BitTable The flag to update 64-bit table.\r
133 \r
0ddd8553 134**/\r
135VOID\r
136EFIAPI\r
137SmbiosTableConstruction (\r
e63f3308
EL
138 BOOLEAN Smbios32BitTable,\r
139 BOOLEAN Smbios64BitTable\r
0ddd8553 140 );\r
141\r
310b04e6 142#endif\r