Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips On N32 kernels, cast offset to (intptr_t)...



details:   https://anonhg.NetBSD.org/src/rev/7c390c7e2611
branches:  trunk
changeset: 768673:7c390c7e2611
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Aug 24 15:11:52 2011 +0000

description:
On N32 kernels, cast offset to (intptr_t) to shrink it back to 32-bits.

diffstat:

 sys/arch/mips/mips/mips_fixup.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 16f59e410201 -r 7c390c7e2611 sys/arch/mips/mips/mips_fixup.c
--- a/sys/arch/mips/mips/mips_fixup.c   Wed Aug 24 12:54:46 2011 +0000
+++ b/sys/arch/mips/mips/mips_fixup.c   Wed Aug 24 15:11:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_fixup.c,v 1.7 2011/08/17 14:39:59 matt Exp $      */
+/*     $NetBSD: mips_fixup.c,v 1.8 2011/08/24 15:11:52 matt Exp $      */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.7 2011/08/17 14:39:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.8 2011/08/24 15:11:52 matt Exp $");
 
 #include "opt_mips3_wired.h"
 #include "opt_multiprocessor.h"
@@ -280,7 +280,8 @@
                                goto out;
                        }
                        regs[insn.IType.rt] = *(const int32_t *)
-                           (regs[insn.IType.rs] + (int16_t)insn.IType.imm);
+                           ((intptr_t)regs[insn.IType.rs]
+                           + (int16_t)insn.IType.imm);
                        used |= (1 << insn.IType.rt);
                        break;
 #endif



Home | Main Index | Thread Index | Old Index