aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ptrace.c
diff options
context:
space:
mode:
authorK.Prasad <prasad@linux.vnet.ibm.com>2009-06-01 14:13:10 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-06-02 16:46:57 -0400
commitb332828c39326b1dca617f387dd15d12e81cd5f0 (patch)
treeb8cff4bd7a5b42a723e26d69cce4f3030bf68e62 /arch/x86/kernel/ptrace.c
parent43bd1236234cacbc18d1476a9b57e7a306efddf5 (diff)
hw-breakpoints: prepare the code for Hardware Breakpoint interfaces
The generic hardware breakpoint interface provides an abstraction of hardware breakpoints in front of specific arch implementations for both kernel and user side breakpoints. This includes execution breakpoints and read/write breakpoints, also known as "watchpoints". This patch introduces header files containing constants, structure definitions and declaration of functions used by the hardware breakpoint core and x86 specific code. It also introduces an array based storage for the debug-register values in 'struct thread_struct', while modifying all users of debugreg<n> member in the structure. [ Impact: add headers for new hardware breakpoint interface ] 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/kernel/ptrace.c')
-rw-r--r--arch/x86/kernel/ptrace.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 09ecbde91c13..313be40be55a 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -471,10 +471,10 @@ static int genregs_set(struct task_struct *target,
471static unsigned long ptrace_get_debugreg(struct task_struct *child, int n) 471static unsigned long ptrace_get_debugreg(struct task_struct *child, int n)
472{ 472{
473 switch (n) { 473 switch (n) {
474 case 0: return child->thread.debugreg0; 474 case 0: return child->thread.debugreg[0];
475 case 1: return child->thread.debugreg1; 475 case 1: return child->thread.debugreg[1];
476 case 2: return child->thread.debugreg2; 476 case 2: return child->thread.debugreg[2];
477 case 3: return child->thread.debugreg3; 477 case 3: return child->thread.debugreg[3];
478 case 6: return child->thread.debugreg6; 478 case 6: return child->thread.debugreg6;
479 case 7: return child->thread.debugreg7; 479 case 7: return child->thread.debugreg7;
480 } 480 }
@@ -493,10 +493,10 @@ static int ptrace_set_debugreg(struct task_struct *child,
493 return -EIO; 493 return -EIO;
494 494
495 switch (n) { 495 switch (n) {
496 case 0: child->thread.debugreg0 = data; break; 496 case 0: child->thread.debugreg[0] = data; break;
497 case 1: child->thread.debugreg1 = data; break; 497 case 1: child->thread.debugreg[1] = data; break;
498 case 2: child->thread.debugreg2 = data; break; 498 case 2: child->thread.debugreg[2] = data; break;
499 case 3: child->thread.debugreg3 = data; break; 499 case 3: child->thread.debugreg[3] = data; break;
500 500
501 case 6: 501 case 6:
502 if ((data & ~0xffffffffUL) != 0) 502 if ((data & ~0xffffffffUL) != 0)