diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
commit | ccd55824e79865a04b1c872bda4af0f1de1f50be (patch) | |
tree | e67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/TimerDxe/Timer.c | |
parent | 7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff) | |
download | edk2-platforms-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.xz |
Integrate patch from Andrew Fish to make it run on OS X.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/TimerDxe/Timer.c')
-rw-r--r-- | UnixPkg/TimerDxe/Timer.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/UnixPkg/TimerDxe/Timer.c b/UnixPkg/TimerDxe/Timer.c index 53b5656f7c..7f43a368e2 100644 --- a/UnixPkg/TimerDxe/Timer.c +++ b/UnixPkg/TimerDxe/Timer.c @@ -62,7 +62,7 @@ UINT64 mTimerPeriodMs; VOID
-TimerCallback (UINT64 DeltaMs) +TimerCallback (UINT64 DeltaMs)
/*++
Routine Description:
@@ -84,12 +84,12 @@ Returns: --*/
{
EFI_TPL OriginalTPL;
- EFI_TIMER_NOTIFY CallbackFunction; - + EFI_TIMER_NOTIFY CallbackFunction;
+
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
- if (OriginalTPL < TPL_HIGH_LEVEL) { + if (OriginalTPL < TPL_HIGH_LEVEL) {
CallbackFunction = mTimerNotifyFunction;
//
@@ -99,7 +99,7 @@ Returns: if (CallbackFunction != NULL) {
CallbackFunction ((UINT64) (DeltaMs * 10000));
}
- } + }
gBS->RestoreTPL (OriginalTPL);
@@ -164,13 +164,13 @@ Returns: return EFI_ALREADY_STARTED;
}
- if (NotifyFunction == NULL) { - /* Disable timer. */ - gUnix->SetTimer (0, TimerCallback); - } else if (mTimerNotifyFunction == NULL) { - /* Enable Timer. */ - gUnix->SetTimer (mTimerPeriodMs, TimerCallback); - } + if (NotifyFunction == NULL) {
+ /* Disable timer. */
+ gUnix->SetTimer (0, TimerCallback);
+ } else if (mTimerNotifyFunction == NULL) {
+ /* Enable Timer. */
+ gUnix->SetTimer (mTimerPeriodMs, TimerCallback);
+ }
mTimerNotifyFunction = NotifyFunction;
return EFI_SUCCESS;
@@ -224,13 +224,13 @@ Returns: // If TimerPeriod is 0, then the timer thread should be canceled
// If the TimerPeriod is valid, then create and/or adjust the period of the timer thread
//
- if (TimerPeriod == 0 - || ((TimerPeriod > TIMER_MINIMUM_VALUE) + if (TimerPeriod == 0
+ || ((TimerPeriod > TIMER_MINIMUM_VALUE)
&& (TimerPeriod < TIMER_MAXIMUM_VALUE))) {
mTimerPeriodMs = DivU64x32 (TimerPeriod + 5000, 10000);
- - gUnix->SetTimer (mTimerPeriodMs, TimerCallback); - } +
+ gUnix->SetTimer (mTimerPeriodMs, TimerCallback);
+ }
return EFI_SUCCESS;
}
@@ -369,6 +369,6 @@ Returns: if (EFI_ERROR (Status)) {
return Status;
}
- +
return EFI_SUCCESS;
}
|