]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.h
Update HiiBlockToConfig function to follow spec.
[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
0ddd8553 4Copyright (c) 2009 - 2011, 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
34#define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')\r
35typedef 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
66typedef 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
80typedef struct {\r
81 UINT32 Signature;\r
82 LIST_ENTRY Link;\r
83 EFI_SMBIOS_RECORD_HEADER *RecordHeader;\r
84 UINTN RecordSize;\r
85} EFI_SMBIOS_ENTRY;\r
86\r
87#define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)\r
88\r
89//\r
90// Private data to contain the Smbios handle that already allocated.\r
91//\r
92#define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')\r
93\r
94typedef struct {\r
95 UINT32 Signature;\r
96 LIST_ENTRY Link;\r
97 //\r
98 // Filter driver will register what record guid filter should be used.\r
99 //\r
100 EFI_SMBIOS_HANDLE SmbiosHandle;\r
101\r
102} SMBIOS_HANDLE_ENTRY;\r
103\r
104#define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)\r
105\r
106typedef struct {\r
107 EFI_SMBIOS_TABLE_HEADER Header;\r
108 UINT8 Tailing[2];\r
109} EFI_SMBIOS_TABLE_END_STRUCTURE;\r
110\r
0ddd8553 111/**\r
112 Create Smbios Table and installs the Smbios Table to the System Table.\r
113**/\r
114VOID\r
115EFIAPI\r
116SmbiosTableConstruction (\r
117 VOID\r
118 );\r
119\r
310b04e6 120#endif\r