]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/signal.c
[SPARC64]: Call real_setup_per_cpu_areas() earlier and use lmb_alloc().
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / signal.c
index 203e87301005c985a95d08208c94def7222d47a2..1c47009eb5ec09068e7417d4c158c97c841c230d 100644 (file)
 
 #include <asm/uaccess.h>
 #include <asm/ptrace.h>
-#include <asm/svr4.h>
 #include <asm/pgtable.h>
 #include <asm/fpumacro.h>
 #include <asm/uctx.h>
 #include <asm/siginfo.h>
 #include <asm/visasm.h>
 
+#include "entry.h"
+#include "systbls.h"
+
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 /* {set, get}context() needed for 64-bit SparcLinux userland. */
@@ -289,9 +291,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
        struct rt_signal_frame __user *sf;
        unsigned long tpc, tnpc, tstate;
        __siginfo_fpu_t __user *fpu_save;
-       mm_segment_t old_fs;
        sigset_t set;
-       stack_t st;
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
@@ -327,20 +327,13 @@ void do_rt_sigreturn(struct pt_regs *regs)
                err |= restore_fpu_state(regs, &sf->fpu_state);
 
        err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
-       err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t));
-       
+       err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf);
+
        if (err)
                goto segv;
-               
+
        regs->tpc = tpc;
        regs->tnpc = tnpc;
-       
-       /* It is more difficult to avoid calling this function than to
-          call it and ignore errors.  */
-       old_fs = get_fs();
-       set_fs(KERNEL_DS);
-       do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf);
-       set_fs(old_fs);
 
        sigdelsetmask(&set, ~_BLOCKABLE);
        spin_lock_irq(&current->sighand->siglock);
@@ -363,7 +356,7 @@ static int invalid_frame_pointer(void __user *fp, int fplen)
 static inline int
 save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
 {
-       unsigned long *fpregs = (unsigned long *)(regs+1);
+       unsigned long *fpregs = current_thread_info()->fpregs;
        unsigned long fprs;
        int err = 0;