From 8b7a3578165b14ebbadc08e80fdfdf88fd2afde4 Mon Sep 17 00:00:00 2001 From: klu2 Date: Wed, 24 Jun 2009 06:29:12 +0000 Subject: [PATCH] 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 --- .../Universal/DataHubDxe/DataHub.c | 222 ++++++++---------- .../Universal/DataHubDxe/DataHub.h | 2 +- .../DataHubStdErrDxe/DataHubStdErr.c | 2 +- 3 files changed, 106 insertions(+), 120 deletions(-) diff --git a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c index ff8e8a1716..3f2a4c6e1a 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 @@ -157,6 +141,110 @@ DataHubLogData ( 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 @@ -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 ebd0d08fa2..6b0885df51 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 diff --git a/IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErr.c b/IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErr.c index d814c6716d..7dd893b3b8 100644 --- a/IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErr.c +++ b/IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErr.c @@ -1,4 +1,4 @@ -/**@file +/** @file Data Hub filter driver that takes DEBUG () info from Data Hub and writes it to StdErr if it exists.