diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:05:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:08:51 -0500 |
commit | bb049232fa8fe08c90b182f378eed5017da5235c (patch) | |
tree | b8a71968d4acedf35081986584c6f24c21c68b65 /arch/x86_64/kernel/ptrace.c | |
parent | e4f17c436f8e4241995c2531372be8dd7ea6ff75 (diff) |
[PATCH] amd64: task_pt_regs()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-rw-r--r-- | arch/x86_64/kernel/ptrace.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c index 86248bc9303e..53205622351c 100644 --- a/arch/x86_64/kernel/ptrace.c +++ b/arch/x86_64/kernel/ptrace.c | |||
@@ -67,12 +67,6 @@ static inline unsigned long get_stack_long(struct task_struct *task, int offset) | |||
67 | return (*((unsigned long *)stack)); | 67 | return (*((unsigned long *)stack)); |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline struct pt_regs *get_child_regs(struct task_struct *task) | ||
71 | { | ||
72 | struct pt_regs *regs = (void *)task->thread.rsp0; | ||
73 | return regs - 1; | ||
74 | } | ||
75 | |||
76 | /* | 70 | /* |
77 | * this routine will put a word on the processes privileged stack. | 71 | * this routine will put a word on the processes privileged stack. |
78 | * the offset is how far from the base addr as stored in the TSS. | 72 | * the offset is how far from the base addr as stored in the TSS. |
@@ -170,7 +164,7 @@ static int is_at_popf(struct task_struct *child, struct pt_regs *regs) | |||
170 | 164 | ||
171 | static void set_singlestep(struct task_struct *child) | 165 | static void set_singlestep(struct task_struct *child) |
172 | { | 166 | { |
173 | struct pt_regs *regs = get_child_regs(child); | 167 | struct pt_regs *regs = task_pt_regs(child); |
174 | 168 | ||
175 | /* | 169 | /* |
176 | * Always set TIF_SINGLESTEP - this guarantees that | 170 | * Always set TIF_SINGLESTEP - this guarantees that |
@@ -208,7 +202,7 @@ static void clear_singlestep(struct task_struct *child) | |||
208 | 202 | ||
209 | /* But touch TF only if it was set by us.. */ | 203 | /* But touch TF only if it was set by us.. */ |
210 | if (child->ptrace & PT_DTRACE) { | 204 | if (child->ptrace & PT_DTRACE) { |
211 | struct pt_regs *regs = get_child_regs(child); | 205 | struct pt_regs *regs = task_pt_regs(child); |
212 | regs->eflags &= ~TRAP_FLAG; | 206 | regs->eflags &= ~TRAP_FLAG; |
213 | child->ptrace &= ~PT_DTRACE; | 207 | child->ptrace &= ~PT_DTRACE; |
214 | } | 208 | } |