mirror of https://github.com/acidanthera/audk.git
PcAtChipsetPkg HPET Timer DXE Driver: Update CPU Arch Protocol.SetTimerPeriod() to program HPET/IOAPIC register with APIC ID of current BSP in case the BSP has been switched.
Signed-off-by: rsun3 Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12778 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
795bb9b6c4
commit
9ff904b046
|
@ -492,9 +492,10 @@ TimerDriverSetTimerPeriod (
|
|||
IN UINT64 TimerPeriod
|
||||
)
|
||||
{
|
||||
UINT64 MainCounter;
|
||||
UINT64 Delta;
|
||||
UINT64 CurrentComparator;
|
||||
UINT64 MainCounter;
|
||||
UINT64 Delta;
|
||||
UINT64 CurrentComparator;
|
||||
HPET_TIMER_MSI_ROUTE_REGISTER HpetTimerMsiRoute;
|
||||
|
||||
//
|
||||
// Disable HPET timer when adjusting the timer period
|
||||
|
@ -576,6 +577,13 @@ TimerDriverSetTimerPeriod (
|
|||
// Enable HPET Timer interrupt generation
|
||||
//
|
||||
if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet (PcdHpetMsiEnable)) {
|
||||
//
|
||||
// Program MSI Address and MSI Data values in the selected HPET Timer
|
||||
// Program HPET register with APIC ID of current BSP in case BSP has been switched
|
||||
//
|
||||
HpetTimerMsiRoute.Bits.Address = GetApicMsiAddress ();
|
||||
HpetTimerMsiRoute.Bits.Value = (UINT32)GetApicMsiValue (PcdGet8 (PcdHpetLocalApicVector), LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY, FALSE, FALSE);
|
||||
HpetWrite (HPET_TIMER_MSI_ROUTE_OFFSET + mTimerIndex * HPET_TIMER_STRIDE, HpetTimerMsiRoute.Uint64);
|
||||
//
|
||||
// Enable HPET MSI Interrupt
|
||||
//
|
||||
|
@ -583,8 +591,9 @@ TimerDriverSetTimerPeriod (
|
|||
} else {
|
||||
//
|
||||
// Enable timer interrupt through I/O APIC
|
||||
// Program IOAPIC register with APIC ID of current BSP in case BSP has been switched
|
||||
//
|
||||
IoApicEnableInterrupt (mTimerIrq, TRUE);
|
||||
IoApicConfigureInterrupt (mTimerIrq, PcdGet8 (PcdHpetLocalApicVector), IO_APIC_DELIVERY_MODE_LOWEST_PRIORITY, TRUE, FALSE);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue