diff options
Diffstat (limited to 'arch/mips/kernel/watch.c')
| -rw-r--r-- | arch/mips/kernel/watch.c | 14 | 
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/mips/kernel/watch.c b/arch/mips/kernel/watch.c index c1540696803..2a03abb5bd2 100644 --- a/arch/mips/kernel/watch.c +++ b/arch/mips/kernel/watch.c @@ -12,7 +12,7 @@  #include <asm/watch.h>  /* - * Install the watch registers for the current thread.  A maximum of + * Install the watch registers for the current thread.	A maximum of   * four registers are installed although the machine may have more.   */  void mips_install_watch_registers(void) @@ -72,7 +72,7 @@ void mips_read_watch_registers(void)   }  /* - * Disable all watch registers.  Although only four registers are + * Disable all watch registers.	 Although only four registers are   * installed, all are cleared to eliminate the possibility of endless   * looping in the watch handler.   */ @@ -100,7 +100,7 @@ void mips_clear_watch_registers(void)  	}  } -__cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c) +void mips_probe_watch_registers(struct cpuinfo_mips *c)  {  	unsigned int t; @@ -111,6 +111,7 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)  	 * disable the register.  	 */  	write_c0_watchlo0(7); +	back_to_back_c0_hazard();  	t = read_c0_watchlo0();  	write_c0_watchlo0(0);  	c->watch_reg_masks[0] = t & 7; @@ -121,12 +122,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)  	c->watch_reg_use_cnt = 1;  	t = read_c0_watchhi0();  	write_c0_watchhi0(t | 0xff8); +	back_to_back_c0_hazard();  	t = read_c0_watchhi0();  	c->watch_reg_masks[0] |= (t & 0xff8);  	if ((t & 0x80000000) == 0)  		return;  	write_c0_watchlo1(7); +	back_to_back_c0_hazard();  	t = read_c0_watchlo1();  	write_c0_watchlo1(0);  	c->watch_reg_masks[1] = t & 7; @@ -135,12 +138,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)  	c->watch_reg_use_cnt = 2;  	t = read_c0_watchhi1();  	write_c0_watchhi1(t | 0xff8); +	back_to_back_c0_hazard();  	t = read_c0_watchhi1();  	c->watch_reg_masks[1] |= (t & 0xff8);  	if ((t & 0x80000000) == 0)  		return;  	write_c0_watchlo2(7); +	back_to_back_c0_hazard();  	t = read_c0_watchlo2();  	write_c0_watchlo2(0);  	c->watch_reg_masks[2] = t & 7; @@ -149,12 +154,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)  	c->watch_reg_use_cnt = 3;  	t = read_c0_watchhi2();  	write_c0_watchhi2(t | 0xff8); +	back_to_back_c0_hazard();  	t = read_c0_watchhi2();  	c->watch_reg_masks[2] |= (t & 0xff8);  	if ((t & 0x80000000) == 0)  		return;  	write_c0_watchlo3(7); +	back_to_back_c0_hazard();  	t = read_c0_watchlo3();  	write_c0_watchlo3(0);  	c->watch_reg_masks[3] = t & 7; @@ -163,6 +170,7 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)  	c->watch_reg_use_cnt = 4;  	t = read_c0_watchhi3();  	write_c0_watchhi3(t | 0xff8); +	back_to_back_c0_hazard();  	t = read_c0_watchhi3();  	c->watch_reg_masks[3] |= (t & 0xff8);  	if ((t & 0x80000000) == 0)  | 
