]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
Nt32Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscSubclassDriver.h
... / ...
CommitLineData
1/**@file\r
2\r
3Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
4SPDX-License-Identifier: BSD-2-Clause-Patent\r
5\r
6Module Name:\r
7\r
8 MiscSubclassDriver.h\r
9\r
10Abstract:\r
11\r
12 Header file for MiscSubclass Driver.\r
13\r
14**/\r
15\r
16#ifndef _MISC_SUBCLASS_DRIVER_H\r
17#define _MISC_SUBCLASS_DRIVER_H\r
18\r
19#include <FrameworkDxe.h>\r
20#include <WinNtDxe.h>\r
21#include <Guid/DataHubRecords.h>\r
22#include <IndustryStandard/SmBios.h>\r
23#include <Protocol/Smbios.h>\r
24#include <Protocol/WinNtIo.h>\r
25#include <Library/BaseLib.h>\r
26#include <Library/DebugLib.h>\r
27#include <Library/HiiLib.h>\r
28#include <Library/UefiLib.h>\r
29#include <Library/UefiDriverEntryPoint.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/UefiBootServicesTableLib.h>\r
32#include <Library/DevicePathLib.h>\r
33#include <Library/PcdLib.h>\r
34#include <Library/MemoryAllocationLib.h>\r
35#include <MiscDevicePath.h>\r
36\r
37\r
38//\r
39// Data table entry update function.\r
40//\r
41typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (\r
42 IN VOID *RecordData,\r
43 IN EFI_SMBIOS_PROTOCOL *Smbios\r
44 );\r
45\r
46//\r
47// Data table entry definition.\r
48//\r
49typedef struct {\r
50 //\r
51 // intermediat input data for SMBIOS record\r
52 //\r
53 VOID *RecordData;\r
54 EFI_MISC_SMBIOS_DATA_FUNCTION *Function;\r
55} EFI_MISC_SMBIOS_DATA_TABLE;\r
56\r
57//\r
58// Data Table extern definitions.\r
59//\r
60#define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r
61extern NAME1 NAME2 ## Data; \\r
62extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function\r
63\r
64\r
65//\r
66// Data Table entries\r
67//\r
68#define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r
69{ \\r
70 & NAME1 ## Data, \\r
71 & NAME2 ## Function \\r
72}\r
73\r
74//\r
75// Global definition macros.\r
76//\r
77#define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \\r
78 NAME1 NAME2 ## Data\r
79\r
80#define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \\r
81 EFI_STATUS EFIAPI NAME2 ## Function( \\r
82 IN VOID *RecordData, \\r
83 IN EFI_SMBIOS_PROTOCOL *Smbios \\r
84 )\r
85\r
86\r
87//\r
88// Data Table Array\r
89//\r
90extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];\r
91\r
92//\r
93// Data Table Array Entries\r
94//\r
95extern UINTN mMiscSubclassDataTableEntries;\r
96extern UINT8 MiscSubclassStrings[];\r
97extern EFI_HII_HANDLE mHiiHandle;\r
98\r
99\r
100/**\r
101 Add an SMBIOS record.\r
102\r
103 @param Smbios The EFI_SMBIOS_PROTOCOL instance.\r
104 @param SmbiosHandle A unique handle will be assigned to the SMBIOS record.\r
105 @param Record The data for the fixed portion of the SMBIOS record. The format of the record is\r
106 determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
107 by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
108 a set of null terminated strings and a null.\r
109\r
110 @retval EFI_SUCCESS Record was added.\r
111 @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.\r
112\r
113**/\r
114EFI_STATUS\r
115AddSmbiosRecord (\r
116 IN EFI_SMBIOS_PROTOCOL *Smbios,\r
117 OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r
118 IN EFI_SMBIOS_TABLE_HEADER *Record\r
119 );\r
120\r
121#endif /* _MISC_SUBCLASS_DRIVER_H */\r
122\r
123/* eof - MiscSubclassDriver.h */\r