- add workaround to run the apic code correctly on qemu 12.5

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@290 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2010-11-26 18:15:09 +00:00
parent 0dd542dc47
commit 7871ef692a

View file

@ -55,11 +55,13 @@ static inline void apic_write(uint32_t addr, uint32_t value)
#ifndef CONFIG_MULTIBOOT
static unsigned int* search_apic(unsigned int base, unsigned int limit) {
unsigned int *ptr;
uint32_t* ptr;
for (ptr = (unsigned int *) base; (unsigned int) ptr < limit; ptr++) {
if (*ptr == MP_FLT_SIGNATURE)
return ptr;
for (ptr = (uint32_t*) base; (uint32_t) ptr < limit; ptr++) {
if (*ptr == MP_FLT_SIGNATURE) {
if (!(((apic_mp_t*)ptr)->version > 4) && ((apic_mp_t*)ptr)->features[0])
return ptr;
}
}
return NULL;
@ -163,9 +165,10 @@ static int apic_probe(void)
addr = mmap->addr;
for(i=0; i<mmap->len; i++, addr++) {
if (strncmp((void*)addr, "_MP_", 4) == 0) {
if (*((uint32_t*) addr) == MP_FLT_SIGNATURE) {
apic_mp = (apic_mp_t*) addr;
goto found_mp;
if (!(apic_mp->version > 4) && apic_mp->features[0])
goto found_mp;
}
}
@ -183,8 +186,8 @@ found_mp:
if (!apic_mp)
goto no_mp;
kprintf("System uses Multiprocessing Specification 1.%d\n", apic_mp->version);
kprintf("MP features 1: %d\n", apic_mp->features[0]);
kprintf("System uses Multiprocessing Specification 1.%u\n", apic_mp->version);
kprintf("MP features 1: %u\n", apic_mp->features[0]);
if (apic_mp->features[0]) {
kputs("Currently, MetalSVM supports only multiprocessing via the MP config tables!\n");
@ -208,7 +211,7 @@ found_mp:
addr += 20;
} else addr += 8;
}
kprintf("Found %d cores\n", count);
kprintf("Found %u cores\n", count);
if (count > MAX_CORES) {
kputs("Found too many cores! Increase the macro MAX_CORES!\n");