aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/power/cpu_64.c
diff options
context:
space:
mode:
authorK.Prasad <prasad@linux.vnet.ibm.com>2009-06-01 14:14:26 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-06-02 16:46:59 -0400
commit1e3500666f7c5daaadadb8431a2927cdbbdb7dd4 (patch)
treeb825e40b508818673ccbab079351d9140bbd48f7 /arch/x86/power/cpu_64.c
parent08d68323d1f0c34452e614263b212ca556dae47f (diff)
hw-breakpoints: use wrapper routines around debug registers in processor related functions
This patch enables the use of wrapper routines to access the debug/breakpoint registers on cpu management. The hardcoded debug registers save and restore operations for threads breakpoints are replaced by wrappers. And now that we handle the kernel breakpoints too, we also need to handle them on cpu hotplug operations. [ Impact: adapt new hardware breakpoint api to cpu hotplug ] Original-patch-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch/x86/power/cpu_64.c')
-rw-r--r--arch/x86/power/cpu_64.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86/power/cpu_64.c b/arch/x86/power/cpu_64.c
index 1e3bdcc959ff..46866a13a93a 100644
--- a/arch/x86/power/cpu_64.c
+++ b/arch/x86/power/cpu_64.c
@@ -16,6 +16,7 @@
16#include <asm/mtrr.h> 16#include <asm/mtrr.h>
17#include <asm/xcr.h> 17#include <asm/xcr.h>
18#include <asm/suspend.h> 18#include <asm/suspend.h>
19#include <asm/debugreg.h>
19 20
20static void fix_processor_context(void); 21static void fix_processor_context(void);
21 22
@@ -71,6 +72,7 @@ static void __save_processor_state(struct saved_context *ctxt)
71 ctxt->cr3 = read_cr3(); 72 ctxt->cr3 = read_cr3();
72 ctxt->cr4 = read_cr4(); 73 ctxt->cr4 = read_cr4();
73 ctxt->cr8 = read_cr8(); 74 ctxt->cr8 = read_cr8();
75 hw_breakpoint_disable();
74} 76}
75 77
76void save_processor_state(void) 78void save_processor_state(void)
@@ -162,13 +164,5 @@ static void fix_processor_context(void)
162 /* 164 /*
163 * Now maybe reload the debug registers 165 * Now maybe reload the debug registers
164 */ 166 */
165 if (current->thread.debugreg7){ 167 load_debug_registers();
166 set_debugreg(current->thread.debugreg[0], 0);
167 set_debugreg(current->thread.debugreg[1], 1);
168 set_debugreg(current->thread.debugreg[2], 2);
169 set_debugreg(current->thread.debugreg[3], 3);
170 /* no 4 and 5 */
171 loaddebug(&current->thread, 6);
172 loaddebug(&current->thread, 7);
173 }
174} 168}