3 Copyright (c) 2004 - 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
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.
18 Header for the status code data hub logging component
22 #ifndef _EFI_BS_DATA_HUB_STATUS_CODE_H_
23 #define _EFI_BS_DATA_HUB_STATUS_CODE_H_
26 // Statements that include other files.
29 #include "EfiCommonLib.h"
30 #include "EfiRuntimeLib.h"
31 #include "EfiPrintLib.h"
32 #include "EfiStatusCode.h"
35 // Dependent protocols
37 #include EFI_PROTOCOL_DEPENDENCY (DataHub)
42 #include EFI_ARCH_PROTOCOL_CONSUMER (StatusCode)
47 #include EFI_GUID_DEFINITION (StatusCode)
48 #include EFI_GUID_DEFINITION (StatusCodeCallerId)
49 #include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
52 // Private data declarations
54 #define MAX_RECORD_NUM 1000
55 #define INITIAL_RECORD_NUM 20
56 #define BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE
57 #define BYTES_PER_BUFFER (BYTES_PER_RECORD * sizeof (UINT8))
59 #define BS_DATA_HUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')
64 UINT8 RecordBuffer
[BYTES_PER_RECORD
];
65 } STATUS_CODE_RECORD_LIST
;
68 // Function prototypes
70 STATUS_CODE_RECORD_LIST
*
71 AllocateRecordBuffer (
78 Allocate a new record list node and initialize it.
79 Inserting the node into the list isn't the task of this function.
87 A pointer to the new allocated node or NULL if non available
91 DATA_HUB_STATUS_CODE_DATA_RECORD
*
92 AquireEmptyRecordBuffer (
99 Acquire an empty record buffer from the record list if there's free node,
100 or allocate one new node and insert it to the list if the list is full and
101 the function isn't run in EFI_TPL_HIGH_LEVEL.
109 Pointer to new record buffer. NULL if none available.
114 ReleaseRecordBuffer (
115 IN STATUS_CODE_RECORD_LIST
*RecordBuffer
121 Release a buffer in the list, remove some nodes to keep the list inital length.
124 RecordBuffer - Buffer to release
128 EFI_SUCCESS - If DataRecord is valid
129 EFI_UNSUPPORTED - The record list has empty
135 LogDataHubEventHandler (
143 The Event handler which will be notified to log data in Data Hub.
147 Event - Instance of the EFI_EVENT to signal whenever data is
148 available to be logged in the system.
149 Context - Context of the event.