mirror of https://github.com/acidanthera/audk.git
1) Add blank before @file to follows doxygen style.
2) Adjust function order to avoid pre-declaration for function prototype. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8644 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
588e329920
commit
8b7a357816
|
@ -23,22 +23,6 @@ CONST EFI_GUID gZeroGuid = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
|
||||||
//
|
//
|
||||||
DATA_HUB_INSTANCE mPrivateData;
|
DATA_HUB_INSTANCE mPrivateData;
|
||||||
|
|
||||||
//
|
|
||||||
// Worker functions private to this file
|
|
||||||
//
|
|
||||||
DATA_HUB_FILTER_DRIVER *
|
|
||||||
FindFilterDriverByEvent (
|
|
||||||
IN LIST_ENTRY *Head,
|
|
||||||
IN EFI_EVENT Event
|
|
||||||
);
|
|
||||||
|
|
||||||
EFI_DATA_RECORD_HEADER *
|
|
||||||
GetNextDataRecord (
|
|
||||||
IN LIST_ENTRY *Head,
|
|
||||||
IN UINT64 ClassFilter,
|
|
||||||
IN OUT UINT64 *PtrCurrentMTC
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Log data record into the data logging hub
|
Log data record into the data logging hub
|
||||||
|
|
||||||
|
@ -157,6 +141,110 @@ DataHubLogData (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Search the Head doubly linked list for the passed in MTC. Return the
|
||||||
|
matching element in Head and the MTC on the next entry.
|
||||||
|
|
||||||
|
@param Head Head of Data Log linked list.
|
||||||
|
@param ClassFilter Only match the MTC if it is in the same Class as the
|
||||||
|
ClassFilter.
|
||||||
|
@param PtrCurrentMTC On IN contians MTC to search for. On OUT contians next
|
||||||
|
MTC in the data log list or zero if at end of the list.
|
||||||
|
|
||||||
|
@retval EFI_DATA_LOG_ENTRY Return pointer to data log data from Head list.
|
||||||
|
@retval NULL If no data record exists.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_DATA_RECORD_HEADER *
|
||||||
|
GetNextDataRecord (
|
||||||
|
IN LIST_ENTRY *Head,
|
||||||
|
IN UINT64 ClassFilter,
|
||||||
|
IN OUT UINT64 *PtrCurrentMTC
|
||||||
|
)
|
||||||
|
|
||||||
|
{
|
||||||
|
EFI_DATA_ENTRY *LogEntry;
|
||||||
|
LIST_ENTRY *Link;
|
||||||
|
BOOLEAN ReturnFirstEntry;
|
||||||
|
EFI_DATA_RECORD_HEADER *Record;
|
||||||
|
EFI_DATA_ENTRY *NextLogEntry;
|
||||||
|
|
||||||
|
//
|
||||||
|
// If MonotonicCount == 0 just return the first one
|
||||||
|
//
|
||||||
|
ReturnFirstEntry = (BOOLEAN) (*PtrCurrentMTC == 0);
|
||||||
|
|
||||||
|
Record = NULL;
|
||||||
|
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {
|
||||||
|
LogEntry = DATA_ENTRY_FROM_LINK (Link);
|
||||||
|
if ((LogEntry->Record->DataRecordClass & ClassFilter) == 0) {
|
||||||
|
//
|
||||||
|
// Skip any entry that does not have the correct ClassFilter
|
||||||
|
//
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((LogEntry->Record->LogMonotonicCount == *PtrCurrentMTC) || ReturnFirstEntry) {
|
||||||
|
//
|
||||||
|
// Return record to the user
|
||||||
|
//
|
||||||
|
Record = LogEntry->Record;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Calculate the next MTC value. If there is no next entry set
|
||||||
|
// MTC to zero.
|
||||||
|
//
|
||||||
|
*PtrCurrentMTC = 0;
|
||||||
|
for (Link = GetNextNode(Head, Link); Link != Head; Link = GetNextNode(Head, Link)) {
|
||||||
|
NextLogEntry = DATA_ENTRY_FROM_LINK (Link);
|
||||||
|
if ((NextLogEntry->Record->DataRecordClass & ClassFilter) != 0) {
|
||||||
|
//
|
||||||
|
// Return the MTC of the next thing to search for if found
|
||||||
|
//
|
||||||
|
*PtrCurrentMTC = NextLogEntry->Record->LogMonotonicCount;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Record found exit loop and return
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Record;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Search the Head list for a EFI_DATA_HUB_FILTER_DRIVER member that
|
||||||
|
represents Event and return it.
|
||||||
|
|
||||||
|
@param Head Pointer to head of dual linked list of EFI_DATA_HUB_FILTER_DRIVER structures.
|
||||||
|
@param Event Event to be search for in the Head list.
|
||||||
|
|
||||||
|
@retval EFI_DATA_HUB_FILTER_DRIVER Returned if Event stored in the Head doubly linked list.
|
||||||
|
@retval NULL If Event is not in the list
|
||||||
|
|
||||||
|
**/
|
||||||
|
DATA_HUB_FILTER_DRIVER *
|
||||||
|
FindFilterDriverByEvent (
|
||||||
|
IN LIST_ENTRY *Head,
|
||||||
|
IN EFI_EVENT Event
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DATA_HUB_FILTER_DRIVER *FilterEntry;
|
||||||
|
LIST_ENTRY *Link;
|
||||||
|
|
||||||
|
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {
|
||||||
|
FilterEntry = FILTER_ENTRY_FROM_LINK (Link);
|
||||||
|
if (FilterEntry->Event == Event) {
|
||||||
|
return FilterEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Get a previously logged data record and the MonotonicCount for the next
|
Get a previously logged data record and the MonotonicCount for the next
|
||||||
|
@ -417,109 +505,7 @@ DataHubUnregisterFilterDriver (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Search the Head list for a EFI_DATA_HUB_FILTER_DRIVER member that
|
|
||||||
represents Event and return it.
|
|
||||||
|
|
||||||
@param Head Pointer to head of dual linked list of EFI_DATA_HUB_FILTER_DRIVER structures.
|
|
||||||
@param Event Event to be search for in the Head list.
|
|
||||||
|
|
||||||
@retval EFI_DATA_HUB_FILTER_DRIVER Returned if Event stored in the Head doubly linked list.
|
|
||||||
@retval NULL If Event is not in the list
|
|
||||||
|
|
||||||
**/
|
|
||||||
DATA_HUB_FILTER_DRIVER *
|
|
||||||
FindFilterDriverByEvent (
|
|
||||||
IN LIST_ENTRY *Head,
|
|
||||||
IN EFI_EVENT Event
|
|
||||||
)
|
|
||||||
{
|
|
||||||
DATA_HUB_FILTER_DRIVER *FilterEntry;
|
|
||||||
LIST_ENTRY *Link;
|
|
||||||
|
|
||||||
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {
|
|
||||||
FilterEntry = FILTER_ENTRY_FROM_LINK (Link);
|
|
||||||
if (FilterEntry->Event == Event) {
|
|
||||||
return FilterEntry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Search the Head doubly linked list for the passed in MTC. Return the
|
|
||||||
matching element in Head and the MTC on the next entry.
|
|
||||||
|
|
||||||
@param Head Head of Data Log linked list.
|
|
||||||
@param ClassFilter Only match the MTC if it is in the same Class as the
|
|
||||||
ClassFilter.
|
|
||||||
@param PtrCurrentMTC On IN contians MTC to search for. On OUT contians next
|
|
||||||
MTC in the data log list or zero if at end of the list.
|
|
||||||
|
|
||||||
@retval EFI_DATA_LOG_ENTRY Return pointer to data log data from Head list.
|
|
||||||
@retval NULL If no data record exists.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_DATA_RECORD_HEADER *
|
|
||||||
GetNextDataRecord (
|
|
||||||
IN LIST_ENTRY *Head,
|
|
||||||
IN UINT64 ClassFilter,
|
|
||||||
IN OUT UINT64 *PtrCurrentMTC
|
|
||||||
)
|
|
||||||
|
|
||||||
{
|
|
||||||
EFI_DATA_ENTRY *LogEntry;
|
|
||||||
LIST_ENTRY *Link;
|
|
||||||
BOOLEAN ReturnFirstEntry;
|
|
||||||
EFI_DATA_RECORD_HEADER *Record;
|
|
||||||
EFI_DATA_ENTRY *NextLogEntry;
|
|
||||||
|
|
||||||
//
|
|
||||||
// If MonotonicCount == 0 just return the first one
|
|
||||||
//
|
|
||||||
ReturnFirstEntry = (BOOLEAN) (*PtrCurrentMTC == 0);
|
|
||||||
|
|
||||||
Record = NULL;
|
|
||||||
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {
|
|
||||||
LogEntry = DATA_ENTRY_FROM_LINK (Link);
|
|
||||||
if ((LogEntry->Record->DataRecordClass & ClassFilter) == 0) {
|
|
||||||
//
|
|
||||||
// Skip any entry that does not have the correct ClassFilter
|
|
||||||
//
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((LogEntry->Record->LogMonotonicCount == *PtrCurrentMTC) || ReturnFirstEntry) {
|
|
||||||
//
|
|
||||||
// Return record to the user
|
|
||||||
//
|
|
||||||
Record = LogEntry->Record;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Calculate the next MTC value. If there is no next entry set
|
|
||||||
// MTC to zero.
|
|
||||||
//
|
|
||||||
*PtrCurrentMTC = 0;
|
|
||||||
for (Link = GetNextNode(Head, Link); Link != Head; Link = GetNextNode(Head, Link)) {
|
|
||||||
NextLogEntry = DATA_ENTRY_FROM_LINK (Link);
|
|
||||||
if ((NextLogEntry->Record->DataRecordClass & ClassFilter) != 0) {
|
|
||||||
//
|
|
||||||
// Return the MTC of the next thing to search for if found
|
|
||||||
//
|
|
||||||
*PtrCurrentMTC = NextLogEntry->Record->LogMonotonicCount;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Record found exit loop and return
|
|
||||||
//
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Record;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Driver's Entry point routine that install Driver to produce Data Hub protocol.
|
Driver's Entry point routine that install Driver to produce Data Hub protocol.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**@file
|
/** @file
|
||||||
This code supports a the private implementation
|
This code supports a the private implementation
|
||||||
of the Data Hub protocol
|
of the Data Hub protocol
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**@file
|
/** @file
|
||||||
Data Hub filter driver that takes DEBUG () info from Data Hub and writes it
|
Data Hub filter driver that takes DEBUG () info from Data Hub and writes it
|
||||||
to StdErr if it exists.
|
to StdErr if it exists.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue