Message ID | CADUS3o=F4diU-xG8DsE6c+Zm6juQetJ0kmMtKNdz8pOXBRxq=A@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Oct 19, 2015 at 05:55:29PM +0800, yoma sophian wrote: > hi all: > I use linaro toolchain which libc is compile in thumb mode and if any > user mode program call sleep, the lr of its task_pt_regs will be 0, no > matter how many function level I called. It depends on the userspace code at the time that the system call is made. If it's setting LR to zero, then you'll read zero. I don't think it has anything to do with the toolchain either. Check the libc code around the site for the system call.
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 3ee4d06..3fff0fe 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1646,7 +1646,10 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, struct timespec __user *, rmtp) { struct timespec tu; - + struct pt_regs *regs; + regs = task_pt_regs(current); + printk(KERN_ERR"calling %s, current->pid = %d, current->common =%s regs->ARM_lr= 0x%lx\n", __func__, current->pid, current->comm,regs->ARM_lr) if (copy_from_user(&tu, rqtp, sizeof(tu)))