#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
-#include <linux/linkage.h>
#include <linux/mm.h>
#include <linux/blkdev.h>
#include <linux/bootmem.h>
#ifdef CONFIG_BLK_DEV_INITRD
extern unsigned long initrd_start, initrd_end;
+extern void * __rd_start, * __rd_end;
+#endif
+
+#ifdef CONFIG_SMP
+static int reboot_smp = 0;
#endif
#ifdef CONFIG_KGDB
extern int kgdb_port;
#endif
-static void ATTRIB_NORET cfe_linux_exit(void *arg)
+static void cfe_linux_exit(void)
{
- int warm = *(int *)arg;
-
+#ifdef CONFIG_SMP
if (smp_processor_id()) {
- static int reboot_smp;
-
- /* Don't repeat the process from another CPU */
- if (!reboot_smp) {
+ if (reboot_smp) {
+ /* Don't repeat the process from another CPU */
+ for (;;);
+ } else {
/* Get CPU 0 to do the cfe_exit */
reboot_smp = 1;
- smp_call_function(cfe_linux_exit, arg, 1, 0);
+ smp_call_function((void *)_machine_restart, NULL, 1, 0);
+ for (;;);
}
- } else {
- printk("Passing control back to CFE...\n");
- cfe_exit(warm, 0);
- printk("cfe_exit returned??\n");
}
- while (1);
-}
-
-static void ATTRIB_NORET cfe_linux_restart(char *command)
-{
- static const int zero;
-
- cfe_linux_exit((void *)&zero);
-}
-
-static void ATTRIB_NORET cfe_linux_halt(void)
-{
- static const int one = 1;
-
- cfe_linux_exit((void *)&one);
+#endif
+ printk("passing control back to CFE\n");
+ cfe_exit(1, 0);
+ printk("cfe_exit returned??\n");
+ while(1);
}
static __init void prom_meminit(void)
unsigned long initrd_pstart;
unsigned long initrd_pend;
+#ifdef CONFIG_EMBEDDED_RAMDISK
+ /* If we're using an embedded ramdisk, then __rd_start and __rd_end
+ are defined by the linker to be on either side of the ramdisk
+ area. Otherwise, initrd_start should be defined by kernel command
+ line arguments */
+ if (initrd_start == 0) {
+ initrd_start = (unsigned long)&__rd_start;
+ initrd_end = (unsigned long)&__rd_end;
+ }
+#endif
+
initrd_pstart = CPHYSADDR(initrd_start);
initrd_pend = CPHYSADDR(initrd_end);
if (initrd_start &&
char *arg;
#endif
- _machine_restart = cfe_linux_restart;
- _machine_halt = cfe_linux_halt;
- _machine_power_off = cfe_linux_halt;
+ _machine_restart = (void (*)(char *))cfe_linux_exit;
+ _machine_halt = cfe_linux_exit;
+ _machine_power_off = cfe_linux_exit;
/*
* Check if a loader was used; if NOT, the 4 arguments are