diff --git a/src/arch/i386/lib/hardwaremain.c b/src/arch/i386/lib/hardwaremain.c index 0387582787..24fea292aa 100644 --- a/src/arch/i386/lib/hardwaremain.c +++ b/src/arch/i386/lib/hardwaremain.c @@ -166,6 +166,11 @@ static void wait_for_other_cpus(void) printk_debug("All AP CPUs stopped\n"); } +#else /* SMP */ +#define wait_for_other_cpus() do {} while(0) +#endif /* SMP */ + +#if SMP && MAX_PHYSICAL_CPUS static void remove_logical_cpus(void) { /* To turn off hyperthreading just remove the logical @@ -182,11 +187,11 @@ static void remove_logical_cpus(void) } } } +#else -#else /* SMP */ -#define wait_for_other_cpus() do {} while(0) -#define remove_logical_cpus() do {} while(0) -#endif /* SMP */ +#define remove_logical_cpus() do {} while(0) + +#endif /* SMP && MAX_PHYSICAL_CPUS */ void write_tables(struct mem_range *mem) @@ -251,7 +256,6 @@ void hardwaremain(int boot_complete) */ struct mem_range *mem, *tmem; unsigned long totalmem; - extern void linuxbiosmain(struct mem_range *mem); // we don't call post code for this one -- since serial post could cause real // trouble. @@ -393,15 +397,21 @@ void hardwaremain(int boot_complete) write_tables(mem); -#ifdef LINUXBIOS - printk_info("Jumping to linuxbiosmain()...\n"); - // we could go to argc, argv, for main but it seems like overkill. - post_code(0xed); - linuxbiosmain(mem); -#endif /* LINUXBIOS */ +#if USE_ELF_BOOT + elfboot(streams, get_lb_mem()); +#else + { + extern void linuxbiosmain(unsigned long base, unsigned long totalram); + + printk_info("Jumping to linuxbiosmain()...\n"); + // we could go to argc, argv, for main but it seems like overkill. + post_code(0xed); + for(tmem = mem; tmem->sizek; tmem++) { + ; + } + tmem--; + linuxbiosmain(0, tmem->basek + tmem->sizek); + } +#endif /* USE_ELF_BOOT */ } - - - - diff --git a/src/lib/linuxbiosmain.c b/src/lib/linuxbiosmain.c index 7604c110bd..37c4ab9a6e 100644 --- a/src/lib/linuxbiosmain.c +++ b/src/lib/linuxbiosmain.c @@ -26,9 +26,6 @@ #include #include -#if USE_ELF_BOOT -#include -#endif #include "do_inflate.h" @@ -51,9 +48,6 @@ int linuxbiosmain(unsigned long base, unsigned long totalram) int buflen; #endif /* USE_TFTP */ -#if USE_ELF_BOOT - return elfboot(streams, get_lb_mem()); -#else /* !ELF_BOOT */ printk_info("\n"); printk_info("Welcome to start32, the open sourced starter.\n"); printk_info("This space will eventually hold more diagnostic information.\n"); @@ -187,5 +181,4 @@ int linuxbiosmain(unsigned long base, unsigned long totalram) :: "i" (0x100000)); return 0; /* It should not ever return */ -#endif /* ELF_BOOT */ }