summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal/DataHubDxe
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 06:29:12 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 06:29:12 +0000
commit8b7a3578165b14ebbadc08e80fdfdf88fd2afde4 (patch)
tree8366457ce908481de9726595a60fc9c0e0e80764 /IntelFrameworkModulePkg/Universal/DataHubDxe
parent588e3299201a4fa6d83004198b95127794adbc0e (diff)
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
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/DataHubDxe')
-rw-r--r--IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c222
-rw-r--r--IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h2
2 files changed, 105 insertions, 119 deletions
diff --git a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c
index ff8e8a171..3f2a4c6e1 100644
--- a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c
+++ b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c
@@ -23,22 +23,6 @@ CONST EFI_GUID gZeroGuid = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
//
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
@@ -158,6 +142,110 @@ DataHubLogData (
}
/**
+ 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
availible Record. This allows all records or all records later
@@ -417,109 +505,7 @@ DataHubUnregisterFilterDriver (
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.
diff --git a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h
index ebd0d08fa..6b0885df5 100644
--- a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h
+++ b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.h
@@ -1,4 +1,4 @@
-/**@file
+/** @file
This code supports a the private implementation
of the Data Hub protocol