This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / mips / sibyte / cfe / setup.c
index d6d0364..3dd85d5 100644 (file)
@@ -19,7 +19,6 @@
 #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>
@@ -56,45 +55,36 @@ int cfe_cons_handle;
 
 #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)
@@ -107,6 +97,17 @@ 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 &&
@@ -246,9 +247,9 @@ void __init prom_init(void)
        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