PERFORCE change 28602 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 8 20:33:37 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=28602
Change 28602 by peter at peter_daintree on 2003/04/08 20:32:50
find the preload metadata for bios_smap
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#57 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#57 (text+ko) ====
@@ -735,16 +735,13 @@
* "Consumer may safely assume that size value precedes data."
* ie: an int32_t immediately precedes smap.
*/
- smapbase = MD_FETCH(kmdp, MODINFOMD_SMAP, struct bios_smap *) + KERNBASE;
+ smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP);
if (smapbase == 0) {
- printf("No BIOS smap info from loader!\n");
+ panic("No BIOS smap info from loader!");
goto deep_shit;
}
-printf("smapbase: %p\n", smapbase);
- smapsize = ((u_int32_t *)smapbase)[-1];
-printf("smaplen = 0x%x\n", smapsize);
+ smapsize = *((u_int32_t *)smapbase - 1);
smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize);
-printf("smapend: %p\n", smapend);
for (smap = smapbase; smap < smapend; smap++) {
if (boothowto & RB_VERBOSE)
More information about the p4-projects
mailing list