[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>

authored by akpm@osdl.org and committed by Linus Torvalds e52f4ca2 27f45130

+12 -29
+2 -17
arch/alpha/kernel/process.c
··· 428 428 int 429 429 dump_elf_task(elf_greg_t *dest, struct task_struct *task) 430 430 { 431 - struct thread_info *ti; 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 - 431 + dump_elf_thread(dest, task_pt_regs(task), task_thread_info(task)); 439 432 return 1; 440 433 } 441 434 442 435 int 443 436 dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task) 444 437 { 445 - struct thread_info *ti; 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 - 438 + struct switch_stack *sw = (struct switch_stack *)task_pt_regs(task) - 1; 453 439 memcpy(dest, sw->fp, 32 * 8); 454 - 455 440 return 1; 456 441 } 457 442
+7
arch/alpha/kernel/ptrace.c
··· 72 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 + 75 82 static int regoff[] = { 76 83 PT_REG( r0), PT_REG( r1), PT_REG( r2), PT_REG( r3), 77 84 PT_REG( r4), PT_REG( r5), PT_REG( r6), PT_REG( r7),
+1 -10
include/asm-alpha/processor.h
··· 52 52 53 53 unsigned long get_wchan(struct task_struct *p); 54 54 55 - /* See arch/alpha/kernel/ptrace.c for details. */ 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))) 55 + #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 65 56 66 57 #define KSTK_ESP(tsk) \ 67 58 ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
+2 -2
include/asm-alpha/ptrace.h
··· 75 75 #define profile_pc(regs) instruction_pointer(regs) 76 76 extern void show_regs(struct pt_regs *); 77 77 78 - #define alpha_task_regs(task) \ 78 + #define task_pt_regs(task) \ 79 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 83 #endif 84 84