Move elfboot out of linuxbiosmain.

In hardwaremain call linuxbiosmain with it's traditional parameters,
but only call it if we aren't using elf_boot.
This commit is contained in:
Eric W. Biederman 2002-07-11 13:31:59 +00:00
parent be0dfbddca
commit 4961c2dceb
2 changed files with 25 additions and 22 deletions

View file

@ -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 */
}

View file

@ -26,9 +26,6 @@
#include <stdlib.h>
#include <boot/linuxbios_table.h>
#if USE_ELF_BOOT
#include <boot/elf.h>
#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 */
}