TianoCore EDK2 master
Loading...
Searching...
No Matches
SmbiosDxe.h
Go to the documentation of this file.
1
9#ifndef _SMBIOS_DXE_H_
10#define _SMBIOS_DXE_H_
11
12#include <PiDxe.h>
13
14#include <Protocol/Smbios.h>
16#include <Guid/EventGroup.h>
17#include <Guid/SmBios.h>
18#include <Library/DebugLib.h>
20#include <Library/UefiLib.h>
21#include <Library/BaseLib.h>
25#include <Library/PcdLib.h>
26#include <Library/HobLib.h>
28
29#define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')
30typedef struct {
31 UINT32 Signature;
32 EFI_HANDLE Handle;
33 //
34 // Produced protocol
35 //
37 //
38 // Updates to record list must be locked.
39 //
40 EFI_LOCK DataLock;
41 //
42 // List of EFI_SMBIOS_ENTRY structures.
43 //
44 LIST_ENTRY DataListHead;
45 //
46 // List of allocated SMBIOS handle.
47 //
48 LIST_ENTRY AllocatedHandleListHead;
50
51#define SMBIOS_INSTANCE_FROM_THIS(this) CR (this, SMBIOS_INSTANCE, Smbios, SMBIOS_INSTANCE_SIGNATURE)
52
53//
54// SMBIOS record Header
55//
56// An SMBIOS internal Record is an EFI_SMBIOS_RECORD_HEADER followed by (RecordSize - HeaderSize) bytes of
57// data. The format of the data is defined by the SMBIOS spec.
58//
59//
60#define EFI_SMBIOS_RECORD_HEADER_VERSION 0x0100
61typedef struct {
62 UINT16 Version;
63 UINT16 HeaderSize;
64 UINTN RecordSize;
65 EFI_HANDLE ProducerHandle;
66 UINTN NumberOfStrings;
68
69//
70// Private data structure to contain the SMBIOS record. One record per
71// structure. SmbiosRecord is a copy of the data passed in and follows RecordHeader .
72//
73#define EFI_SMBIOS_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'r', 'e', 'c')
74typedef struct {
75 UINT32 Signature;
76 LIST_ENTRY Link;
77 EFI_SMBIOS_RECORD_HEADER *RecordHeader;
78 UINTN RecordSize;
79 //
80 // Indicate which table this record is added to.
81 //
82 BOOLEAN Smbios32BitTable;
83 BOOLEAN Smbios64BitTable;
85
86#define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)
87
88//
89// Private data to contain the Smbios handle that already allocated.
90//
91#define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')
92
93typedef struct {
94 UINT32 Signature;
95 LIST_ENTRY Link;
96 //
97 // Filter driver will register what record guid filter should be used.
98 //
99 EFI_SMBIOS_HANDLE SmbiosHandle;
101
102#define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)
103
104typedef struct {
106 UINT8 Tailing[2];
108
116VOID
117EFIAPI
119 BOOLEAN Smbios32BitTable,
120 BOOLEAN Smbios64BitTable
121 );
122
134STATIC
135BOOLEAN
137 IN VOID *TableEntry,
138 OUT VOID **TableAddress,
139 OUT UINTN *TableMaximumSize,
140 OUT UINT8 *MajorVersion,
141 OUT UINT8 *MinorVersion
142 );
143
155STATIC
156BOOLEAN
158 IN VOID *TableEntry,
159 OUT VOID **TableAddress,
160 OUT UINTN *TableMaximumSize,
161 OUT UINT8 *MajorVersion,
162 OUT UINT8 *MinorVersion
163 );
164
176typedef
177BOOLEAN
179 IN VOID *TableEntry,
180 OUT VOID **TableAddress,
181 OUT UINTN *TableMaximumSize,
182 OUT UINT8 *MajorVersion,
183 OUT UINT8 *MinorVersion
184 );
185typedef struct {
186 EFI_GUID *Guid;
187 IS_SMBIOS_TABLE_VALID IsValid;
189
190#endif
UINT64 UINTN
#define STATIC
Definition: Base.h:264
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
STATIC BOOLEAN IsValidSmbios30Table(IN VOID *TableEntry, OUT VOID **TableAddress, OUT UINTN *TableMaximumSize, OUT UINT8 *MajorVersion, OUT UINT8 *MinorVersion)
Definition: SmbiosDxe.c:1531
STATIC BOOLEAN IsValidSmbios20Table(IN VOID *TableEntry, OUT VOID **TableAddress, OUT UINTN *TableMaximumSize, OUT UINT8 *MajorVersion, OUT UINT8 *MinorVersion)
Definition: SmbiosDxe.c:1451
BOOLEAN(* IS_SMBIOS_TABLE_VALID)(IN VOID *TableEntry, OUT VOID **TableAddress, OUT UINTN *TableMaximumSize, OUT UINT8 *MajorVersion, OUT UINT8 *MinorVersion)
Definition: SmbiosDxe.h:178
VOID EFIAPI SmbiosTableConstruction(BOOLEAN Smbios32BitTable, BOOLEAN Smbios64BitTable)
Definition: SmbiosDxe.c:1414
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
Definition: Base.h:213