]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.h
7462086344ade7523a3b4151f1c1d50e5db2a2c0
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Generic / RuntimeDxe / StatusCode / Lib / BsDataHubStatusCode / BsDataHubStatusCode.h
1 /*++
2
3 Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
4 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 BsDataHubStatusCode.h
15
16 Abstract:
17
18 Header for the status code data hub logging component
19
20 --*/
21
22 #ifndef _EFI_BS_DATA_HUB_STATUS_CODE_H_
23 #define _EFI_BS_DATA_HUB_STATUS_CODE_H_
24
25
26 // Statements that include other files.
27 //
28 #include "Tiano.h"
29 #include "EfiCommonLib.h"
30 #include "EfiRuntimeLib.h"
31 #include "EfiPrintLib.h"
32 #include "EfiStatusCode.h"
33
34 //
35 // Dependent protocols
36 //
37 #include EFI_PROTOCOL_DEPENDENCY (DataHub)
38
39 //
40 // Consumed protocols
41 //
42 #include EFI_ARCH_PROTOCOL_CONSUMER (StatusCode)
43
44 //
45 // GUID definitions
46 //
47 #include EFI_GUID_DEFINITION (StatusCode)
48 #include EFI_GUID_DEFINITION (StatusCodeCallerId)
49 #include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
50
51 //
52 // Private data declarations
53 //
54 #define MAX_RECORD_NUM 1000
55 #define BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE
56 #define BYTES_PER_BUFFER (BYTES_PER_RECORD * sizeof (UINT8))
57
58 #define BS_DATA_HUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')
59
60 typedef struct {
61 UINTN Signature;
62 EFI_LIST_ENTRY Node;
63 UINT8 Data[BYTES_PER_RECORD];
64 } DATAHUB_STATUSCODE_RECORD;
65
66 //
67 // Function prototypes
68 //
69 EFI_STATUS
70 EFIAPI
71 BsDataHubInitializeStatusCode (
72 IN EFI_HANDLE ImageHandle,
73 IN EFI_SYSTEM_TABLE *SystemTable
74 );
75 /*++
76
77 Routine Description:
78
79 Install a data hub listener.
80
81 Arguments:
82
83 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
84
85 Returns:
86
87 EFI_SUCCESS - Logging Hub protocol installed
88 Other - No protocol installed, unload driver.
89
90 --*/
91
92 EFI_STATUS
93 EFIAPI
94 BsDataHubReportStatusCode (
95 IN EFI_STATUS_CODE_TYPE CodeType,
96 IN EFI_STATUS_CODE_VALUE Value,
97 IN UINT32 Instance,
98 IN EFI_GUID * CallerId,
99 IN EFI_STATUS_CODE_DATA * Data OPTIONAL
100 );
101 /*++
102
103 Routine Description:
104
105 Boot service report status code listener. This function logs the status code
106 into the data hub.
107
108 Arguments:
109
110 Same as gRT->ReportStatusCode (See Tiano Runtime Specification)
111
112 Returns:
113
114 None
115
116 --*/
117
118 VOID
119 EFIAPI
120 LogDataHubEventHandler (
121 IN EFI_EVENT Event,
122 IN VOID *Context
123 );
124 /*++
125
126 Routine Description:
127
128 The Event handler which will be notified to log data in Data Hub.
129
130 Arguments:
131
132 Event - Instance of the EFI_EVENT to signal whenever data is
133 available to be logged in the system.
134 Context - Context of the event.
135
136 Returns:
137
138 None.
139
140 --*/
141 #endif