*/
#define DCCR_MASK 0x0000001f /* XNZVC */
-/*
- * Get contents of register REGNO in task TASK.
- */
-inline long get_reg(struct task_struct *task, unsigned int regno)
-{
- /* USP is a special case, it's not in the pt_regs struct but
- * in the tasks thread struct
- */
-
- if (regno == PT_USP)
- return task->thread.usp;
- else if (regno < PT_MAX)
- return ((unsigned long *)user_regs(task->thread_info))[regno];
- else
- return 0;
-}
-
-/*
- * Write contents of register REGNO in task TASK.
- */
-inline int put_reg(struct task_struct *task, unsigned int regno,
- unsigned long data)
-{
- if (regno == PT_USP)
- task->thread.usp = data;
- else if (regno < PT_MAX)
- ((unsigned long *)user_regs(task->thread_info))[regno] = data;
- else
- return -1;
- return 0;
-}
+extern inline long get_reg(struct task_struct *, unsigned int);
+extern inline long put_reg(struct task_struct *, unsigned int, unsigned long);
/*
* Called by kernel/ptrace.c when detaching.
{
struct task_struct *child;
int ret;
- unsigned long __user *datap = (unsigned long __user *)data;
lock_kernel();
ret = -EPERM;
if (copied != sizeof(tmp))
break;
- ret = put_user(tmp,datap);
+ ret = put_user(tmp,(unsigned long *) data);
break;
}
break;
tmp = get_reg(child, addr >> 2);
- ret = put_user(tmp, datap);
+ ret = put_user(tmp, (unsigned long *)data);
break;
}
case PTRACE_KILL:
ret = 0;
- if (child->state == TASK_ZOMBIE)
+ if (child->exit_state == EXIT_ZOMBIE)
break;
child->exit_code = SIGKILL;
for (i = 0; i <= PT_MAX; i++) {
tmp = get_reg(child, i);
- if (put_user(tmp, datap)) {
+ if (put_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
goto out_tsk;
}
unsigned long tmp;
for (i = 0; i <= PT_MAX; i++) {
- if (get_user(tmp, datap)) {
+ if (get_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
goto out_tsk;
}