summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2006-01-12 01:05:37 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 09:08:50 -0800
commite52f4ca2a7cfea3495cabae23d48f1538f09ccf2 (patch)
treed924a14c6e64a768faf98eb19deb5b7e81ca9934 /arch
parent27f451304aa6f2bccf34ef3c2b049c01d05d6fff (diff)
downloadop-kernel-dev-e52f4ca2a7cfea3495cabae23d48f1538f09ccf2.zip
op-kernel-dev-e52f4ca2a7cfea3495cabae23d48f1538f09ccf2.tar.gz
[PATCH] alpha: task_pt_regs()
) From: Al Viro <viro@ftp.linux.org.uk> rename alpha_task_regs() to task_pt_regs(), switch open-coded instances to use of the helper. 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')
-rw-r--r--arch/alpha/kernel/process.c19
-rw-r--r--arch/alpha/kernel/ptrace.c7
2 files changed, 9 insertions, 17 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 982d732..9924fd0 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -428,30 +428,15 @@ dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti)
int
dump_elf_task(elf_greg_t *dest, struct task_struct *task)
{
- struct thread_info *ti;
- struct pt_regs *pt;
-
- ti = task->thread_info;
- pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
-
- dump_elf_thread(dest, pt, ti);
-
+ dump_elf_thread(dest, task_pt_regs(task), task_thread_info(task));
return 1;
}
int
dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
{
- struct thread_info *ti;
- struct pt_regs *pt;
- struct switch_stack *sw;
-
- ti = task->thread_info;
- pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
- sw = (struct switch_stack *)pt - 1;
-
+ struct switch_stack *sw = (struct switch_stack *)task_pt_regs(task) - 1;
memcpy(dest, sw->fp, 32 * 8);
-
return 1;
}
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 9069281..0cd0605 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -72,6 +72,13 @@ enum {
REG_R0 = 0, REG_F0 = 32, REG_FPCR = 63, REG_PC = 64
};
+#define PT_REG(reg) \
+ (PAGE_SIZE*2 - sizeof(struct pt_regs) + offsetof(struct pt_regs, reg))
+
+#define SW_REG(reg) \
+ (PAGE_SIZE*2 - sizeof(struct pt_regs) - sizeof(struct switch_stack) \
+ + offsetof(struct switch_stack, reg))
+
static int regoff[] = {
PT_REG( r0), PT_REG( r1), PT_REG( r2), PT_REG( r3),
PT_REG( r4), PT_REG( r5), PT_REG( r6), PT_REG( r7),
OpenPOWER on IntegriCloud