extern int cpu_architecture(void);
 extern void cpu_init(void);
 
-void arm_machine_restart(char mode);
-extern void (*arm_pm_restart)(char str);
+void arm_machine_restart(char mode, const char *cmd);
+extern void (*arm_pm_restart)(char str, const char *cmd);
 
 #define UDBG_UNDEFINED (1 << 0)
 #define UDBG_SYSCALL   (1 << 1)
 
 __setup("nohlt", nohlt_setup);
 __setup("hlt", hlt_setup);
 
-void arm_machine_restart(char mode)
+void arm_machine_restart(char mode, const char *cmd)
 {
        /*
         * Clean and disable cache, and turn off interrupts
        /*
         * Now call the architecture specific reboot code.
         */
-       arch_reset(mode);
+       arch_reset(mode, cmd);
 
        /*
         * Whoops - the architecture was unable to reboot.
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-void (*arm_pm_restart)(char str) = arm_machine_restart;
+void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
 EXPORT_SYMBOL_GPL(arm_pm_restart);
 
 
                pm_power_off();
 }
 
-void machine_restart(char * __unused)
+void machine_restart(char *cmd)
 {
-       arm_pm_restart(reboot_mode);
+       arm_pm_restart(reboot_mode, cmd);
 }
 
 void __show_regs(struct pt_regs *regs)
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
 
 void (*at91_arch_reset)(void);
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /* call the CPU-specific reset function */
        if (at91_arch_reset)
 
        mov     r0, r0");
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
        cpu_do_idle();
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
        davinci_watchdog_reset();
 }
 
        asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
 }
 
-#define arch_reset(mode)       cpu_reset(0x80000000)
+#define arch_reset(mode, cmd)  cpu_reset(0x80000000)
 
 #endif
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        u32 devicecfg;
 
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                /*
 
 }
 
 
-static __inline__ void arch_reset(char mode)
+static __inline__ void arch_reset(char mode, const char *cmd)
 {
        CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
 }
 
 }
 
 static inline void
-arch_reset(char mode)
+arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * To reset, we hit the on-board reset register
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * Reset the internal bus (warning both cores are reset)
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        local_irq_disable();
 
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        *IOP3XX_PCSR = 0x30;
 
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        local_irq_disable();
 
 
 #endif
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /* First try machine specific support */
        if (machine_is_ixdp2351()) {
 
 }
 
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        if ( 1 && mode == 's') {
                /* Jump into ROM at address 0 */
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * Enable soft reset to assert RSTOUTn.
 
 
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
        unsigned int reg;
 
 
        *(unsigned long *)(IO_BASE + 0x50004) = 1;      /* idle mode */
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                cpu_reset(0);
 
        cpu_do_idle ();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        cpu_reset (0);
 }
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * Enable soft reset to assert RSTOUTn.
 
 
 void arch_idle(void);
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        for (;;) ;  /* depends on IPC w/ other core */
 }
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * Enable soft reset to assert RSTOUTn.
 
 /*
  * Reset the system. It is called by machine_restart().
  */
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
        struct clk *clk;
 
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
               NETX_SYSTEM_RES_CR);
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 #ifdef CONFIG_PROCESSOR_NS9360
        if (processor_is_ns9360())
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        /*
         * Enable and issue soft reset
 
 
 static void lsmini_power_off(void)
 {
-       arch_reset(0);
+       arch_reset(0, NULL);
 }
 
 
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
                /* Green LED off tells the bootloader to halt */
                gpio_set_value(CORGI_GPIO_LED_GREEN, 0);
 
-       arm_machine_restart('h');
+       arm_machine_restart('h', NULL);
 }
 
-static void corgi_restart(char mode)
+static void corgi_restart(char mode, const char *cmd)
 {
        if (!machine_is_corgi())
                /* Green LED on tells the bootloader to reboot */
                gpio_set_value(CORGI_GPIO_LED_GREEN, 1);
 
-       arm_machine_restart('h');
+       arm_machine_restart('h', cmd);
 }
 
 static void __init corgi_init(void)
 
 }
 
 
-void arch_reset(char mode);
+void arch_reset(char mode, const char *cmd);
 
 static void mioa701_poweroff(void)
 {
        mioa701_machine_exit();
-       arm_machine_restart('s');
+       arm_machine_restart('s', NULL);
 }
 
-static void mioa701_restart(char c)
+static void mioa701_restart(char c, const char *cmd)
 {
        mioa701_machine_exit();
-       arm_machine_restart('s');
+       arm_machine_restart('s', cmd);
 }
 
 struct gpio_ress global_gpios[] = {
 
 
 static void poodle_poweroff(void)
 {
-       arm_machine_restart('h');
+       arm_machine_restart('h', NULL);
 }
 
-static void poodle_restart(char mode)
+static void poodle_restart(char mode, const char *cmd)
 {
-       arm_machine_restart('h');
+       arm_machine_restart('h', cmd);
 }
 
 static void __init poodle_init(void)
 
        OSMR3 = OSCR + 368640;  /* ... in 100 ms */
 }
 
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
        clear_reset_status(RESET_STATUS_ALL);
 
 
 
 static void spitz_poweroff(void)
 {
-       arm_machine_restart('g');
+       arm_machine_restart('g', NULL);
 }
 
-static void spitz_restart(char mode)
+static void spitz_restart(char mode, const char *cmd)
 {
        /* Bootloader magic for a reboot */
        if((MSC0 & 0xffff0000) == 0x7ff00000)
 
 
 static void tosa_poweroff(void)
 {
-       arm_machine_restart('g');
+       arm_machine_restart('g', NULL);
 }
 
-static void tosa_restart(char mode)
+static void tosa_restart(char mode, const char *cmd)
 {
        /* Bootloader magic for a reboot */
        if((MSC0 & 0xffff0000) == 0x7ff00000)
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET;
        unsigned int val;
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        iomd_writeb(0, IOMD_ROMCR0);
 
 
 extern void (*s3c24xx_reset_hook)(void);
 
 static void
-arch_reset(char mode)
+arch_reset(char mode, const char *cmd)
 {
        struct clk *wdtclk;
 
 
        /* nothing here yet */
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
        /* nothing here yet */
 }
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                /* Jump into ROM at address 0 */
 
 #define ROMCARD_SIZE            0x08000000
 #define ROMCARD_START           0x10000000
 
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
         short temp;
         local_irq_disable();
 
 #define __ASM_ARCH_SYSTEM_H
 
 /* Found in arch/mach-shark/core.c */
-extern void arch_reset(char mode);
+extern void arch_reset(char mode, const char *cmd);
 
 static inline void arch_idle(void)
 {
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        u32 val;
 
 
 {
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        cpu_reset(0);
 }
 
                omap_writew(1, ARM_RSTCT1);
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
        if (!cpu_class_is_omap2())
                omap1_arch_reset(mode);
 
  * with the caches enabled. It seems at least the S3C2440 has a problem
  * resetting if there is bus activity interrupted by the reset.
  */
-static void s3c24xx_pm_restart(char mode)
+static void s3c24xx_pm_restart(char mode, const char *cmd)
 {
        if (mode != 's') {
                unsigned long flags;
                __cpuc_flush_kern_all();
                __cpuc_flush_user_all();
 
-               arch_reset(mode);
+               arch_reset(mode, cmd);
                local_irq_restore(flags);
        }
 
        /* fallback, or unhandled */
-       arm_machine_restart(mode);
+       arm_machine_restart(mode, cmd);
 }
 
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)