aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/process.c19
-rw-r--r--arch/alpha/kernel/ptrace.c7
-rw-r--r--include/asm-alpha/processor.h11
-rw-r--r--include/asm-alpha/ptrace.h4
4 files changed, 12 insertions, 29 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 982d732a8705..9924fd07743a 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)
428int 428int
429dump_elf_task(elf_greg_t *dest, struct task_struct *task) 429dump_elf_task(elf_greg_t *dest, struct task_struct *task)
430{ 430{
431 struct thread_info *ti; 431 dump_elf_thread(dest, task_pt_regs(task), task_thread_info(task));
432 struct pt_regs *pt;
433
434 ti = task->thread_info;
435 pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
436
437 dump_elf_thread(dest, pt, ti);
438
439 return 1; 432 return 1;
440} 433}
441 434
442int 435int
443dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task) 436dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
444{ 437{
445 struct thread_info *ti; 438 struct switch_stack *sw = (struct switch_stack *)task_pt_regs(task) - 1;
446 struct pt_regs *pt;
447 struct switch_stack *sw;
448
449 ti = task->thread_info;
450 pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
451 sw = (struct switch_stack *)pt - 1;
452
453 memcpy(dest, sw->fp, 32 * 8); 439 memcpy(dest, sw->fp, 32 * 8);
454
455 return 1; 440 return 1;
456} 441}
457 442
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 9069281313a3..0cd060598f9a 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -72,6 +72,13 @@ enum {
72 REG_R0 = 0, REG_F0 = 32, REG_FPCR = 63, REG_PC = 64 72 REG_R0 = 0, REG_F0 = 32, REG_FPCR = 63, REG_PC = 64
73}; 73};
74 74
75#define PT_REG(reg) \
76 (PAGE_SIZE*2 - sizeof(struct pt_regs) + offsetof(struct pt_regs, reg))
77
78#define SW_REG(reg) \
79 (PAGE_SIZE*2 - sizeof(struct pt_regs) - sizeof(struct switch_stack) \
80 + offsetof(struct switch_stack, reg))
81
75static int regoff[] = { 82static int regoff[] = {
76 PT_REG( r0), PT_REG( r1), PT_REG( r2), PT_REG( r3), 83 PT_REG( r0), PT_REG( r1), PT_REG( r2), PT_REG( r3),
77 PT_REG( r4), PT_REG( r5), PT_REG( r6), PT_REG( r7), 84 PT_REG( r4), PT_REG( r5), PT_REG( r6), PT_REG( r7),
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 12a14a5bbe12..425b7b6d28cb 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -52,16 +52,7 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
52 52
53unsigned long get_wchan(struct task_struct *p); 53unsigned long get_wchan(struct task_struct *p);
54 54
55/* See arch/alpha/kernel/ptrace.c for details. */ 55#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
56#define PT_REG(reg) \
57 (PAGE_SIZE*2 - sizeof(struct pt_regs) + offsetof(struct pt_regs, reg))
58
59#define SW_REG(reg) \
60 (PAGE_SIZE*2 - sizeof(struct pt_regs) - sizeof(struct switch_stack) \
61 + offsetof(struct switch_stack, reg))
62
63#define KSTK_EIP(tsk) \
64 (*(unsigned long *)(PT_REG(pc) + (unsigned long) ((tsk)->thread_info)))
65 56
66#define KSTK_ESP(tsk) \ 57#define KSTK_ESP(tsk) \
67 ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp) 58 ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h
index 994680b73a87..9933b8b3612e 100644
--- a/include/asm-alpha/ptrace.h
+++ b/include/asm-alpha/ptrace.h
@@ -75,10 +75,10 @@ struct switch_stack {
75#define profile_pc(regs) instruction_pointer(regs) 75#define profile_pc(regs) instruction_pointer(regs)
76extern void show_regs(struct pt_regs *); 76extern void show_regs(struct pt_regs *);
77 77
78#define alpha_task_regs(task) \ 78#define task_pt_regs(task) \
79 ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) 79 ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
80 80
81#define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0) 81#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0)
82 82
83#endif 83#endif
84 84