[lkml]   [2005]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[Question] How get instruction pointer of user space ???
Hi everyone:

I am implemnting one ioctl() in one character device.

That need know instruction pointer of user space. I am on i386
I can sure I am in process context. and enter kernel by system call way.

As I known, in default case, each task have one kernel stack, its length
is THREAD_SIZE(2 pages), and current_thread_info() is at its top. the
struct pt_regs is at bottom of this stack.

so I write the code like here:

pt_regs = ((struct pt_regs *)(THREAD_SIZE + current_thread_info()))+1;
return pt_regs->eip;

but it do not work! even, I get segment fault and kernel Oops at

Also, I am sure current_thread_info() return right value of current
user task.

Any idea on here?



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-31 12:02    [W:0.041 / U:0.068 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site