fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / i386 / mach-voyager / voyager_basic.c
index 528bc8f..8fe7e45 100644 (file)
@@ -12,7 +12,6 @@
  *     voyager_smp.c - Voyager SMP hal (emulates linux smp.c)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/sysrq.h>
+#include <linux/smp.h>
+#include <linux/nodemask.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/voyager.h>
 #include <asm/vic.h>
 #include <linux/pm.h>
-#include <linux/irq.h>
 #include <asm/tlbflush.h>
 #include <asm/arch_hooks.h>
+#include <asm/i8253.h>
 
 /*
  * Power off function, if any
  */
 void (*pm_power_off)(void);
-
-int reboot_thru_bios;
+EXPORT_SYMBOL(pm_power_off);
 
 int voyager_level = 0;
 
@@ -45,7 +44,7 @@ struct voyager_SUS *voyager_SUS = NULL;
 
 #ifdef CONFIG_SMP
 static void
-voyager_dump(int dummy1, struct pt_regs *dummy2, struct tty_struct *dummy3)
+voyager_dump(int dummy1, struct tty_struct *dummy3)
 {
        /* get here via a sysrq */
        voyager_smp_dump();
@@ -54,7 +53,7 @@ voyager_dump(int dummy1, struct pt_regs *dummy2, struct tty_struct *dummy3)
 static struct sysrq_key_op sysrq_voyager_dump_op = {
        .handler        = voyager_dump,
        .help_msg       = "Voyager",
-       .action_msg     = "Dump Voyager Status\n",
+       .action_msg     = "Dump Voyager Status",
 };
 #endif
 
@@ -88,7 +87,7 @@ voyager_detect(struct voyager_bios_info *bios)
 }
 
 void
-voyager_system_interrupt(int cpl, void *dev_id, struct pt_regs *regs)
+voyager_system_interrupt(int cpl, void *dev_id)
 {
        printk("Voyager: detected system interrupt\n");
 }
@@ -167,7 +166,7 @@ voyager_memory_detect(int region, __u32 *start, __u32 *length)
  * off the timer tick to the SMP code, since the VIC doesn't have an
  * internal timer (The QIC does, but that's another story). */
 void
-voyager_timer_interrupt(struct pt_regs *regs)
+voyager_timer_interrupt(void)
 {
        if((jiffies & 0x3ff) == 0) {
 
@@ -185,7 +184,6 @@ voyager_timer_interrupt(struct pt_regs *regs)
                 * and swiftly introduce it to something sharp and
                 * pointy.  */
                __u16 val;
-               extern spinlock_t i8253_lock;
 
                spin_lock(&i8253_lock);
                
@@ -204,7 +202,7 @@ voyager_timer_interrupt(struct pt_regs *regs)
                }
        }
 #ifdef CONFIG_SMP
-       smp_vic_timer_interrupt(regs);
+       smp_vic_timer_interrupt();
 #endif
 }
 
@@ -236,10 +234,9 @@ voyager_power_off(void)
 #endif
        }
        /* and wait for it to happen */
-       for(;;) {
-               __asm("cli");
-               __asm("hlt");
-       }
+       local_irq_disable();
+       for(;;)
+               halt();
 }
 
 /* copied from process.c */
@@ -253,6 +250,12 @@ kb_wait(void)
                        break;
 }
 
+void
+machine_shutdown(void)
+{
+       /* Architecture specific shutdown needed before a kexec */
+}
+
 void
 machine_restart(char *cmd)
 {
@@ -274,13 +277,17 @@ machine_restart(char *cmd)
                outb(basebd | 0x08, VOYAGER_MC_SETUP);
                outb(0x02, catbase + 0x21);
        }
-       for(;;) {
-               asm("cli");
-               asm("hlt");
-       }
+       local_irq_disable();
+       for(;;)
+               halt();
 }
 
-EXPORT_SYMBOL(machine_restart);
+void
+machine_emergency_restart(void)
+{
+       /*for now, just hook this to a warm restart */
+       machine_restart(NULL);
+}
 
 void
 mca_nmi_hook(void)
@@ -317,12 +324,8 @@ machine_halt(void)
        machine_power_off();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        if (pm_power_off)
                pm_power_off();
 }
-
-EXPORT_SYMBOL(machine_power_off);