mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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:
parent
be0dfbddca
commit
4961c2dceb
2 changed files with 25 additions and 22 deletions
|
@ -166,6 +166,11 @@ static void wait_for_other_cpus(void)
|
||||||
printk_debug("All AP CPUs stopped\n");
|
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)
|
static void remove_logical_cpus(void)
|
||||||
{
|
{
|
||||||
/* To turn off hyperthreading just remove the logical
|
/* To turn off hyperthreading just remove the logical
|
||||||
|
@ -182,11 +187,11 @@ static void remove_logical_cpus(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
#else /* SMP */
|
#define remove_logical_cpus() do {} while(0)
|
||||||
#define wait_for_other_cpus() do {} while(0)
|
|
||||||
#define remove_logical_cpus() do {} while(0)
|
#endif /* SMP && MAX_PHYSICAL_CPUS */
|
||||||
#endif /* SMP */
|
|
||||||
|
|
||||||
|
|
||||||
void write_tables(struct mem_range *mem)
|
void write_tables(struct mem_range *mem)
|
||||||
|
@ -251,7 +256,6 @@ void hardwaremain(int boot_complete)
|
||||||
*/
|
*/
|
||||||
struct mem_range *mem, *tmem;
|
struct mem_range *mem, *tmem;
|
||||||
unsigned long totalmem;
|
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
|
// we don't call post code for this one -- since serial post could cause real
|
||||||
// trouble.
|
// trouble.
|
||||||
|
@ -393,15 +397,21 @@ void hardwaremain(int boot_complete)
|
||||||
write_tables(mem);
|
write_tables(mem);
|
||||||
|
|
||||||
|
|
||||||
#ifdef LINUXBIOS
|
#if USE_ELF_BOOT
|
||||||
printk_info("Jumping to linuxbiosmain()...\n");
|
elfboot(streams, get_lb_mem());
|
||||||
// we could go to argc, argv, for main but it seems like overkill.
|
#else
|
||||||
post_code(0xed);
|
{
|
||||||
linuxbiosmain(mem);
|
extern void linuxbiosmain(unsigned long base, unsigned long totalram);
|
||||||
#endif /* LINUXBIOS */
|
|
||||||
|
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 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <boot/linuxbios_table.h>
|
#include <boot/linuxbios_table.h>
|
||||||
|
|
||||||
#if USE_ELF_BOOT
|
|
||||||
#include <boot/elf.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "do_inflate.h"
|
#include "do_inflate.h"
|
||||||
|
|
||||||
|
@ -51,9 +48,6 @@ int linuxbiosmain(unsigned long base, unsigned long totalram)
|
||||||
int buflen;
|
int buflen;
|
||||||
#endif /* USE_TFTP */
|
#endif /* USE_TFTP */
|
||||||
|
|
||||||
#if USE_ELF_BOOT
|
|
||||||
return elfboot(streams, get_lb_mem());
|
|
||||||
#else /* !ELF_BOOT */
|
|
||||||
printk_info("\n");
|
printk_info("\n");
|
||||||
printk_info("Welcome to start32, the open sourced starter.\n");
|
printk_info("Welcome to start32, the open sourced starter.\n");
|
||||||
printk_info("This space will eventually hold more diagnostic information.\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));
|
:: "i" (0x100000));
|
||||||
|
|
||||||
return 0; /* It should not ever return */
|
return 0; /* It should not ever return */
|
||||||
#endif /* ELF_BOOT */
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue