summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/pc/apic.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/src/9/pc/apic.c b/sys/src/9/pc/apic.c
index eada39531..4e006e8fb 100644
--- a/sys/src/9/pc/apic.c
+++ b/sys/src/9/pc/apic.c
@@ -124,6 +124,12 @@ lapiconline(void)
lapicw(LapicTICR, lapictimer.max);
lapicw(LapicTIMER, LapicCLKIN|LapicPERIODIC|(VectorPIC+IrqTIMER));
+ /*
+ * not strickly neccesary, but reported (osdev.org) to be
+ * required for some machines.
+ */
+ lapicw(LapicTDCR, lapictdxtab[lapictimer.tdx]);
+
lapicw(LapicTPR, 0);
}
@@ -134,8 +140,8 @@ static void
lapictimerinit(void)
{
Retry:
- lapicw(LapicTDCR, lapictdxtab[lapictimer.tdx]);
lapicw(LapicTIMER, ApicIMASK|LapicCLKIN|LapicONESHOT|(VectorPIC+IrqTIMER));
+ lapicw(LapicTDCR, lapictdxtab[lapictimer.tdx]);
if(lapictimer.hz == 0ULL){
uvlong x, v, hz;