consistency.

This commit is contained in:
kaashoek 2006-09-08 15:07:45 +00:00
parent 5cb7877e0f
commit 5c596bb3a7
2 changed files with 45 additions and 42 deletions

View file

@ -37,7 +37,9 @@ ioapic_init(void)
uchar id;
int i;
if (ismp) {
if (!ismp)
return;
io = (struct ioapic*) IO_APIC_BASE;
l = ioapic_read(io, IOAPIC_VER);
nintr = ((l & IOART_VER_MAXREDIR) >> MAXREDIRSHIFT) + 1;
@ -62,7 +64,6 @@ ioapic_init(void)
ioapic_write(io, IOAPIC_REDTBL_HI(i), h);
}
}
}
void
ioapic_enable (int irq, int cpunum)
@ -70,7 +71,9 @@ ioapic_enable (int irq, int cpunum)
uint l, h;
struct ioapic *io;
if (ismp) {
if (!ismp)
return;
io = (struct ioapic*) IO_APIC_BASE;
l = ioapic_read(io, IOAPIC_REDTBL_LO(irq));
l = l & ~IOART_INTMASK; // allow INTs
@ -80,4 +83,3 @@ ioapic_enable (int irq, int cpunum)
h |= (cpunum << APIC_ID_SHIFT);
ioapic_write(io, IOAPIC_REDTBL_HI(irq), h);
}
}

View file

@ -105,14 +105,15 @@ lapic_write(int r, int data)
void
lapic_timerinit(void)
{
if (lapicaddr) {
if (!lapicaddr)
return;
lapic_write(LAPIC_TDCR, LAPIC_X1);
lapic_write(LAPIC_TIMER, LAPIC_CLKIN | LAPIC_PERIODIC |
(IRQ_OFFSET + IRQ_TIMER));
lapic_write(LAPIC_TCCR, 10000000);
lapic_write(LAPIC_TICR, 10000000);
}
}
void
lapic_timerintr(void)
@ -126,7 +127,7 @@ lapic_init(int c)
{
uint r, lvt;
if (lapicaddr == 0)
if (!lapicaddr)
return;
lapic_write(LAPIC_DFR, 0xFFFFFFFF); // Set dst format register