]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h
8f90e998c67afa9705713d67ae0fade8bb434d14
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / DataHubDxe / DataHub.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 DataHub.h
15
16 Abstract:
17 This code supports a the private implementation
18 of the Data Hub protocol
19
20 --*/
21
22 #ifndef _DATA_HUB_H_
23 #define _DATA_HUB_H_
24
25 //
26 // The package level header files this module uses
27 //
28 #include <PiDxe.h>
29 //
30 // The protocols, PPI and GUID defintions for this module
31 //
32 #include <Protocol/DataHub.h>
33 //
34 // The Library classes this module consumes
35 //
36 #include <Library/DebugLib.h>
37 #include <Library/UefiDriverEntryPoint.h>
38 #include <Library/UefiLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/BaseMemoryLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/UefiBootServicesTableLib.h>
43 #include <Library/UefiRuntimeServicesTableLib.h>
44
45 #define DATA_HUB_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('D', 'H', 'u', 'b')
46 typedef struct {
47 UINT32 Signature;
48
49 EFI_HANDLE Handle;
50
51 //
52 // Produced protocol(s)
53 //
54 EFI_DATA_HUB_PROTOCOL DataHub;
55
56 //
57 // Private Data
58 //
59 //
60 // Updates to GlobalMonotonicCount, LogListHead, and FilterDriverListHead
61 // must be locked.
62 //
63 EFI_LOCK DataLock;
64
65 //
66 // Runing Monotonic Count to use for each error record.
67 // Increment AFTER use in an error record.
68 //
69 UINT64 GlobalMonotonicCount;
70
71 //
72 // List of EFI_DATA_ENTRY structures. This is the data log! The list
73 // must be in assending order of LogMonotonicCount.
74 //
75 LIST_ENTRY DataListHead;
76
77 //
78 // List of EFI_DATA_HUB_FILTER_DRIVER structures. Represents all
79 // the registered filter drivers.
80 //
81 LIST_ENTRY FilterDriverListHead;
82
83 } DATA_HUB_INSTANCE;
84
85 #define DATA_HUB_INSTANCE_FROM_THIS(this) CR (this, DATA_HUB_INSTANCE, DataHub, DATA_HUB_INSTANCE_SIGNATURE)
86
87 //
88 // Private data structure to contain the data log. One record per
89 // structure. Head pointer to the list is the Log member of
90 // EFI_DATA_ENTRY. Record is a copy of the data passed in.
91 //
92 #define EFI_DATA_ENTRY_SIGNATURE EFI_SIGNATURE_32 ('D', 'r', 'e', 'c')
93 typedef struct {
94 UINT32 Signature;
95 LIST_ENTRY Link;
96
97 EFI_DATA_RECORD_HEADER *Record;
98
99 UINTN RecordSize;
100
101 } EFI_DATA_ENTRY;
102
103 #define DATA_ENTRY_FROM_LINK(link) CR (link, EFI_DATA_ENTRY, Link, EFI_DATA_ENTRY_SIGNATURE)
104
105 //
106 // Private data to contain the filter driver Event and it's
107 // associated EFI_TPL.
108 //
109 #define EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('D', 'h', 'F', 'd')
110
111 typedef struct {
112 UINT32 Signature;
113 LIST_ENTRY Link;
114
115 //
116 // Store Filter Driver Event and Tpl level it can be Signaled at.
117 //
118 EFI_EVENT Event;
119 EFI_TPL Tpl;
120
121 //
122 // Monotonic count on the get next operation for Event.
123 // Zero indicates get next has not been called for this event yet.
124 //
125 UINT64 GetNextMonotonicCount;
126
127 //
128 // Filter driver will register what class filter should be used.
129 //
130 UINT64 ClassFilter;
131
132 //
133 // Filter driver will register what record guid filter should be used.
134 //
135 EFI_GUID FilterDataRecordGuid;
136
137 } DATA_HUB_FILTER_DRIVER;
138
139 #define FILTER_ENTRY_FROM_LINK(link) CR (link, DATA_HUB_FILTER_DRIVER, Link, EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE)
140
141 #endif