OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
DataHub.c File Reference
#include "DataHub.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI DataHubLogData (IN EFI_DATA_HUB_PROTOCOL *This, IN EFI_GUID *DataRecordGuid, IN EFI_GUID *ProducerName, IN UINT64 DataRecordClass, IN VOID *RawData, IN UINT32 RawDataSize)
 
EFI_DATA_RECORD_HEADERGetNextDataRecord (IN LIST_ENTRY *Head, IN UINT64 ClassFilter, IN OUT UINT64 *PtrCurrentMTC)
 
DATA_HUB_FILTER_DRIVERFindFilterDriverByEvent (IN LIST_ENTRY *Head, IN EFI_EVENT Event)
 
EFI_STATUS EFIAPI DataHubGetNextRecord (IN EFI_DATA_HUB_PROTOCOL *This, IN OUT UINT64 *MonotonicCount, IN EFI_EVENT *FilterDriverEvent, OPTIONAL OUT EFI_DATA_RECORD_HEADER **Record)
 
EFI_STATUS EFIAPI DataHubRegisterFilterDriver (IN EFI_DATA_HUB_PROTOCOL *This, IN EFI_EVENT FilterEvent, IN EFI_TPL FilterTpl, IN UINT64 FilterClass, IN EFI_GUID *FilterDataRecordGuid OPTIONAL)
 
EFI_STATUS EFIAPI DataHubUnregisterFilterDriver (IN EFI_DATA_HUB_PROTOCOL *This, IN EFI_EVENT FilterEvent)
 
EFI_DATA_HUB_PROTOCOLDataHubInstall (VOID)
 

Variables

DATA_HUB_INSTANCE mPrivateData
 

Detailed Description

This code produces the Data Hub protocol. It preloads the data hub with status information copied in from PEI HOBs.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DataHub.c.

Function Documentation

◆ DataHubGetNextRecord()

EFI_STATUS EFIAPI DataHubGetNextRecord ( IN EFI_DATA_HUB_PROTOCOL * This,
IN OUT UINT64 * MonotonicCount,
IN EFI_EVENT * FilterDriverEvent,
OPTIONAL OUT EFI_DATA_RECORD_HEADER ** Record )

Get a previously logged data record and the MonotonicCount for the next available Record. This allows all records or all records later than a give MonotonicCount to be returned. If an optional FilterDriverEvent is passed in with a MonotonicCout of zero return the first record not yet read by the filter driver. If FilterDriverEvent is NULL and MonotonicCount is zero return the first data record.

Parameters
ThisPointer to the EFI_DATA_HUB_PROTOCOL instance.
MonotonicCountSpecifies the Record to return. On input, zero means return the first record. On output, contains the next record to available. Zero indicates no more records.
FilterDriverEventIf FilterDriverEvent is not passed in a MonotonicCount of zero, it means to return the first data record. If FilterDriverEvent is passed in, then a MonotonicCount of zero means to return the first data not yet read by FilterDriverEvent.
RecordReturns a dynamically allocated memory buffer with a data record that matches MonotonicCount.
Return values
EFI_SUCCESSData was returned in Record.
EFI_INVALID_PARAMETERFilterDriverEvent was passed in but does not exist.
EFI_NOT_FOUNDMonotonicCount does not match any data record in the system. If a MonotonicCount of zero was passed in, then no data records exist in the system.
EFI_OUT_OF_RESOURCESRecord was not returned due to lack of system resources.

Definition at line 282 of file DataHub.c.

◆ DataHubInstall()

EFI_DATA_HUB_PROTOCOL * DataHubInstall ( VOID )

Driver's Entry point routine that install Driver to produce Data Hub protocol.

Definition at line 538 of file DataHub.c.

◆ DataHubLogData()

EFI_STATUS EFIAPI DataHubLogData ( IN EFI_DATA_HUB_PROTOCOL * This,
IN EFI_GUID * DataRecordGuid,
IN EFI_GUID * ProducerName,
IN UINT64 DataRecordClass,
IN VOID * RawData,
IN UINT32 RawDataSize )

Log data record into the data logging hub

