Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/mptable.c
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* look for the MP spec signature | * look for the MP spec signature | ||||
*/ | */ | ||||
static int | static int | ||||
search_for_sig(u_int32_t target, int count) | search_for_sig(u_int32_t target, int count) | ||||
{ | { | ||||
int x; | int x; | ||||
u_int32_t *addr = (u_int32_t *) (KERNBASE + target); | u_int32_t *addr; | ||||
#ifdef __amd64__ | |||||
addr = (u_int32_t *) (KERNBASE + target); | |||||
#else /* __i386__ */ | |||||
addr = (u_int32_t *) (PMAP_MAP_LOW + target); | |||||
#endif | |||||
for (x = 0; x < count; x += 4) | for (x = 0; x < count; x += 4) | ||||
if (addr[x] == MP_SIG) | if (addr[x] == MP_SIG) | ||||
/* make array index a byte index */ | /* make array index a byte index */ | ||||
return (target + (x * sizeof(u_int32_t))); | return (target + (x * sizeof(u_int32_t))); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
static int | static int | ||||
Show All 14 Lines | |||||
static int | static int | ||||
mptable_probe(void) | mptable_probe(void) | ||||
{ | { | ||||
int x; | int x; | ||||
u_long segment; | u_long segment; | ||||
u_int32_t target; | u_int32_t target; | ||||
/* see if EBDA exists */ | /* see if EBDA exists */ | ||||
if ((segment = (u_long) * (u_short *) (KERNBASE + 0x40e)) != 0) { | if ((segment = (u_long) * (u_short *) ( | ||||
#ifdef __amd64__ | |||||
KERNBASE | |||||
#else /* __i386__ */ | |||||
PMAP_MAP_LOW | |||||
#endif | |||||
+ 0x40e)) != 0) { | |||||
/* search first 1K of EBDA */ | /* search first 1K of EBDA */ | ||||
target = (u_int32_t) (segment << 4); | target = (u_int32_t) (segment << 4); | ||||
if ((x = search_for_sig(target, 1024 / 4)) >= 0) | if ((x = search_for_sig(target, 1024 / 4)) >= 0) | ||||
goto found; | goto found; | ||||
} else { | } else { | ||||
/* last 1K of base memory, effective 'top of base' passed in */ | /* last 1K of base memory, effective 'top of base' passed in */ | ||||
target = (u_int32_t) ((basemem * 1024) - 0x400); | target = (u_int32_t) ((basemem * 1024) - 0x400); | ||||
if ((x = search_for_sig(target, 1024 / 4)) >= 0) | if ((x = search_for_sig(target, 1024 / 4)) >= 0) | ||||
▲ Show 20 Lines • Show All 996 Lines • Show Last 20 Lines |