]> git.proxmox.com Git - mirror_edk2.git/blob - EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h
EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
[mirror_edk2.git] / EmulatorPkg / MiscSubClassPlatformDxe / MiscSubClassDriver.h
1 /*++
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
21 #include <Guid/DataHubRecords.h>
22 #include <IndustryStandard/SmBios.h>
23 #include <Protocol/Smbios.h>
24 #include <Protocol/EmuIoThunk.h>
25
26 #include <Library/BaseLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/HiiLib.h>
29 #include <Library/UefiLib.h>
30 #include <Library/UefiDriverEntryPoint.h>
31 #include <Library/BaseMemoryLib.h>
32 #include <Library/MemoryAllocationLib.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/DevicePathLib.h>
35 #include <Library/PcdLib.h>
36
37
38 #include <MiscDevicePath.h>
39 #include <Protocol/FrameworkHii.h>
40 #include <Library/HiiLib.h>
41
42 //
43 // Data table entry update function.
44 //
45 typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (
46 IN VOID *RecordData,
47 IN EFI_SMBIOS_PROTOCOL *Smbios
48 );
49
50 //
51 // Data table entry definition.
52 //
53 typedef struct {
54 //
55 // intermediat input data for SMBIOS record
56 //
57 VOID *RecordData;
58 EFI_MISC_SMBIOS_DATA_FUNCTION *Function;
59 } EFI_MISC_SMBIOS_DATA_TABLE;
60
61 //
62 // Data Table extern definitions.
63 //
64 #define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \
65 extern NAME1 NAME2 ## Data; \
66 extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function
67
68
69 //
70 // Data Table entries
71 //
72 #define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \
73 { \
74 & NAME1 ## Data, \
75 & NAME2 ## Function \
76 }
77
78 //
79 // Global definition macros.
80 //
81 #define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \
82 NAME1 NAME2 ## Data
83
84 #define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \
85 EFI_STATUS EFIAPI NAME2 ## Function( \
86 IN VOID *RecordData, \
87 IN EFI_SMBIOS_PROTOCOL *Smbios \
88 )
89
90
91 //
92 // Data Table Array
93 //
94 extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];
95
96 //
97 // Data Table Array Entries
98 //
99 extern UINTN mMiscSubclassDataTableEntries;
100 extern UINT8 MiscSubclassStrings[];
101 extern EFI_HII_HANDLE mHiiHandle;
102
103 /**
104 Add an SMBIOS record.
105
106 @param Smbios The EFI_SMBIOS_PROTOCOL instance.
107 @param SmbiosHandle A unique handle will be assigned to the SMBIOS record.
108 @param Record The data for the fixed portion of the SMBIOS record. The format of the record is
109 determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined
110 by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or
111 a set of null terminated strings and a null.
112
113 @retval EFI_SUCCESS Record was added.
114 @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.
115
116 **/
117 EFI_STATUS
118 AddSmbiosRecord (
119 IN EFI_SMBIOS_PROTOCOL *Smbios,
120 OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
121 IN EFI_SMBIOS_TABLE_HEADER *Record
122 );
123
124 #endif /* _MISC_SUBCLASS_DRIVER_H */
125
126 /* eof - MiscSubclassDriver.h */