Setup_frame is now returning a success value.
[pandora-kernel.git] / arch / mips / kernel / signal32.c
index 8639e24..dbe8213 100644 (file)
@@ -7,6 +7,7 @@
  * Copyright (C) 1994 - 2000  Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
+#include <linux/cache.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -30,6 +31,7 @@
 #include <asm/ucontext.h>
 #include <asm/system.h>
 #include <asm/fpu.h>
+#include <asm/war.h>
 
 #define SI_PAD_SIZE32   ((SI_MAX_SIZE/sizeof(int)) - 3)
 
@@ -392,16 +394,30 @@ static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc)
 
 struct sigframe {
        u32 sf_ass[4];                  /* argument save space for o32 */
+#if ICACHE_REFILLS_WORKAROUND_WAR
+       u32 sf_pad[2];
+#else
        u32 sf_code[2];                 /* signal trampoline */
+#endif
        struct sigcontext32 sf_sc;
        sigset_t sf_mask;
+#if ICACHE_REFILLS_WORKAROUND_WAR
+       u32 sf_code[8] ____cacheline_aligned;   /* signal trampoline */
+#endif
 };
 
 struct rt_sigframe32 {
        u32 rs_ass[4];                  /* argument save space for o32 */
+#if ICACHE_REFILLS_WORKAROUND_WAR
+       u32 rs_pad[2];
+#else
        u32 rs_code[2];                 /* signal trampoline */
+#endif
        compat_siginfo_t rs_info;
        struct ucontext32 rs_uc;
+#if ICACHE_REFILLS_WORKAROUND_WAR
+       u32 rs_code[8] __attribute__((aligned(32)));    /* signal trampoline */
+#endif
 };
 
 int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from)
@@ -753,9 +769,11 @@ give_sigsegv:
        force_sigsegv(signr, current);
 }
 
-static inline void handle_signal(unsigned long sig, siginfo_t *info,
+static inline int handle_signal(unsigned long sig, siginfo_t *info,
        struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs)
 {
+       int ret;
+
        switch (regs->regs[0]) {
        case ERESTART_RESTARTBLOCK:
        case ERESTARTNOHAND:
@@ -775,9 +793,9 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
        regs->regs[0] = 0;              /* Don't deal with this again.  */
 
        if (ka->sa.sa_flags & SA_SIGINFO)
-               current->thread.abi->setup_rt_frame(ka, regs, sig, oldset, info);
+               ret = current->thread.abi->setup_rt_frame(ka, regs, sig, oldset, info);
        else
-               current->thread.abi->setup_frame(ka, regs, sig, oldset);
+               ret = current->thread.abi->setup_frame(ka, regs, sig, oldset);
 
        spin_lock_irq(&current->sighand->siglock);
        sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -785,6 +803,8 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
                sigaddset(&current->blocked,sig);
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
+
+       return ret;
 }
 
 int do_signal32(sigset_t *oldset, struct pt_regs *regs)
@@ -808,10 +828,8 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
                oldset = &current->blocked;
 
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-       if (signr > 0) {
-               handle_signal(signr, &info, &ka, oldset, regs);
-               return 1;
-       }
+       if (signr > 0)
+               return handle_signal(signr, &info, &ka, oldset, regs);
 
 no_signal:
        /*