···5555#endif56565757/*5858- * Get the address of the live pt_regs for the specified task.5959- * These are saved onto the top kernel stack when the process6060- * is not running.6161- *6262- * Note: if a user thread is execve'd from kernel space, the6363- * kernel stack will not be empty on entry to the kernel, so6464- * ptracing these tasks will fail.6565- */6666-static inline struct pt_regs *6767-get_user_regs(struct task_struct *task)6868-{6969- return (struct pt_regs *)7070- ((unsigned long)task->thread_info + THREAD_SIZE -7171- 8 - sizeof(struct pt_regs));7272-}7373-7474-/*7558 * this routine will get a word off of the processes privileged stack.7659 * the offset is how far from the base addr as stored in the THREAD.7760 * this routine assumes that all the privileged stacks are in our···6279 */6380static inline long get_user_reg(struct task_struct *task, int offset)6481{6565- return get_user_regs(task)->uregs[offset];8282+ return task_pt_regs(task)->uregs[offset];6683}67846885/*···7491static inline int7592put_user_reg(struct task_struct *task, int offset, long data)7693{7777- struct pt_regs newregs, *regs = get_user_regs(task);9494+ struct pt_regs newregs, *regs = task_pt_regs(task);7895 int ret = -EINVAL;79968097 newregs = *regs;···404421 u32 insn;405422 int res;406423407407- regs = get_user_regs(child);424424+ regs = task_pt_regs(child);408425 pc = instruction_pointer(regs);409426410427 if (thumb_mode(regs)) {···555572 */556573static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)557574{558558- struct pt_regs *regs = get_user_regs(tsk);575575+ struct pt_regs *regs = task_pt_regs(tsk);559576560577 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;561578}···570587571588 ret = -EFAULT;572589 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {573573- struct pt_regs *regs = get_user_regs(tsk);590590+ struct pt_regs *regs = task_pt_regs(tsk);574591575592 ret = -EINVAL;576593 if (valid_user_regs(&newregs)) {