From: Jordan Gordeev Date: Mon, 6 Jul 2009 12:12:53 +0000 (+0300) Subject: amd64: Help mptable_pass2() find and read the mptable. X-Git-Tag: v2.3.2~44^2~14 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a9e9c21a7bb36871b025b1d18e32ff0fc0e05eb8 amd64: Help mptable_pass2() find and read the mptable. --- diff --git a/sys/platform/pc64/amd64/mp_machdep.c b/sys/platform/pc64/amd64/mp_machdep.c index 484d9c235a..2e979a5498 100644 --- a/sys/platform/pc64/amd64/mp_machdep.c +++ b/sys/platform/pc64/amd64/mp_machdep.c @@ -351,18 +351,18 @@ mp_probe(void) if ((segment = (u_long) * (u_short *) (KERNBASE + 0x40e)) != 0) { /* search first 1K of EBDA */ target = (u_int32_t) (segment << 4); - if ((x = search_for_sig(target, 1024 / 4)) >= 0) + if ((x = search_for_sig(target, 1024 / 4)) != -1L) goto found; } else { /* last 1K of base memory, effective 'top of base' passed in */ target = (u_int32_t) (base_memory - 0x400); - if ((x = search_for_sig(target, 1024 / 4)) >= 0) + if ((x = search_for_sig(target, 1024 / 4)) != -1L) goto found; } /* search the BIOS */ target = (u_int32_t) BIOS_BASE; - if ((x = search_for_sig(target, BIOS_COUNT)) >= 0) + if ((x = search_for_sig(target, BIOS_COUNT)) != -1L) goto found; /* nothing found */ @@ -632,7 +632,7 @@ search_for_sig(u_int32_t target, int count) for (x = 0; x < count; NEXT(x)) if (addr[x] == MP_SIG) /* make array index a byte index */ - return (target + (x * sizeof(u_int32_t))); + return (long)(&addr[x]); return -1; } @@ -935,6 +935,7 @@ mptable_pass2(void) if ((cth = mpfps->pap) == 0) panic("MP Configuration Table Header MISSING!"); + cth = PHYS_TO_DMAP(mpfps->pap); /* walk the table, recording info of interest */ totalSize = cth->base_table_length - sizeof(struct MPCTH); position = (u_char *) cth + sizeof(struct MPCTH);