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/ia32 | |
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/ia32')
-rw-r--r-- | arch/x86_64/ia32/ia32_binfmt.c | 7 | ||||
-rw-r--r-- | arch/x86_64/ia32/ptrace32.c | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index 2b760d0d9ce2..029bddab0459 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c | |||
@@ -197,8 +197,7 @@ static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *re | |||
197 | 197 | ||
198 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) | 198 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) |
199 | { | 199 | { |
200 | struct pt_regs *pp = (struct pt_regs *)(t->thread.rsp0); | 200 | struct pt_regs *pp = task_pt_regs(t); |
201 | --pp; | ||
202 | ELF_CORE_COPY_REGS((*elfregs), pp); | 201 | ELF_CORE_COPY_REGS((*elfregs), pp); |
203 | /* fix wrong segments */ | 202 | /* fix wrong segments */ |
204 | (*elfregs)[7] = t->thread.ds; | 203 | (*elfregs)[7] = t->thread.ds; |
@@ -217,7 +216,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr | |||
217 | if (!tsk_used_math(tsk)) | 216 | if (!tsk_used_math(tsk)) |
218 | return 0; | 217 | return 0; |
219 | if (!regs) | 218 | if (!regs) |
220 | regs = ((struct pt_regs *)tsk->thread.rsp0) - 1; | 219 | regs = task_pt_regs(tsk); |
221 | if (tsk == current) | 220 | if (tsk == current) |
222 | unlazy_fpu(tsk); | 221 | unlazy_fpu(tsk); |
223 | set_fs(KERNEL_DS); | 222 | set_fs(KERNEL_DS); |
@@ -233,7 +232,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr | |||
233 | static inline int | 232 | static inline int |
234 | elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) | 233 | elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) |
235 | { | 234 | { |
236 | struct pt_regs *regs = ((struct pt_regs *)(t->thread.rsp0))-1; | 235 | struct pt_regs *regs = task_pt_regs(t); |
237 | if (!tsk_used_math(t)) | 236 | if (!tsk_used_math(t)) |
238 | return 0; | 237 | return 0; |
239 | if (t == current) | 238 | if (t == current) |
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index ea4394e021d6..23a4515a73b4 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c | |||
@@ -41,7 +41,7 @@ | |||
41 | static int putreg32(struct task_struct *child, unsigned regno, u32 val) | 41 | static int putreg32(struct task_struct *child, unsigned regno, u32 val) |
42 | { | 42 | { |
43 | int i; | 43 | int i; |
44 | __u64 *stack = (__u64 *)(child->thread.rsp0 - sizeof(struct pt_regs)); | 44 | __u64 *stack = (__u64 *)task_pt_regs(child); |
45 | 45 | ||
46 | switch (regno) { | 46 | switch (regno) { |
47 | case offsetof(struct user32, regs.fs): | 47 | case offsetof(struct user32, regs.fs): |
@@ -137,7 +137,7 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) | |||
137 | 137 | ||
138 | static int getreg32(struct task_struct *child, unsigned regno, u32 *val) | 138 | static int getreg32(struct task_struct *child, unsigned regno, u32 *val) |
139 | { | 139 | { |
140 | __u64 *stack = (__u64 *)(child->thread.rsp0 - sizeof(struct pt_regs)); | 140 | __u64 *stack = (__u64 *)task_pt_regs(child); |
141 | 141 | ||
142 | switch (regno) { | 142 | switch (regno) { |
143 | case offsetof(struct user32, regs.fs): | 143 | case offsetof(struct user32, regs.fs): |
@@ -238,7 +238,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | |||
238 | if (ret < 0) | 238 | if (ret < 0) |
239 | goto out; | 239 | goto out; |
240 | 240 | ||
241 | childregs = (struct pt_regs *)(child->thread.rsp0 - sizeof(struct pt_regs)); | 241 | childregs = task_pt_regs(child); |
242 | 242 | ||
243 | switch (request) { | 243 | switch (request) { |
244 | case PTRACE_PEEKDATA: | 244 | case PTRACE_PEEKDATA: |