summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven J. Hill <Steven.Hill@imgtec.com>2013-03-25 12:07:40 -0500
committerRalf Baechle <ralf@linux-mips.org>2013-05-09 17:55:18 +0200
commit8fe4bb98e42945ddf2c0d47cec647ef76909e812 (patch)
tree35ef93d291f2dabfbb8504de8c12c5ccf232fe08
parentf6b06d9361a008afb93b97fb3683a6e92d69d0f4 (diff)
MIPS: microMIPS: Fix incorrect mask for jump immediate.
Jump or branch target addresses have the first bit set. The original mask did not take this into account and will cause a field overflow warning for the target address when a jump immediate instruction is built. Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
-rw-r--r--arch/mips/mm/uasm-micromips.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c
index 476d50c5fac..162ee6d6278 100644
--- a/arch/mips/mm/uasm-micromips.c
+++ b/arch/mips/mm/uasm-micromips.c
@@ -130,7 +130,8 @@ static inline __uasminit u32 build_bimm(s32 arg)
static inline __uasminit u32 build_jimm(u32 arg)
{
- WARN(arg & ~(JIMM_MASK << 2),
+
+ WARN(arg & ~((JIMM_MASK << 2) | 1),
KERN_WARNING "Micro-assembler field overflow\n");
return (arg >> 1) & JIMM_MASK;