summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ioapic.c4
-rw-r--r--lapic.c14
-rw-r--r--main.c9
-rw-r--r--mp.c3
4 files changed, 17 insertions, 13 deletions
diff --git a/ioapic.c b/ioapic.c
index 34592b8..aae49b5 100644
--- a/ioapic.c
+++ b/ioapic.c
@@ -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;
diff --git a/lapic.c b/lapic.c
index 612bf3b..7634358 100644
--- a/lapic.c
+++ b/lapic.c
@@ -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;
diff --git a/main.c b/main.c
index cfab55f..add0f92 100644
--- a/main.c
+++ b/main.c
@@ -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);
diff --git a/mp.c b/mp.c
index c34982d..3430d6c 100644
--- a/mp.c
+++ b/mp.c
@@ -191,7 +191,8 @@ mp_init(void)
int
mp_bcpu(void)
{
- if (ismp) return bcpu-cpus;
+ if(ismp)
+ return bcpu-cpus;
else return 0;
}