diff options
author | Steven J. Hill <Steven.Hill@imgtec.com> | 2013-03-25 13:07:40 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-09 11:55:18 -0400 |
commit | 8fe4bb98e42945ddf2c0d47cec647ef76909e812 (patch) | |
tree | 35ef93d291f2dabfbb8504de8c12c5ccf232fe08 /arch/mips/mm | |
parent | f6b06d9361a008afb93b97fb3683a6e92d69d0f4 (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>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/uasm-micromips.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c index 476d50c5fac1..162ee6d62788 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) | |||
130 | 130 | ||
131 | static inline __uasminit u32 build_jimm(u32 arg) | 131 | static inline __uasminit u32 build_jimm(u32 arg) |
132 | { | 132 | { |
133 | WARN(arg & ~(JIMM_MASK << 2), | 133 | |
134 | WARN(arg & ~((JIMM_MASK << 2) | 1), | ||
134 | KERN_WARNING "Micro-assembler field overflow\n"); | 135 | KERN_WARNING "Micro-assembler field overflow\n"); |
135 | 136 | ||
136 | return (arg >> 1) & JIMM_MASK; | 137 | return (arg >> 1) & JIMM_MASK; |