Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18077
b: refs/heads/master
c: 6c3559f
h: refs/heads/master
i:
  18075: 36a2a6b
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 12, 2006
1 parent 0ccb459 commit d63d8e9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 27 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: b7f6961d83d480c8636543d1d0dbb9584b878a68
refs/heads/master: 6c3559fc458e3ed171d7a8bf6a6d7eaea1e7b2e5
5 changes: 1 addition & 4 deletions trunk/arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
unsigned long unused, struct task_struct *tsk, struct pt_regs *regs)
{
struct pt_regs *childregs;
unsigned long sp = (unsigned long)tsk->thread_info + THREAD_SIZE;
struct pt_regs *childregs = task_pt_regs(tsk);
extern void ret_from_fork(void);

/* Copy registers */
sp -= sizeof (struct pt_regs);
childregs = (struct pt_regs *)sp;
*childregs = *regs;

childregs->spu = spu;
Expand Down
25 changes: 4 additions & 21 deletions trunk/arch/m32r/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@
#include <asm/processor.h>
#include <asm/mmu_context.h>

/*
* Get the address of the live pt_regs for the specified task.
* These are saved onto the top kernel stack when the process
* is not running.
*
* Note: if a user thread is execve'd from kernel space, the
* kernel stack will not be empty on entry to the kernel, so
* ptracing these tasks will fail.
*/
static inline struct pt_regs *
get_user_regs(struct task_struct *task)
{
return (struct pt_regs *)
((unsigned long)task->thread_info + THREAD_SIZE
- sizeof(struct pt_regs));
}

/*
* This routine will get a word off of the process kernel stack.
*/
Expand All @@ -59,7 +42,7 @@ get_stack_long(struct task_struct *task, int offset)
{
unsigned long *stack;

stack = (unsigned long *)get_user_regs(task);
stack = (unsigned long *)task_pt_regs(task);

return stack[offset];
}
Expand All @@ -72,7 +55,7 @@ put_stack_long(struct task_struct *task, int offset, unsigned long data)
{
unsigned long *stack;

stack = (unsigned long *)get_user_regs(task);
stack = (unsigned long *)task_pt_regs(task);
stack[offset] = data;

return 0;
Expand Down Expand Up @@ -208,7 +191,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
*/
static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
{
struct pt_regs *regs = get_user_regs(tsk);
struct pt_regs *regs = task_pt_regs(tsk);

return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
}
Expand All @@ -223,7 +206,7 @@ static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)

ret = -EFAULT;
if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
struct pt_regs *regs = get_user_regs(tsk);
struct pt_regs *regs = task_pt_regs(tsk);
*regs = newregs;
ret = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static void __init do_boot_cpu(int phys_id)
/* So we see what's up */
printk("Booting processor %d/%d\n", phys_id, cpu_id);
stack_start.spi = (void *)idle->thread.sp;
idle->thread_info->cpu = cpu_id;
task_thread_info(idle)->cpu = cpu_id;

/*
* Send Startup IPI
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/asm-m32r/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ extern void show_regs(struct pt_regs *);

extern void withdraw_debug_trap(struct pt_regs *regs);

#define task_pt_regs(task) \
((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)

#endif /* __KERNEL */

#endif /* _ASM_M32R_PTRACE_H */

0 comments on commit d63d8e9

Please sign in to comment.