Skip to content

Commit

Permalink
formatting nits
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Sep 8, 2006
1 parent efb01c1 commit 4fb6845
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ioapic_init(void)
uchar id;
int i;

if (!ismp)
if(!ismp)
return;

io = (struct ioapic*) IO_APIC_BASE;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -118,7 +118,7 @@ lapic_timerinit(void)
void
lapic_timerintr(void)
{
if (lapicaddr)
if(lapicaddr)
lapic_write(LAPIC_EOI, 0);
}

Expand All @@ -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
Expand Down Expand Up @@ -162,29 +162,29 @@ 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);
}

int
cpu(void)
{
int x;
if (lapicaddr)
if(lapicaddr)
x = (lapic_read(LAPIC_ID)>>24) & 0xFF;
else
x = 0;
Expand Down
9 changes: 6 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ mp_init(void)
int
mp_bcpu(void)
{
if (ismp) return bcpu-cpus;
if(ismp)
return bcpu-cpus;
else return 0;
}

Expand Down

0 comments on commit 4fb6845

Please sign in to comment.