[Patch 5/6] Scheduler support for HARDWARE_WATCHPOINTS.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-mips@...>
Cc: <linux-kernel@...>
Date: Monday, April 21, 2008 - 8:33 pm

This is the meat of the patch.  Here we install the watch register values when we
schedule a new thread.

The implemtation of __restore_watch() is in asm/watch.h.  In the case where there
are no watch registers to install (the normal case) the overhead is 5 machine
instructions with gcc-3.4.3.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 include/asm-mips/system.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index a944eda..cd30f83 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -20,6 +20,7 @@
 #include <asm/cmpxchg.h>
 #include <asm/cpu-features.h>
 #include <asm/dsp.h>
+#include <asm/watch.h>
 #include <asm/war.h>
 
 
@@ -76,6 +77,7 @@ do {									\
 		__restore_dsp(current);					\
 	if (cpu_has_userlocal)						\
 		write_c0_userlocal(current_thread_info()->tp_value);	\
+	__restore_watch();						\
 } while (0)
 
 static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
-- 
1.5.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch 0/6] MIPS Hardware watchpoint support for gdb., David Daney, (Mon Apr 21, 7:20 pm)
[Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS., David Daney, (Mon Apr 21, 8:40 pm)
Re: [Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS., Daniel Jacobowitz, (Tue Apr 22, 12:23 pm)
Re: [Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS., Maciej W. Rozycki, (Tue Apr 22, 2:26 pm)
[Patch 5/6] Scheduler support for HARDWARE_WATCHPOINTS., David Daney, (Mon Apr 21, 8:33 pm)
[Patch 1/6] Add HARDWARE_WATCHPOINTS configure option., David Daney, (Mon Apr 21, 8:01 pm)