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