···4040#define BREAKINST_ARM 0xef9f000141414242/*4343- * Get the address of the live pt_regs for the specified task.4444- * These are saved onto the top kernel stack when the process4545- * is not running.4646- *4747- * Note: if a user thread is execve'd from kernel space, the4848- * kernel stack will not be empty on entry to the kernel, so4949- * ptracing these tasks will fail.5050- */5151-static inline struct pt_regs *5252-get_user_regs(struct task_struct *task)5353-{5454- return __get_user_regs(task->thread_info);5555-}5656-5757-/*5843 * this routine will get a word off of the processes privileged stack.5944 * the offset is how far from the base addr as stored in the THREAD.6045 * this routine assumes that all the privileged stacks are in our···4762 */4863static inline long get_user_reg(struct task_struct *task, int offset)4964{5050- return get_user_regs(task)->uregs[offset];6565+ return task_pt_regs(task)->uregs[offset];5166}52675368/*···5974static inline int6075put_user_reg(struct task_struct *task, int offset, long data)6176{6262- struct pt_regs newregs, *regs = get_user_regs(task);7777+ struct pt_regs newregs, *regs = task_pt_regs(task);6378 int ret = -EINVAL;64796580 newregs = *regs;···362377 u32 insn;363378 int res;364379365365- regs = get_user_regs(child);380380+ regs = task_pt_regs(child);366381 pc = instruction_pointer(regs);367382368383 res = read_instr(child, pc, &insn);···485500 */486501static int ptrace_getregs(struct task_struct *tsk, void *uregs)487502{488488- struct pt_regs *regs = get_user_regs(tsk);503503+ struct pt_regs *regs = task_pt_regs(tsk);489504490505 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;491506}···500515501516 ret = -EFAULT;502517 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {503503- struct pt_regs *regs = get_user_regs(tsk);518518+ struct pt_regs *regs = task_pt_regs(tsk);504519505520 ret = -EINVAL;506521 if (valid_user_regs(&newregs)) {
+1-1
include/asm-arm26/thread_info.h
···82828383/* FIXME - PAGE_SIZE < 32K */8484#define THREAD_SIZE (8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*327688585-#define __get_user_regs(x) (((struct pt_regs *)((unsigned long)(x) + THREAD_SIZE - 8)) - 1)8585+#define task_pt_regs(task) ((struct pt_regs *)((unsigned long)(task)->thread_info + THREAD_SIZE - 8) - 1)86868787extern struct thread_info *alloc_thread_info(struct task_struct *task);8888extern void free_thread_info(struct thread_info *);