do not longer search a MP table, if MAX_CORES is set to 1

This commit is contained in:
Stefan Lankes 2011-07-22 21:17:15 +02:00
parent ff8c37d68d
commit ff2b9da103

View file

@ -60,9 +60,9 @@ static uint32_t ncores = 1;
static uint8_t irq_redirect[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF};
#if MAX_CORES > 1
static uint8_t boot_code[] = { 0xFA, 0x0F, 0x01, 0x16, 0x3B, 0x70, 0x0F, 0x20, 0xC0, 0x0C, 0x01, 0x0F, 0x22, 0xC0, 0x66, 0xEA, 0x16, 0x70, 0x00, 0x00, 0x08, 0x00, 0x31, 0xC0, 0x66, 0xB8, 0x10, 0x00, 0x8E, 0xD8, 0x8E, 0xC0, 0x8E, 0xE0, 0x8E, 0xE8, 0x8E, 0xD0, 0xBC, 0xEF, 0xBE, 0xAD, 0xDE, 0x68, 0xAD, 0xDE, 0xAD, 0xDE, 0x6A, 0x00, 0xEA, 0xDE, 0xC0, 0xAD, 0xDE, 0x08, 0x00, 0xEB, 0xFE, 0x17, 0x00, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00};
static atomic_int32_t cpu_online = ATOMIC_INIT(1);
#endif
static uint8_t initialized = 0;
static atomic_int32_t cpu_online = ATOMIC_INIT(1);
spinlock_t bootlock = SPINLOCK_INIT;
// forward declaration
@ -327,6 +327,7 @@ void smp_start(uint32_t id)
}
#endif
#if MAX_CORES > 1
static unsigned int* search_apic(unsigned int base, unsigned int limit) {
uint32_t* ptr;
@ -340,7 +341,6 @@ static unsigned int* search_apic(unsigned int base, unsigned int limit) {
return NULL;
}
#if MAX_CORES > 1
int smp_init(void)
{
uint32_t i, j;
@ -559,6 +559,7 @@ static int apic_probe(void)
uint32_t i, count;
int isa_bus = -1;
#if MAX_CORES > 1
apic_mp = (apic_mp_t*) search_apic(0xF0000, 0x100000);
if (apic_mp)
goto found_mp;
@ -590,6 +591,7 @@ static int apic_probe(void)
}
#endif
found_mp:
#endif
if (!apic_mp)
goto no_mp;