You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Ralf Baechle
parent
b0d8a082ce
commit
e233c73378
@@ -390,6 +390,8 @@
|
|||||||
#define CAUSEF_IP7 (_ULCAST_(1) << 15)
|
#define CAUSEF_IP7 (_ULCAST_(1) << 15)
|
||||||
#define CAUSEB_FDCI 21
|
#define CAUSEB_FDCI 21
|
||||||
#define CAUSEF_FDCI (_ULCAST_(1) << 21)
|
#define CAUSEF_FDCI (_ULCAST_(1) << 21)
|
||||||
|
#define CAUSEB_WP 22
|
||||||
|
#define CAUSEF_WP (_ULCAST_(1) << 22)
|
||||||
#define CAUSEB_IV 23
|
#define CAUSEB_IV 23
|
||||||
#define CAUSEF_IV (_ULCAST_(1) << 23)
|
#define CAUSEF_IV (_ULCAST_(1) << 23)
|
||||||
#define CAUSEB_PCI 26
|
#define CAUSEB_PCI 26
|
||||||
|
|||||||
@@ -1498,16 +1498,13 @@ asmlinkage void do_watch(struct pt_regs *regs)
|
|||||||
{
|
{
|
||||||
siginfo_t info = { .si_signo = SIGTRAP, .si_code = TRAP_HWBKPT };
|
siginfo_t info = { .si_signo = SIGTRAP, .si_code = TRAP_HWBKPT };
|
||||||
enum ctx_state prev_state;
|
enum ctx_state prev_state;
|
||||||
u32 cause;
|
|
||||||
|
|
||||||
prev_state = exception_enter();
|
prev_state = exception_enter();
|
||||||
/*
|
/*
|
||||||
* Clear WP (bit 22) bit of cause register so we don't loop
|
* Clear WP (bit 22) bit of cause register so we don't loop
|
||||||
* forever.
|
* forever.
|
||||||
*/
|
*/
|
||||||
cause = read_c0_cause();
|
clear_c0_cause(CAUSEF_WP);
|
||||||
cause &= ~(1 << 22);
|
|
||||||
write_c0_cause(cause);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the current thread has the watch registers loaded, save
|
* If the current thread has the watch registers loaded, save
|
||||||
|
|||||||
Reference in New Issue
Block a user