Parameters
ThisProtocol instance structure
DataRecordGuidGUID that defines record contents
ProducerNameGUID that defines the name of the producer of the data
DataRecordClassClass that defines generic record type
RawDataData Log record as defined by DataRecordGuid
RawDataSizeSize of Data Log data in bytes
Return values
EFI_SUCCESSIf data was logged
EFI_OUT_OF_RESOURCESIf data was not logged due to lack of system resources.

Definition at line 34 of file DataHub.c.

◆ DataHubRegisterFilterDriver()

EFI_STATUS EFIAPI DataHubRegisterFilterDriver ( IN EFI_DATA_HUB_PROTOCOL * This,
IN EFI_EVENT FilterEvent,
IN EFI_TPL FilterTpl,
IN UINT64 FilterClass,
IN EFI_GUID *FilterDataRecordGuid OPTIONAL )

This function registers the data hub filter driver that is represented by FilterEvent. Only one instance of each FilterEvent can be registered. After the FilterEvent is registered, it will be signaled so it can sync with data records that have been recorded prior to the FilterEvent being registered.

Parameters
ThisPointer to The EFI_DATA_HUB_PROTOCOL instance.
FilterEventThe EFI_EVENT to signal whenever data that matches FilterClass is logged in the system.
FilterTplThe maximum EFI_TPL at which FilterEvent can be signaled. It is strongly recommended that you use the lowest EFI_TPL possible.
FilterClassFilterEvent will be signaled whenever a bit in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass. If FilterClass is zero, no class-based filtering will be performed.
FilterDataRecordGuidFilterEvent will be signaled whenever FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid. If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed.
Return values
EFI_SUCCESSThe filter driver event was registered.
EFI_ALREADY_STARTEDFilterEvent was previously registered and cannot be registered again.
EFI_OUT_OF_RESOURCESThe filter driver event was not registered due to lack of system resources.

Definition at line 419 of file DataHub.c.

◆ DataHubUnregisterFilterDriver()

EFI_STATUS EFIAPI DataHubUnregisterFilterDriver ( IN EFI_DATA_HUB_PROTOCOL * This,
IN EFI_EVENT FilterEvent )

Remove a Filter Driver, so it no longer gets called when data information is logged.

Parameters
ThisProtocol instance structure
FilterEventEvent that represents a filter driver that is to be Unregistered.
Return values
EFI_SUCCESSIf FilterEvent was unregistered
EFI_NOT_FOUNDIf FilterEvent does not exist

Definition at line 498 of file DataHub.c.

◆ FindFilterDriverByEvent()

DATA_HUB_FILTER_DRIVER * FindFilterDriverByEvent ( IN LIST_ENTRY * Head,
IN EFI_EVENT Event )

Search the Head list for a EFI_DATA_HUB_FILTER_DRIVER member that represents Event and return it.

Parameters
HeadPointer to head of dual linked list of EFI_DATA_HUB_FILTER_DRIVER structures.
EventEvent to be search for in the Head list.
Return values
EFI_DATA_HUB_FILTER_DRIVERReturned if Event stored in the Head doubly linked list.
NULLIf Event is not in the list

Definition at line 233 of file DataHub.c.

◆ GetNextDataRecord()

EFI_DATA_RECORD_HEADER * GetNextDataRecord ( IN LIST_ENTRY * Head,
IN UINT64 ClassFilter,
IN OUT UINT64 * PtrCurrentMTC )

Search the Head doubly linked list for the passed in MTC. Return the matching element in Head and the MTC on the next entry.

Parameters
HeadHead of Data Log linked list.
ClassFilterOnly match the MTC if it is in the same Class as the ClassFilter.
PtrCurrentMTCOn IN contians MTC to search for. On OUT contians next MTC in the data log list or zero if at end of the list.
Return values
EFI_DATA_LOG_ENTRYReturn pointer to data log data from Head list.
NULLIf no data record exists.

Definition at line 161 of file DataHub.c.

Variable Documentation

◆ mPrivateData

DATA_HUB_INSTANCE mPrivateData

Definition at line 16 of file DataHub.c.