···6767 return (*((unsigned long *)stack));6868}69697070-static inline struct pt_regs *get_child_regs(struct task_struct *task)7171-{7272- struct pt_regs *regs = (void *)task->thread.rsp0;7373- return regs - 1;7474-}7575-7670/*7771 * this routine will put a word on the processes privileged stack. 7872 * the offset is how far from the base addr as stored in the TSS. ···164170165171static void set_singlestep(struct task_struct *child)166172{167167- struct pt_regs *regs = get_child_regs(child);173173+ struct pt_regs *regs = task_pt_regs(child);168174169175 /*170176 * Always set TIF_SINGLESTEP - this guarantees that···202208203209 /* But touch TF only if it was set by us.. */204210 if (child->ptrace & PT_DTRACE) {205205- struct pt_regs *regs = get_child_regs(child);211211+ struct pt_regs *regs = task_pt_regs(child);206212 regs->eflags &= ~TRAP_FLAG;207213 child->ptrace &= ~PT_DTRACE;208214 }
+1-1
arch/x86_64/kernel/traps.c
···666666 ;667667 /* Exception from user space */668668 else if (user_mode(eregs))669669- regs = ((struct pt_regs *)current->thread.rsp0) - 1;669669+ regs = task_pt_regs(current);670670 /* Exception from kernel and interrupts are enabled. Move to671671 kernel process stack. */672672 else if (eregs->eflags & X86_EFLAGS_IF)