summaryrefslogtreecommitdiff
path: root/mp.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2011-08-09 21:33:59 -0400
committerFrans Kaashoek <[email protected]>2011-08-09 21:33:59 -0400
commit3a038106431314c85a5950c473b113a7037ac1aa (patch)
treea5727d90e49a02648799f27c7bdee5c159580cf7 /mp.c
parentb23d8329e7df6cf47b7d20fb19664496b4f29ca4 (diff)
downloadxv6-labs-3a038106431314c85a5950c473b113a7037ac1aa.tar.gz
xv6-labs-3a038106431314c85a5950c473b113a7037ac1aa.tar.bz2
xv6-labs-3a038106431314c85a5950c473b113a7037ac1aa.zip
Use kernel virtual addresses for BIOS memory, etc.
Diffstat (limited to 'mp.c')
-rw-r--r--mp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mp.c b/mp.c
index b1e2813..d2791ea 100644
--- a/mp.c
+++ b/mp.c
@@ -36,11 +36,11 @@ sum(uchar *addr, int len)
// Look for an MP structure in the len bytes at addr.
static struct mp*
-mpsearch1(uchar *addr, int len)
+mpsearch1(uint a, int len)
{
- uchar *e, *p;
+ uchar *e, *p, *addr;
- addr = p2v((uint) addr);
+ addr = p2v(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
@@ -60,16 +60,16 @@ mpsearch(void)
uint p;
struct mp *mp;
- bda = (uchar*)0x400;
- if((p = ((bda[0x0F]<<8)|bda[0x0E]) << 4)){
- if((mp = mpsearch1((uchar*)p, 1024)))
+ bda = (uchar *) P2V(0x400);
+ if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
+ if((mp = mpsearch1(p, 1024)))
return mp;
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
- if((mp = mpsearch1((uchar*)p-1024, 1024)))
+ if((mp = mpsearch1(p-1024, 1024)))
return mp;
}
- return mpsearch1((uchar*)0xF0000, 0x10000);
+ return mpsearch1(0xF0000, 0x10000);
}
// Search for an MP configuration table. For now,