Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18056
b: refs/heads/master
c: e52f4ca
h: refs/heads/master
v: v3
  • Loading branch information
akpm@osdl.org authored and Linus Torvalds committed Jan 12, 2006
1 parent 439bff9 commit 9d07678
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27f451304aa6f2bccf34ef3c2b049c01d05d6fff
refs/heads/master: e52f4ca2a7cfea3495cabae23d48f1538f09ccf2
19 changes: 2 additions & 17 deletions trunk/arch/alpha/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/alpha/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
11 changes: 1 addition & 10 deletions trunk/include/asm-alpha/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);

unsigned long get_wchan(struct task_struct *p);

/* See arch/alpha/kernel/ptrace.c for details. */
#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))

#define KSTK_EIP(tsk) \
(*(unsigned long *)(PT_REG(pc) + (unsigned long) ((tsk)->thread_info)))
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)

#define KSTK_ESP(tsk) \
((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-alpha/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ struct switch_stack {
#define profile_pc(regs) instruction_pointer(regs)
extern void show_regs(struct pt_regs *);

#define alpha_task_regs(task) \
#define task_pt_regs(task) \
((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)

#define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0)
#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0)

#endif

Expand Down

0 comments on commit 9d07678

Please sign in to comment.