diff options
author | Frans Kaashoek <[email protected]> | 2011-08-09 21:33:59 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2011-08-09 21:33:59 -0400 |
commit | 3a038106431314c85a5950c473b113a7037ac1aa (patch) | |
tree | a5727d90e49a02648799f27c7bdee5c159580cf7 /mp.c | |
parent | b23d8329e7df6cf47b7d20fb19664496b4f29ca4 (diff) | |
download | xv6-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.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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, |