]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
5d942ecb9ef8dfe8242801902b77669129b27170
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscSubclassDriver.h
1 /**@file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 MiscSubclassDriver.h
15
16 Abstract:
17
18 Header file for MiscSubclass Driver.
19
20 **/
21
22 #ifndef _MISC_SUBCLASS_DRIVER_H
23 #define _MISC_SUBCLASS_DRIVER_H
24
25 #include <FrameworkDxe.h>
26 #include <WinNtDxe.h>
27 #include <Guid/DataHubRecords.h>
28 #include <Guid/DataHubProducer.h>
29 #include <Protocol/DataHub.h>
30 #include <Protocol/WinNtIo.h>
31 #include <Library/BaseLib.h>
32 #include <Library/DebugLib.h>
33 #include <Library/FrameworkHiiLib.h>
34 #include <Library/UefiLib.h>
35 #include <Library/UefiDriverEntryPoint.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/UefiBootServicesTableLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/PcdLib.h>
40
41 #include <MiscDevicePath.h>
42
43 //
44 // Data table entry update function.
45 //
46 typedef
47 EFI_STATUS
48 (EFIAPI EFI_MISC_SUBCLASS_DATA_FUNCTION) (
49 IN UINT16 RecordType,
50 IN UINT32 *RecordLen,
51 IN OUT EFI_MISC_SUBCLASS_RECORDS *RecordData,
52 OUT BOOLEAN *LogRecordData
53 );
54
55 //
56 // Data table entry definition.
57 //
58 typedef struct {
59 UINT16 RecordType;
60 UINT32 RecordLen;
61 VOID *RecordData;
62 EFI_MISC_SUBCLASS_DATA_FUNCTION *Function;
63 } EFI_MISC_SUBCLASS_DATA_TABLE;
64
65 //
66 // Data Table extern definitions.
67 //
68 #define MISC_SUBCLASS_TABLE_EXTERNS(NAME1, NAME2) \
69 extern NAME1 NAME2 ## Data; \
70 extern EFI_MISC_SUBCLASS_DATA_FUNCTION NAME2 ## Function
71
72 //
73 // Data Table entries
74 //
75 #define MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(NAME1, NAME2) { \
76 NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, NULL \
77 }
78
79 #define MISC_SUBCLASS_TABLE_ENTRY_FUNCTION_ONLY(NAME1, NAME2) \
80 { \
81 NAME1 ## _RECORD_NUMBER, 0, NULL, &NAME2 ## Function \
82 }
83
84 #define MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2, NAME3) \
85 { \
86 NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, &NAME3 ## Function \
87 }
88
89 //
90 // Global definition macros.
91 //
92 #define MISC_SUBCLASS_TABLE_DATA(NAME1, NAME2) NAME1 NAME2 ## Data
93
94 #define MISC_SUBCLASS_TABLE_FUNCTION(NAME2) \
95 EFI_STATUS EFIAPI NAME2 ## Function ( \
96 IN UINT16 RecordType, \
97 IN UINT32 *RecordLen, \
98 IN OUT EFI_MISC_SUBCLASS_RECORDS * RecordData, \
99 OUT BOOLEAN *LogRecordData \
100 )
101
102 //
103 // Data Table Array
104 //
105 extern EFI_MISC_SUBCLASS_DATA_TABLE mMiscSubclassDataTable[];
106
107 //
108 // Data Table Array Entries
109 //
110 extern UINTN mMiscSubclassDataTableEntries;
111
112 #endif /* _MISC_SUBCLASS_DRIVER_H */
113
114 /* eof - MiscSubclassDriver.h */