summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-10 17:05:46 +0000
committerrsc <rsc>2007-08-10 17:05:46 +0000
commit6861140a667cd7219cf9bc1e051faadfc8c46c6f (patch)
tree3705a56a9df3f53958b16538bea0497ed0df3686
parent3d145283a25ed9dcd8e0544e3db9d6733ab7d8b7 (diff)
downloadxv6-labs-6861140a667cd7219cf9bc1e051faadfc8c46c6f.tar.gz
xv6-labs-6861140a667cd7219cf9bc1e051faadfc8c46c6f.tar.bz2
xv6-labs-6861140a667cd7219cf9bc1e051faadfc8c46c6f.zip
replace bogus loops with slightly less bogus loops.
-rw-r--r--lapic.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lapic.c b/lapic.c
index 7634358..e781499 100644
--- a/lapic.c
+++ b/lapic.c
@@ -201,17 +201,15 @@ lapic_startap(uchar apicid, int v)
lapic_write(LAPIC_ICRHI, crhi);
lapic_write(LAPIC_ICRLO, LAPIC_FIELD|APIC_LEVEL|
LAPIC_ASSERT|APIC_INIT);
-
- while(j++ < 10000) {;}
+ for(j=0; j<10000; j++); // 200us
lapic_write(LAPIC_ICRLO, LAPIC_FIELD|APIC_LEVEL|
LAPIC_DEASSERT|APIC_INIT);
-
- while(j++ < 1000000) {;}
+ for(j=0; j<1000000; j++); // 10ms
// in p9 code, this was i < 2, which is what the spec says on page B-3
for(i = 0; i < 1; i++){
lapic_write(LAPIC_ICRHI, crhi);
lapic_write(LAPIC_ICRLO, LAPIC_FIELD|APIC_EDGE|APIC_STARTUP|(v/4096));
- while(j++ < 100000) {;}
+ for(j=0; j<10000; j++); // 200us
}
}