]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
1374d7b135e2b6c26aaf0c4a784da35dd3af1dcd
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscSubclassDriver.h
1 /*++
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 <Protocol/DataHub.h>
29 #include <Protocol/WinNtIo.h>
30 #include <Library/BaseLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/HiiLibFramework.h>
33 #include <Library/UefiLib.h>
34 #include <Library/UefiDriverEntryPoint.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/MemoryAllocationLib.h>
37 #include <Library/UefiBootServicesTableLib.h>
38 #include <Library/DevicePathLib.h>
39
40 #include <MiscDevicePath.h>
41
42 //
43 // Data table entry update function.
44 //
45 typedef
46 EFI_STATUS
47 (EFIAPI EFI_MISC_SUBCLASS_DATA_FUNCTION) (
48 IN UINT16 RecordType,
49 IN UINT32 *RecordLen,
50 IN OUT EFI_MISC_SUBCLASS_RECORDS *RecordData,
51 OUT BOOLEAN *LogRecordData
52 );
53
54 //
55 // Data table entry definition.
56 //
57 typedef struct {
58 UINT16 RecordType;
59 UINT32 RecordLen;
60 VOID *RecordData;
61 EFI_MISC_SUBCLASS_DATA_FUNCTION *Function;
62 } EFI_MISC_SUBCLASS_DATA_TABLE;
63
64 //
65 // Data Table extern definitions.
66 //
67 #define MISC_SUBCLASS_TABLE_EXTERNS(NAME1, NAME2) \
68 extern NAME1 NAME2 ## Data; \
69 extern EFI_MISC_SUBCLASS_DATA_FUNCTION NAME2 ## Function
70
71 //
72 // Data Table entries
73 //
74 #define MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(NAME1, NAME2) { \
75 NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, NULL \
76 }
77
78 #define MISC_SUBCLASS_TABLE_ENTRY_FUNCTION_ONLY(NAME1, NAME2) \
79 { \
80 NAME1 ## _RECORD_NUMBER, 0, NULL, &NAME2 ## Function \
81 }
82
83 #define MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2, NAME3) \
84 { \
85 NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, &NAME3 ## Function \
86 }
87
88 //
89 // Global definition macros.
90 //
91 #define MISC_SUBCLASS_TABLE_DATA(NAME1, NAME2) NAME1 NAME2 ## Data
92
93 #define MISC_SUBCLASS_TABLE_FUNCTION(NAME2) \
94 EFI_STATUS EFIAPI NAME2 ## Function ( \
95 IN UINT16 RecordType, \
96 IN UINT32 *RecordLen, \
97 IN OUT EFI_MISC_SUBCLASS_RECORDS * RecordData, \
98 OUT BOOLEAN *LogRecordData \
99 )
100
101 //
102 // Data Table Array
103 //
104 extern EFI_MISC_SUBCLASS_DATA_TABLE mMiscSubclassDataTable[];
105
106 //
107 // Data Table Array Entries
108 //
109 extern UINTN mMiscSubclassDataTableEntries;
110
111 #endif /* _MISC_SUBCLASS_DRIVER_H */
112
113 /* eof - MiscSubclassDriver.h */