formatting nits

This commit is contained in:
rsc 2006-09-08 15:14:43 +00:00
parent efb01c1dc0
commit 4fb684548a
4 changed files with 17 additions and 13 deletions

View file

@ -37,7 +37,7 @@ ioapic_init(void)
uchar id;
int i;
if (!ismp)
if(!ismp)
return;
io = (struct ioapic*) IO_APIC_BASE;
@ -71,7 +71,7 @@ ioapic_enable (int irq, int cpunum)
uint l, h;
struct ioapic *io;
if (!ismp)
if(!ismp)
return;
io = (struct ioapic*) IO_APIC_BASE;

14
lapic.c
View file

@ -105,7 +105,7 @@ lapic_write(int r, int data)
void
lapic_timerinit(void)
{
if (!lapicaddr)
if(!lapicaddr)
return;
lapic_write(LAPIC_TDCR, LAPIC_X1);
@ -118,7 +118,7 @@ lapic_timerinit(void)
void
lapic_timerintr(void)
{
if (lapicaddr)
if(lapicaddr)
lapic_write(LAPIC_EOI, 0);
}
@ -127,7 +127,7 @@ lapic_init(int c)
{
uint r, lvt;
if (!lapicaddr)
if(!lapicaddr)
return;
lapic_write(LAPIC_DFR, 0xFFFFFFFF); // Set dst format register
@ -162,21 +162,21 @@ lapic_init(int c)
void
lapic_enableintr(void)
{
if (lapicaddr)
if(lapicaddr)
lapic_write(LAPIC_TPR, 0);
}
void
lapic_disableintr(void)
{
if (lapicaddr)
if(lapicaddr)
lapic_write(LAPIC_TPR, 0xFF);
}
void
lapic_eoi(void)
{
if (lapicaddr)
if(lapicaddr)
lapic_write(LAPIC_EOI, 0);
}
@ -184,7 +184,7 @@ int
cpu(void)
{
int x;
if (lapicaddr)
if(lapicaddr)
x = (lapic_read(LAPIC_ID)>>24) & 0xFF;
else
x = 0;

9
main.c
View file

@ -74,8 +74,10 @@ main0(void)
mp_startthem();
// turn on timer
if (ismp) lapic_timerinit();
else pit8253_timerinit();
if(ismp)
lapic_timerinit();
else
pit8253_timerinit();
// enable interrupts on the local APIC
lapic_enableintr();
@ -126,7 +128,8 @@ process0()
p0->cwd = iget(rootdev, 1);
iunlock(p0->cwd);
// dummy user memory to make copyproc() happy
// dummy user memory to make copyproc() happy.
// must be big enough to hold the init binary.
p0->sz = PAGE;
p0->mem = kalloc(p0->sz);

3
mp.c
View file

@ -191,7 +191,8 @@ mp_init(void)
int
mp_bcpu(void)
{
if (ismp) return bcpu-cpus;
if(ismp)
return bcpu-cpus;
else return 0;
}