1 | /* $Id: DataHub.h 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DataHub.h
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2022 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | #ifndef __DATA_HUB_H__
|
---|
38 | #define __DATA_HUB_H__
|
---|
39 |
|
---|
40 | #define EFI_DATA_HUB_PROTOCOL_GUID \
|
---|
41 | { 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
|
---|
42 |
|
---|
43 | typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;
|
---|
44 |
|
---|
45 |
|
---|
46 | #define EFI_DATA_RECORD_HEADER_VERSION 0x0100
|
---|
47 |
|
---|
48 | #define EFI_DATA_CLASS_DEBUG 0x1ULL
|
---|
49 | #define EFI_DATA_CLASS_ERROR 0x2ULL
|
---|
50 | #define EFI_DATA_CLASS_DATA 0x4ULL
|
---|
51 | #define EFI_DATA_CLASS_PROGRESS_CODE 0x8ULL
|
---|
52 |
|
---|
53 | typedef struct {
|
---|
54 | UINT16 Version;
|
---|
55 | UINT16 HeaderSize;
|
---|
56 | UINT32 RecordSize;
|
---|
57 | EFI_GUID DataRecordGuid;
|
---|
58 | EFI_GUID ProducerName;
|
---|
59 | UINT64 DataRecordClass;
|
---|
60 | EFI_TIME LogTime;
|
---|
61 | UINT64 LogMonotonicCount;
|
---|
62 | } EFI_DATA_RECORD_HEADER;
|
---|
63 |
|
---|
64 | typedef
|
---|
65 | EFI_STATUS
|
---|
66 | (EFIAPI *EFI_DATA_HUB_LOG_DATA) (
|
---|
67 | IN EFI_DATA_HUB_PROTOCOL *This,
|
---|
68 | IN EFI_GUID *DataRecordGuid,
|
---|
69 | IN EFI_GUID *ProducerName,
|
---|
70 | IN UINT64 DataRecordClass,
|
---|
71 | IN VOID *RawData,
|
---|
72 | IN UINT32 RawDataSize
|
---|
73 | )
|
---|
74 | /*++
|
---|
75 |
|
---|
76 | Routine Description:
|
---|
77 | Logs a data record to the system event log.
|
---|
78 |
|
---|
79 | Arguments:
|
---|
80 | This - Protocol instance pointer.
|
---|
81 |
|
---|
82 |
|
---|
83 | Returns:
|
---|
84 | EFI_SUCCESS - Data was logged.
|
---|
85 |
|
---|
86 | --*/
|
---|
87 | ;
|
---|
88 |
|
---|
89 |
|
---|
90 | typedef
|
---|
91 | EFI_STATUS
|
---|
92 | (EFIAPI *EFI_DATA_HUB_GET_NEXT_DATA_RECORD) (
|
---|
93 | IN EFI_DATA_HUB_PROTOCOL *This,
|
---|
94 | IN OUT UINT64 *MonotonicCount,
|
---|
95 | IN EFI_EVENT *FilterDriver OPTIONAL,
|
---|
96 | OUT EFI_DATA_RECORD_HEADER **Record
|
---|
97 | )
|
---|
98 | /*++
|
---|
99 |
|
---|
100 | Routine Description:
|
---|
101 | Allows the system data log to be searched.
|
---|
102 |
|
---|
103 | Arguments:
|
---|
104 | This - Protocol instance pointer.
|
---|
105 |
|
---|
106 |
|
---|
107 | Returns:
|
---|
108 | EFI_SUCCESS - Data was logged.
|
---|
109 |
|
---|
110 | --*/
|
---|
111 | ;
|
---|
112 |
|
---|
113 |
|
---|
114 | typedef
|
---|
115 | EFI_STATUS
|
---|
116 | (EFIAPI *EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER) (
|
---|
117 | IN EFI_DATA_HUB_PROTOCOL *This,
|
---|
118 | IN EFI_EVENT FilterEvent,
|
---|
119 | IN EFI_TPL FilterTpl,
|
---|
120 | IN UINT64 FilterClass,
|
---|
121 | IN EFI_GUID *FilterDataRecordGui OPTIONAL
|
---|
122 | )
|
---|
123 | /*++
|
---|
124 |
|
---|
125 | Routine Description:
|
---|
126 | Registers an event to be signaled evey time a data record is logged in the system.
|
---|
127 |
|
---|
128 | Arguments:
|
---|
129 | This - Protocol instance pointer.
|
---|
130 |
|
---|
131 |
|
---|
132 | Returns:
|
---|
133 | EFI_SUCCESS - The filter driver event was registered.
|
---|
134 |
|
---|
135 | --*/
|
---|
136 | ;
|
---|
137 |
|
---|
138 |
|
---|
139 | typedef
|
---|
140 | EFI_STATUS
|
---|
141 | (EFIAPI *EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER) (
|
---|
142 | IN EFI_DATA_HUB_PROTOCOL *This,
|
---|
143 | IN EFI_EVENT FilterEvent
|
---|
144 | )
|
---|
145 | /*++
|
---|
146 |
|
---|
147 | Routine Description:
|
---|
148 | Stops a filter driver from being notified when data records are logged.
|
---|
149 |
|
---|
150 | Arguments:
|
---|
151 | This - Protocol instance pointer.
|
---|
152 |
|
---|
153 |
|
---|
154 | Returns:
|
---|
155 | EFI_SUCCESS - The filter driver represented by FilterEvent was shut off.
|
---|
156 |
|
---|
157 | --*/
|
---|
158 | ;
|
---|
159 |
|
---|
160 |
|
---|
161 | struct _EFI_DATA_HUB_PROTOCOL {
|
---|
162 | EFI_DATA_HUB_LOG_DATA LogData;
|
---|
163 | EFI_DATA_HUB_GET_NEXT_DATA_RECORD GetNextDataRecord;
|
---|
164 | EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER RegisterFilterDriver;
|
---|
165 | EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER UnregisterFilterDriver;
|
---|
166 | };
|
---|
167 |
|
---|
168 | extern EFI_GUID gEfiDataHubProtocolGuid;
|
---|
169 |
|
---|
170 |
|
---|
171 | EFI_STATUS
|
---|
172 | EFIAPI
|
---|
173 | InitializeDataHub (
|
---|
174 | IN EFI_HANDLE ImageHandle,
|
---|
175 | IN EFI_SYSTEM_TABLE *SystemTable
|
---|
176 | );
|
---|
177 |
|
---|
178 | #endif
|
---|