diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-03-01 22:19:38 (GMT) |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-05-13 12:02:13 (GMT) |
commit | e233c733786a8ca70cd12cc30aeb80e5b390ad71 (patch) | |
tree | f11ec3694e1965f884125581ccfe7d19c5a2301d /arch/mips/kernel | |
parent | b0d8a082ce9c82600ebf8949dab937cf53019356 (diff) | |
download | linux-e233c733786a8ca70cd12cc30aeb80e5b390ad71.tar.xz |
MIPS: Add and use CAUSEF_WP definition
do_watch() clears bit 22 of cause without using a CAUSEF_* definition
from mipsregs.h. Add a definition for this bit (CAUSEF_WP) and make use
of it. Also use clear_c0_cause() instead of manual read/modify/write.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12728/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/traps.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 4358f02..dcda63e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1498,16 +1498,13 @@ asmlinkage void do_watch(struct pt_regs *regs) { siginfo_t info = { .si_signo = SIGTRAP, .si_code = TRAP_HWBKPT }; enum ctx_state prev_state; - u32 cause; prev_state = exception_enter(); /* * Clear WP (bit 22) bit of cause register so we don't loop * forever. */ - cause = read_c0_cause(); - cause &= ~(1 << 22); - write_c0_cause(cause); + clear_c0_cause(CAUSEF_WP); /* * If the current thread has the watch registers loaded, save |