[Question] How get instruction pointer of user space ???
liyu_at_WAN
Date: 08/31/05
- Previous message: Daniel Drake: "Re: Very strange Marvell/Yukon Gigabit NIC networking problems"
- Next in thread: Gaurav Dhiman: "Re: [Question] How get instruction pointer of user space ???"
- Reply: Gaurav Dhiman: "Re: [Question] How get instruction pointer of user space ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Aug 2005 17:59:36 +0800 To: LKML <linux-kernel@vger.kernel.org>
Hi everyone:
I am implemnting one ioctl() in one character device.
That need know instruction pointer of user space. I am on i386
platform.
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
sometime.
Also, I am sure current_thread_info() return right value of current
user task.
Any idea on here?
thanks
sailor.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Daniel Drake: "Re: Very strange Marvell/Yukon Gigabit NIC networking problems"
- Next in thread: Gaurav Dhiman: "Re: [Question] How get instruction pointer of user space ???"
- Reply: Gaurav Dhiman: "Re: [Question] How get instruction pointer of user space ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
... Copy the util-linux sources. ... > between known kernel versions.
... Here the struct has not changed, but the names for the types have changed. ...
send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Problems with close() system call
... I compiled a sample device driver ... and tried to insmod the binary into kernel
version 'Y' which had ... initialize struct members. ... send the line "unsubscribe
linux-kernel" in ... (Linux-Kernel) - [2.6 patch] pm3fb: remove kernel 2.2 code
... This patch removes kernel 2.2 code from pm3fb.. ... /* the struct
that hold them together */ ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - [PATCH][2.6.11-mm4] perfctr cleanups 2/3: ppc32
... PERFCTR_CPU_VERSION unused in the kernel, ... struct perfctr_cpu_control_header
{ ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Should struct inode be made available to userspace?
... > kernel specific) of struct inode. ... struct inode and structures
containing it should not be used outside of kernel. ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel)