X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PcAtChipsetPkg%2FHpetTimerDxe%2FHpetTimer.c;h=23afbfaa656b6d3e2ee7d8e2e440d11788b00906;hb=e78aab9d2f1423f2ec4a82e0e36eff4dfd7c56ea;hp=b9bf080c74ea03b9b600887b9254137aef51888f;hpb=9ff904b04652a3a0b0a64847f22ff3b9ee1317f5;p=mirror_edk2.git diff --git a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c index b9bf080c74..23afbfaa65 100644 --- a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c +++ b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c @@ -1,7 +1,7 @@ /** @file Timer Architectural Protocol module using High Precesion Event Timer (HPET) - Copyright (c) 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -142,7 +142,7 @@ TimerDriverGetTimerPeriod ( @param This The EFI_TIMER_ARCH_PROTOCOL instance. @retval EFI_SUCCESS The soft timer interrupt was generated. - @retval EFI_UNSUPPORTEDT The platform does not support the generation of soft + @retval EFI_UNSUPPORTED The platform does not support the generation of soft timer interrupts. **/ @@ -288,8 +288,8 @@ HpetEnable ( HPET interrupt is passed to that notification function in 100 ns units. The HPET time is updated to generate another interrupt in the required time period. - @param InterruptType The type of interrupt that occured. - @param SystemContext A pointer to the system context when the interrupt occured. + @param InterruptType The type of interrupt that occurred. + @param SystemContext A pointer to the system context when the interrupt occurred. **/ VOID EFIAPI @@ -492,11 +492,17 @@ TimerDriverSetTimerPeriod ( IN UINT64 TimerPeriod ) { + EFI_TPL Tpl; UINT64 MainCounter; UINT64 Delta; UINT64 CurrentComparator; HPET_TIMER_MSI_ROUTE_REGISTER HpetTimerMsiRoute; - + + // + // Disable interrupts + // + Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL); + // // Disable HPET timer when adjusting the timer period // @@ -594,6 +600,7 @@ TimerDriverSetTimerPeriod ( // Program IOAPIC register with APIC ID of current BSP in case BSP has been switched // IoApicConfigureInterrupt (mTimerIrq, PcdGet8 (PcdHpetLocalApicVector), IO_APIC_DELIVERY_MODE_LOWEST_PRIORITY, TRUE, FALSE); + IoApicEnableInterrupt (mTimerIrq, TRUE); } // @@ -615,7 +622,12 @@ TimerDriverSetTimerPeriod ( // is disabled. // HpetEnable (TRUE); - + + // + // Restore interrupts + // + gBS->RestoreTPL (Tpl); + return EFI_SUCCESS; } @@ -661,7 +673,7 @@ TimerDriverGetTimerPeriod ( @param This The EFI_TIMER_ARCH_PROTOCOL instance. @retval EFI_SUCCESS The soft timer interrupt was generated. - @retval EFI_UNSUPPORTEDT The platform does not support the generation of soft + @retval EFI_UNSUPPORTED The platform does not support the generation of soft timer interrupts. **/ @@ -741,7 +753,7 @@ TimerDriverGenerateSoftInterrupt ( @retval EFI_SUCCESS Timer Architectural Protocol created @retval EFI_OUT_OF_RESOURCES Not enough resources available to initialize driver. - @retval EFI_DEVICE_ERROR A device error occured attempting to initialize the driver. + @retval EFI_DEVICE_ERROR A device error occurred attempting to initialize the driver. **/ EFI_STATUS