]> err.no Git - linux-2.6/blobdiff - arch/ia64/kernel/unaligned.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6] / arch / ia64 / kernel / unaligned.c
index 1e357550c776c20d7ffa7ac4a57e59baee6adfd7..52f70bbc192a6faa68ad87bd76bde20b37a6bb73 100644 (file)
@@ -15,7 +15,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/smp_lock.h>
 #include <linux/tty.h>
 
 #include <asm/intrinsics.h>
@@ -24,7 +23,7 @@
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
-extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
+extern int die_if_kernel(char *str, struct pt_regs *regs, long err);
 
 #undef DEBUG_UNALIGNED_TRAP
 
@@ -676,8 +675,9 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi
         */
        if (ld.x6_op == 1 || ld.x6_op == 3) {
                printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__);
-               die_if_kernel("unaligned reference on speculative load with register update\n",
-                             regs, 30);
+               if (die_if_kernel("unaligned reference on speculative load with register update\n",
+                                 regs, 30))
+                       return;
        }
 
 
@@ -1318,7 +1318,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
 
        if (ia64_psr(regs)->be) {
                /* we don't support big-endian accesses */
-               die_if_kernel("big-endian unaligned accesses are not supported", regs, 0);
+               if (die_if_kernel("big-endian unaligned accesses are not supported", regs, 0))
+                       return;
                goto force_sigbus;
        }
 
@@ -1341,7 +1342,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
                        size_t len;
 
                        len = sprintf(buf, "%s(%d): unaligned access to 0x%016lx, "
-                                     "ip=0x%016lx\n\r", current->comm, current->pid,
+                                     "ip=0x%016lx\n\r", current->comm,
+                                     task_pid_nr(current),
                                      ifa, regs->cr_iip + ipsr->ri);
                        /*
                         * Don't call tty_write_message() if we're in the kernel; we might
@@ -1364,7 +1366,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
                                       "administrator\n"
                                       "echo 0 > /proc/sys/kernel/ignore-"
                                       "unaligned-usertrap to re-enable\n",
-                                      current->comm, current->pid);
+                                      current->comm, task_pid_nr(current));
                        }
                }
        } else {
@@ -1488,16 +1490,19 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
              case LDFA_OP:
              case LDFCCLR_OP:
              case LDFCNC_OP:
-             case LDF_IMM_OP:
-             case LDFA_IMM_OP:
-             case LDFCCLR_IMM_OP:
-             case LDFCNC_IMM_OP:
                if (u.insn.x)
                        ret = emulate_load_floatpair(ifa, u.insn, regs);
                else
                        ret = emulate_load_float(ifa, u.insn, regs);
                break;
 
+             case LDF_IMM_OP:
+             case LDFA_IMM_OP:
+             case LDFCCLR_IMM_OP:
+             case LDFCNC_IMM_OP:
+               ret = emulate_load_float(ifa, u.insn, regs);
+               break;
+
              case STF_OP:
              case STF_IMM_OP:
                ret = emulate_store_float(ifa, u.insn, regs);
@@ -1531,7 +1536,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
                        ia64_handle_exception(regs, eh);
                        goto done;
                }
-               die_if_kernel("error during unaligned kernel access\n", regs, ret);
+               if (die_if_kernel("error during unaligned kernel access\n", regs, ret))
+                       return;
                /* NOT_REACHED */
        }
   force_sigbus: