summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/unaligned.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/unaligned.c')
-rw-r--r--arch/sparc64/kernel/unaligned.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 792334336..989e965a9 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -1,4 +1,4 @@
-/* $Id: unaligned.c,v 1.18 1999/08/02 08:39:44 davem Exp $
+/* $Id: unaligned.c,v 1.19 2000/03/16 11:53:05 jj Exp $
* unaligned.c: Unaligned load/store trap handling with special
* cases for the kernel to do them more quickly.
*
@@ -590,9 +590,19 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs)
maybe_flush_windows(0, 0, rd, from_kernel);
reg = fetch_reg_addr(rd, regs);
- if ((insn & 0x780000) == 0x180000)
- reg[1] = 0;
- reg[0] = 0;
+ if (from_kernel || rd < 16) {
+ reg[0] = 0;
+ if ((insn & 0x780000) == 0x180000)
+ reg[1] = 0;
+ } else if (current->thread.flags & SPARC_FLAG_32BIT) {
+ put_user(0, (int *)reg);
+ if ((insn & 0x780000) == 0x180000)
+ put_user(0, ((int *)reg) + 1);
+ } else {
+ put_user(0, reg);
+ if ((insn & 0x780000) == 0x180000)
+ put_user(0, reg + 1);
+ }
advance(regs);
}