]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.h
Enhance SmbiosDxe driver:
[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
4233bf70 4Copyright (c) 2009 - 2012, 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
310b04e6 41#define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')\r
42typedef struct {\r
43 UINT32 Signature;\r
44 EFI_HANDLE Handle;\r
45 //\r
46 // Produced protocol\r
47 //\r
48 EFI_SMBIOS_PROTOCOL Smbios;\r
49 //\r
50 // Updates to record list must be locked.\r
51 //\r
52 EFI_LOCK DataLock;\r
53 //\r
54 // List of EFI_SMBIOS_ENTRY structures.\r
55 //\r
56 LIST_ENTRY DataListHead;\r
57 //\r
58 // List of allocated SMBIOS handle.\r
59 //\r
60 LIST_ENTRY AllocatedHandleListHead;\r
61} SMBIOS_INSTANCE;\r
62\r
63#define SMBIOS_INSTANCE_FROM_THIS(this) CR (this, SMBIOS_INSTANCE, Smbios, SMBIOS_INSTANCE_SIGNATURE)\r
64\r
65//\r
66// SMBIOS record Header\r
67//\r
68// An SMBIOS internal Record is an EFI_SMBIOS_RECORD_HEADER followed by (RecordSize - HeaderSize) bytes of\r
69// data. The format of the data is defined by the SMBIOS spec.\r
70//\r
71//\r
72#define EFI_SMBIOS_RECORD_HEADER_VERSION 0x0100\r
73typedef struct {\r
74 UINT16 Version;\r
75 UINT16 HeaderSize;\r
76 UINTN RecordSize;\r
77 EFI_HANDLE ProducerHandle;\r
78 UINTN NumberOfStrings;\r
79} EFI_SMBIOS_RECORD_HEADER;\r
80\r
81\r
82//\r
83// Private data structure to contain the SMBIOS record. One record per\r
84// structure. SmbiosRecord is a copy of the data passed in and follows RecordHeader .\r
85//\r
86#define EFI_SMBIOS_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'r', 'e', 'c')\r
87typedef struct {\r
88 UINT32 Signature;\r
89 LIST_ENTRY Link;\r
90 EFI_SMBIOS_RECORD_HEADER *RecordHeader;\r
91 UINTN RecordSize;\r
92} EFI_SMBIOS_ENTRY;\r
93\r
94#define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)\r
95\r
96//\r
97// Private data to contain the Smbios handle that already allocated.\r
98//\r
99#define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')\r
100\r
101typedef struct {\r
102 UINT32 Signature;\r
103 LIST_ENTRY Link;\r
104 //\r
105 // Filter driver will register what record guid filter should be used.\r
106 //\r
107 EFI_SMBIOS_HANDLE SmbiosHandle;\r
108\r
109} SMBIOS_HANDLE_ENTRY;\r
110\r
111#define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)\r
112\r
113typedef struct {\r
114 EFI_SMBIOS_TABLE_HEADER Header;\r
115 UINT8 Tailing[2];\r
116} EFI_SMBIOS_TABLE_END_STRUCTURE;\r
117\r
0ddd8553 118/**\r
119 Create Smbios Table and installs the Smbios Table to the System Table.\r
120**/\r
121VOID\r
122EFIAPI\r
123SmbiosTableConstruction (\r
124 VOID\r
125 );\r
126\r
310b04e6 127#endif\r