diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-18 09:50:09 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-18 09:50:09 +0000 |
commit | e94a9ff7271367e649ee4f9a86da1f1bea6d112e (patch) | |
tree | bcf3077b88cb89d1e7127285b6c54d9658f67287 /MdeModulePkg/Core/Dxe/Event/Timer.c | |
parent | ff61847ddc91285a9ef8be00b89304870c493ef8 (diff) | |
download | edk2-e94a9ff7271367e649ee4f9a86da1f1bea6d112e.zip edk2-e94a9ff7271367e649ee4f9a86da1f1bea6d112e.tar.gz edk2-e94a9ff7271367e649ee4f9a86da1f1bea6d112e.tar.bz2 |
Code scrub for DxeCore
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5520 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Event/Timer.c')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Event/Timer.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/MdeModulePkg/Core/Dxe/Event/Timer.c b/MdeModulePkg/Core/Dxe/Event/Timer.c index c163266..924499e 100644 --- a/MdeModulePkg/Core/Dxe/Event/Timer.c +++ b/MdeModulePkg/Core/Dxe/Event/Timer.c @@ -60,18 +60,16 @@ CoreInsertEventTimer ( // Internal data
//
-STATIC LIST_ENTRY mEfiTimerList = INITIALIZE_LIST_HEAD_VARIABLE (mEfiTimerList);
-STATIC EFI_LOCK mEfiTimerLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_HIGH_LEVEL - 1);
-STATIC EFI_EVENT mEfiCheckTimerEvent;
+LIST_ENTRY mEfiTimerList = INITIALIZE_LIST_HEAD_VARIABLE (mEfiTimerList);
+EFI_LOCK mEfiTimerLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_HIGH_LEVEL - 1);
+EFI_EVENT mEfiCheckTimerEvent = NULL;
-STATIC EFI_LOCK mEfiSystemTimeLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_HIGH_LEVEL);
-STATIC UINT64 mEfiSystemTime = 0;
+EFI_LOCK mEfiSystemTimeLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_HIGH_LEVEL);
+UINT64 mEfiSystemTime = 0;
//
// Timer functions
//
-
-
/**
Initializes timer support.
@@ -84,12 +82,12 @@ CoreInitializeTimer ( EFI_STATUS Status;
Status = CoreCreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_HIGH_LEVEL - 1,
- CoreCheckTimers,
- NULL,
- &mEfiCheckTimerEvent
- );
+ EVT_NOTIFY_SIGNAL,
+ TPL_HIGH_LEVEL - 1,
+ CoreCheckTimers,
+ NULL,
+ &mEfiCheckTimerEvent
+ );
ASSERT_EFI_ERROR (Status);
}
@@ -110,6 +108,7 @@ CoreCurrentSystemTime ( CoreAcquireLock (&mEfiSystemTimeLock);
SystemTime = mEfiSystemTime;
CoreReleaseLock (&mEfiSystemTimeLock);
+
return SystemTime;
}
@@ -132,20 +131,17 @@ CoreTimerTick ( //
// Check runtiem flag in case there are ticks while exiting boot services
//
-
CoreAcquireLock (&mEfiSystemTimeLock);
//
// Update the system time
//
-
mEfiSystemTime += Duration;
//
// If the head of the list is expired, fire the timer event
// to process it
//
-
if (!IsListEmpty (&mEfiTimerList)) {
Event = CR (mEfiTimerList.ForwardLink, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
@@ -179,7 +175,6 @@ CoreCheckTimers ( //
// Check the timer database for expired timers
//
-
CoreAcquireLock (&mEfiTimerLock);
SystemTime = CoreCurrentSystemTime ();
@@ -189,7 +184,6 @@ CoreCheckTimers ( //
// If this timer is not expired, then we're done
//
-
if (Event->u.Timer.TriggerTime > SystemTime) {
break;
}
@@ -210,11 +204,9 @@ CoreCheckTimers ( // If this is a periodic timer, set it
//
if (Event->u.Timer.Period) {
-
//
// Compute the timers new trigger time
//
-
Event->u.Timer.TriggerTime = Event->u.Timer.TriggerTime + Event->u.Timer.Period;
//
@@ -228,7 +220,6 @@ CoreCheckTimers ( //
// Add the timer
//
-
CoreInsertEventTimer (Event);
}
}
@@ -258,13 +249,11 @@ CoreInsertEventTimer ( //
// Get the timer's trigger time
//
-
TriggerTime = Event->u.Timer.TriggerTime;
//
// Insert the timer into the timer database in assending sorted order
//
-
for (Link = mEfiTimerList.ForwardLink; Link != &mEfiTimerList; Link = Link->ForwardLink) {
Event2 = CR (Link, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
@@ -278,7 +267,6 @@ CoreInsertEventTimer ( -
/**
Sets the type of timer and the trigger time for a timer event.
@@ -323,7 +311,6 @@ CoreSetTimer ( //
// If the timer is queued to the timer database, remove it
//
-
if (Event->u.Timer.Link.ForwardLink != NULL) {
RemoveEntryList (&Event->u.Timer.Link);
Event->u.Timer.Link.ForwardLink = NULL;
@@ -347,5 +334,6 @@ CoreSetTimer ( }
CoreReleaseLock (&mEfiTimerLock);
+
return EFI_SUCCESS;
}
|