]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.h
Initial import.
[mirror_edk2.git] / EdkModulePkg / Universal / DataHub / DataHub / Dxe / 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 #define DATA_HUB_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('D', 'H', 'u', 'b')
27 typedef struct {
28 UINT32 Signature;
29
30 EFI_HANDLE Handle;
31
32 //
33 // Produced protocol(s)
34 //
35 EFI_DATA_HUB_PROTOCOL DataHub;
36
37 //
38 // Private Data
39 //
40 //
41 // Updates to GlobalMonotonicCount, LogListHead, and FilterDriverListHead
42 // must be locked.
43 //
44 EFI_LOCK DataLock;
45
46 //
47 // Runing Monotonic Count to use for each error record.
48 // Increment AFTER use in an error record.
49 //
50 UINT64 GlobalMonotonicCount;
51
52 //
53 // List of EFI_DATA_ENTRY structures. This is the data log! The list
54 // must be in assending order of LogMonotonicCount.
55 //
56 LIST_ENTRY DataListHead;
57
58 //
59 // List of EFI_DATA_HUB_FILTER_DRIVER structures. Represents all
60 // the registered filter drivers.
61 //
62 LIST_ENTRY FilterDriverListHead;
63
64 } DATA_HUB_INSTANCE;
65
66 #define DATA_HUB_INSTANCE_FROM_THIS(this) CR (this, DATA_HUB_INSTANCE, DataHub, DATA_HUB_INSTANCE_SIGNATURE)
67
68 //
69 // Private data structure to contain the data log. One record per
70 // structure. Head pointer to the list is the Log member of
71 // EFI_DATA_ENTRY. Record is a copy of the data passed in.
72 //
73 #define EFI_DATA_ENTRY_SIGNATURE EFI_SIGNATURE_32 ('D', 'r', 'e', 'c')
74 typedef struct {
75 UINT32 Signature;
76 LIST_ENTRY Link;
77
78 EFI_DATA_RECORD_HEADER *Record;
79
80 UINTN RecordSize;
81
82 } EFI_DATA_ENTRY;
83
84 #define DATA_ENTRY_FROM_LINK(link) CR (link, EFI_DATA_ENTRY, Link, EFI_DATA_ENTRY_SIGNATURE)
85
86 //
87 // Private data to contain the filter driver Event and it's
88 // associated EFI_TPL.
89 //
90 #define EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('D', 'h', 'F', 'd')
91
92 typedef struct {
93 UINT32 Signature;
94 LIST_ENTRY Link;
95
96 //
97 // Store Filter Driver Event and Tpl level it can be Signaled at.
98 //
99 EFI_EVENT Event;
100 EFI_TPL Tpl;
101
102 //
103 // Monotonic count on the get next operation for Event.
104 // Zero indicates get next has not been called for this event yet.
105 //
106 UINT64 GetNextMonotonicCount;
107
108 //
109 // Filter driver will register what class filter should be used.
110 //
111 UINT64 ClassFilter;
112
113 //
114 // Filter driver will register what record guid filter should be used.
115 //
116 EFI_GUID FilterDataRecordGuid;
117
118 } DATA_HUB_FILTER_DRIVER;
119
120 #define FILTER_ENTRY_FROM_LINK(link) CR (link, DATA_HUB_FILTER_DRIVER, Link, EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE)
121
122 #endif