fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / m32r / kernel / process.c
index b556c3c..95acb57 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
@@ -50,6 +49,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
  * Powermanagement idle function, if any..
  */
 void (*pm_idle)(void) = NULL;
+EXPORT_SYMBOL(pm_idle);
+
+void (*pm_power_off)(void) = NULL;
+EXPORT_SYMBOL(pm_power_off);
 
 void disable_hlt(void)
 {
@@ -104,19 +107,23 @@ void cpu_idle (void)
 
                        idle();
                }
+               preempt_enable_no_resched();
                schedule();
+               preempt_disable();
        }
 }
 
 void machine_restart(char *__unused)
 {
+#if defined(CONFIG_PLAT_MAPPI3)
+       outw(1, (unsigned long)PLD_REBOOT);
+#endif
+
        printk("Please push reset button!\n");
        while (1)
                cpu_relax();
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        printk("Please push reset button!\n");
@@ -124,15 +131,11 @@ void machine_halt(void)
                cpu_relax();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        /* M32R_FIXME */
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 static int __init idle_setup (char *str)
 {
        if (!strncmp(str, "poll", 4)) {
@@ -171,7 +174,7 @@ void show_regs(struct pt_regs * regs)
          regs->acc1h, regs->acc1l);
 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
        printk("ACCH[%08lx]:ACCL[%08lx]\n", \
-         regs->acch, regs->accl);
+         regs->acc0h, regs->acc0l);
 #else
 #error unknown isa configuration
 #endif
@@ -208,8 +211,8 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
        regs.psw = M32R_PSW_BIE;
 
        /* Ok, create the new process. */
-       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL,
-               NULL);
+       return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
+               0, &regs, 0, NULL, NULL);
 }
 
 /*
@@ -242,13 +245,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
 int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
        unsigned long unused, struct task_struct *tsk, struct pt_regs *regs)
 {
-       struct pt_regs *childregs;
-       unsigned long sp = (unsigned long)tsk->thread_info + THREAD_SIZE;
+       struct pt_regs *childregs = task_pt_regs(tsk);
        extern void ret_from_fork(void);
 
        /* Copy registers */
-       sp -= sizeof (struct pt_regs);
-       childregs = (struct pt_regs *)sp;
        *childregs = *regs;
 
        childregs->spu = spu;
@@ -260,14 +260,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
        return 0;
 }
 
-/*
- * fill in the user structure for a core dump..
- */
-void dump_thread(struct pt_regs * regs, struct user * dump)
-{
-       /* M32R_FIXME */
-}
-
 /*
  * Capture the user space registers if the task is not running (in user space)
  */