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
This commit is contained in:
qhuang8
2009-08-25 07:29:13 +00:00
parent 7f22d35110
commit ccd55824e7
44 changed files with 1038 additions and 359 deletions

View File

@@ -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;
}