diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-12-04 05:42:49 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-12-04 05:42:49 +0000 |
commit | 8d0261375452763c30c54531f0b19240bdbca8f3 (patch) | |
tree | acc2f987a0d1da5a43e1394ce2e4f24259966a5a /sys/arch/m88k | |
parent | 05ea74e4eb25c9e6e7c3e1303099351c159837ad (diff) |
In double_reg_fixup(), do not rely on tf_r[0] being zero.
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 793a5f0a44a..67fcba101fe 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.57 2007/12/04 05:37:40 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.58 2007/12/04 05:42:48 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -1749,13 +1749,13 @@ double_reg_fixup(struct trapframe *frame) store = 1; break; default: - switch (instr & 0xfc000000) { - case 0x10000000: /* ld.d rD, rS, imm16 */ + switch (instr >> 26) { + case 0x10000000 >> 26: /* ld.d rD, rS, imm16 */ addr = (instr & 0x0000ffff) + frame->tf_r[(instr >> 16) & 0x1f]; store = 0; break; - case 0x20000000: /* st.d rD, rS, imm16 */ + case 0x20000000 >> 26: /* st.d rD, rS, imm16 */ addr = (instr & 0x0000ffff) + frame->tf_r[(instr >> 16) & 0x1f]; store = 1; @@ -1776,13 +1776,16 @@ double_reg_fixup(struct trapframe *frame) /* * Two word stores. */ - value = frame->tf_r[regno++]; + if (regno == 0) + value = 0; + else + value = frame->tf_r[regno]; if (copyout(&value, (void *)addr, sizeof(u_int32_t)) != 0) return SIGSEGV; - if (regno == 32) + if (regno == 31) value = 0; else - value = frame->tf_r[regno]; + value = frame->tf_r[regno + 1]; if (copyout(&value, (void *)(addr + 4), sizeof(u_int32_t)) != 0) return SIGSEGV; } else { |