From b4c900588691090ae931a630b93f5c8753677e68 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 29 Nov 2010 04:41:58 +0000 Subject: [PATCH] First try to get log time at TPL level <= TPL_CALLBACK, then fill time into DataHub. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11102 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/DataHubDxe/DataHub.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c index 7582054e70..01bc215ccd 100644 --- a/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c +++ b/IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c @@ -58,6 +58,7 @@ DataHubLogData ( DATA_HUB_FILTER_DRIVER *FilterEntry; LIST_ENTRY *Link; LIST_ENTRY *Head; + EFI_TIME LogTime; Private = DATA_HUB_INSTANCE_FROM_THIS (This); @@ -69,10 +70,18 @@ DataHubLogData ( // RecordSize = sizeof (EFI_DATA_RECORD_HEADER) + RawDataSize; TotalSize = sizeof (EFI_DATA_ENTRY) + RecordSize; + + // + // First try to get log time at TPL level <= TPL_CALLBACK. + // + ZeroMem (&LogTime, sizeof (LogTime)); + if (EfiGetCurrentTpl() <= TPL_CALLBACK) { + gRT->GetTime (&LogTime, NULL); + } // // The Logging action is the critical section, so it is locked. - // The MTC asignment & update, time, and logging must be an + // The MTC asignment & update and logging must be an // atomic operation, so use the lock. // Status = EfiAcquireLockOrFail (&Private->DataLock); @@ -110,7 +119,7 @@ DataHubLogData ( // Record->LogMonotonicCount = ++Private->GlobalMonotonicCount; - gRT->GetTime (&Record->LogTime, NULL); + CopyMem (&Record->LogTime, &LogTime, sizeof (LogTime)); // // Insert log into the internal linked list. @@ -551,7 +560,7 @@ DataHubInstall ( InitializeListHead (&mPrivateData.DataListHead); InitializeListHead (&mPrivateData.FilterDriverListHead); - EfiInitializeLock (&mPrivateData.DataLock, TPL_CALLBACK); + EfiInitializeLock (&mPrivateData.DataLock, TPL_NOTIFY); // // Make sure we get a bigger MTC number on every boot!