44volatile UINT64 mTimerPeriod = 0;
70 if (mTimerNotifyFunction !=
NULL) {
74 mTimerNotifyFunction (mTimerPeriod);
122 return EFI_INVALID_PARAMETER;
126 return EFI_ALREADY_STARTED;
166 IN UINT64 TimerPeriod
170 UINT32 TimerFrequency;
171 UINT32 DivideValue = 1;
173 if (TimerPeriod == 0) {
179 TimerFrequency =
PcdGet32 (PcdFSBClock) / (UINT32)DivideValue;
192 if (TimerCount > MAX_UINT32) {
193 TimerCount = MAX_UINT32;
195 TimerPeriod = 429496730;
212 mTimerPeriod = TimerPeriod;
237 OUT UINT64 *TimerPeriod
240 if (TimerPeriod ==
NULL) {
241 return EFI_INVALID_PARAMETER;
244 *TimerPeriod = mTimerPeriod;
278 OriginalTPL =
gBS->RaiseTPL (TPL_HIGH_LEVEL);
280 if (mTimerNotifyFunction !=
NULL) {
284 mTimerNotifyFunction (mTimerPeriod);
287 gBS->RestoreTPL (OriginalTPL);
289 return EFI_UNSUPPORTED;
318 mTimerNotifyFunction =
NULL;
328 Status =
gBS->LocateProtocol (&gEfiCpuArchProtocolGuid,
NULL, (VOID **)&mCpu);
340 Status = mCpu->RegisterInterruptHandler (
342 LOCAL_APIC_TIMER_VECTOR,
356 Status =
gBS->InstallMultipleProtocolInterfaces (
358 &gEfiTimerArchProtocolGuid,
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
BOOLEAN EFIAPI GetApicTimerInterruptState(VOID)
VOID EFIAPI EnableApicTimerInterrupt(VOID)
VOID EFIAPI InitializeApicTimer(IN UINTN DivideValue, IN UINT32 InitCount, IN BOOLEAN PeriodicMode, IN UINT8 Vector)
VOID EFIAPI SendApicEoi(VOID)
VOID EFIAPI DisableApicTimerInterrupt(VOID)
EFI_STATUS EFIAPI TimerDriverInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI TimerDriverRegisterHandler(IN EFI_TIMER_ARCH_PROTOCOL *This, IN EFI_TIMER_NOTIFY NotifyFunction)
EFI_STATUS EFIAPI TimerDriverGetTimerPeriod(IN EFI_TIMER_ARCH_PROTOCOL *This, OUT UINT64 *TimerPeriod)
EFI_STATUS EFIAPI TimerDriverSetTimerPeriod(IN EFI_TIMER_ARCH_PROTOCOL *This, IN UINT64 TimerPeriod)
EFI_STATUS EFIAPI TimerDriverGenerateSoftInterrupt(IN EFI_TIMER_ARCH_PROTOCOL *This)
VOID EFIAPI TimerInterruptHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext)
#define ASSERT_EFI_ERROR(StatusParameter)
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
VOID(EFIAPI * EFI_TIMER_NOTIFY)(IN UINT64 Time)
VOID EFIAPI NestedInterruptRestoreTPL(IN EFI_TPL InterruptedTPL, IN OUT EFI_SYSTEM_CONTEXT SystemContext, IN OUT NESTED_INTERRUPT_STATE *IsrState)
EFI_TPL EFIAPI NestedInterruptRaiseTPL(VOID)
#define PcdGet32(TokenName)
VOID EFIAPI NotifyFunction(IN EFI_EVENT Event, IN VOID *Context)