]>
Commit | Line | Data |
---|---|---|
310b04e6 | 1 | /** @file\r |
2 | This code supports the implementation of the Smbios protocol\r | |
3 | \r | |
4 | Copyright (c) 2009, Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
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 | |
32 | \r | |
33 | #define SMBIOS_MAJOR_VERSION 2\r | |
34 | #define SMBIOS_MINOR_VERSION 4\r | |
35 | \r | |
36 | \r | |
37 | #define SMBIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('S', 'B', 'i', 's')\r | |
38 | typedef struct {\r | |
39 | UINT32 Signature;\r | |
40 | EFI_HANDLE Handle;\r | |
41 | //\r | |
42 | // Produced protocol\r | |
43 | //\r | |
44 | EFI_SMBIOS_PROTOCOL Smbios;\r | |
45 | //\r | |
46 | // Updates to record list must be locked.\r | |
47 | //\r | |
48 | EFI_LOCK DataLock;\r | |
49 | //\r | |
50 | // List of EFI_SMBIOS_ENTRY structures.\r | |
51 | //\r | |
52 | LIST_ENTRY DataListHead;\r | |
53 | //\r | |
54 | // List of allocated SMBIOS handle.\r | |
55 | //\r | |
56 | LIST_ENTRY AllocatedHandleListHead;\r | |
57 | } SMBIOS_INSTANCE;\r | |
58 | \r | |
59 | #define SMBIOS_INSTANCE_FROM_THIS(this) CR (this, SMBIOS_INSTANCE, Smbios, SMBIOS_INSTANCE_SIGNATURE)\r | |
60 | \r | |
61 | //\r | |
62 | // SMBIOS record Header\r | |
63 | //\r | |
64 | // An SMBIOS internal Record is an EFI_SMBIOS_RECORD_HEADER followed by (RecordSize - HeaderSize) bytes of\r | |
65 | // data. The format of the data is defined by the SMBIOS spec.\r | |
66 | //\r | |
67 | //\r | |
68 | #define EFI_SMBIOS_RECORD_HEADER_VERSION 0x0100\r | |
69 | typedef struct {\r | |
70 | UINT16 Version;\r | |
71 | UINT16 HeaderSize;\r | |
72 | UINTN RecordSize;\r | |
73 | EFI_HANDLE ProducerHandle;\r | |
74 | UINTN NumberOfStrings;\r | |
75 | } EFI_SMBIOS_RECORD_HEADER;\r | |
76 | \r | |
77 | \r | |
78 | //\r | |
79 | // Private data structure to contain the SMBIOS record. One record per\r | |
80 | // structure. SmbiosRecord is a copy of the data passed in and follows RecordHeader .\r | |
81 | //\r | |
82 | #define EFI_SMBIOS_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'r', 'e', 'c')\r | |
83 | typedef struct {\r | |
84 | UINT32 Signature;\r | |
85 | LIST_ENTRY Link;\r | |
86 | EFI_SMBIOS_RECORD_HEADER *RecordHeader;\r | |
87 | UINTN RecordSize;\r | |
88 | } EFI_SMBIOS_ENTRY;\r | |
89 | \r | |
90 | #define SMBIOS_ENTRY_FROM_LINK(link) CR (link, EFI_SMBIOS_ENTRY, Link, EFI_SMBIOS_ENTRY_SIGNATURE)\r | |
91 | \r | |
92 | //\r | |
93 | // Private data to contain the Smbios handle that already allocated.\r | |
94 | //\r | |
95 | #define SMBIOS_HANDLE_ENTRY_SIGNATURE SIGNATURE_32 ('S', 'h', 'r', 'd')\r | |
96 | \r | |
97 | typedef struct {\r | |
98 | UINT32 Signature;\r | |
99 | LIST_ENTRY Link;\r | |
100 | //\r | |
101 | // Filter driver will register what record guid filter should be used.\r | |
102 | //\r | |
103 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
104 | \r | |
105 | } SMBIOS_HANDLE_ENTRY;\r | |
106 | \r | |
107 | #define SMBIOS_HANDLE_ENTRY_FROM_LINK(link) CR (link, SMBIOS_HANDLE_ENTRY, Link, SMBIOS_HANDLE_ENTRY_SIGNATURE)\r | |
108 | \r | |
109 | typedef struct {\r | |
110 | EFI_SMBIOS_TABLE_HEADER Header;\r | |
111 | UINT8 Tailing[2];\r | |
112 | } EFI_SMBIOS_TABLE_END_STRUCTURE;\r | |
113 | \r | |
114 | #endif\r |