diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-29 04:41:58 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-29 04:41:58 +0000 |
commit | b4c900588691090ae931a630b93f5c8753677e68 (patch) | |
tree | a17728c7e643ee157fdcfa6c00411e3d2af30210 /IntelFrameworkModulePkg/Universal | |
parent | d99e698158f1525d8013168913299997786f2e28 (diff) | |
download | edk2-platforms-b4c900588691090ae931a630b93f5c8753677e68.tar.xz |
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
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c | 15 |
1 files 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!
|