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 | |
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')
-rw-r--r-- | arch/x86_64/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/ptrace.c | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 2 |
3 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index 2ea4acd47fc2..68df519c83e6 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -822,8 +822,7 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | |||
822 | { | 822 | { |
823 | struct pt_regs *pp, ptregs; | 823 | struct pt_regs *pp, ptregs; |
824 | 824 | ||
825 | pp = (struct pt_regs *)(tsk->thread.rsp0); | 825 | pp = task_pt_regs(tsk); |
826 | --pp; | ||
827 | 826 | ||
828 | ptregs = *pp; | 827 | ptregs = *pp; |
829 | ptregs.cs &= 0xffff; | 828 | ptregs.cs &= 0xffff; |
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 | } |
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index d8f90b48aec4..8bb0aeda78b9 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -666,7 +666,7 @@ asmlinkage struct pt_regs *sync_regs(struct pt_regs *eregs) | |||
666 | ; | 666 | ; |
667 | /* Exception from user space */ | 667 | /* Exception from user space */ |
668 | else if (user_mode(eregs)) | 668 | else if (user_mode(eregs)) |
669 | regs = ((struct pt_regs *)current->thread.rsp0) - 1; | 669 | regs = task_pt_regs(current); |
670 | /* Exception from kernel and interrupts are enabled. Move to | 670 | /* Exception from kernel and interrupts are enabled. Move to |
671 | kernel process stack. */ | 671 | kernel process stack. */ |
672 | else if (eregs->eflags & X86_EFLAGS_IF) | 672 | else if (eregs->eflags & X86_EFLAGS_IF) |