lkml.org 
[lkml]   [2003]   [May]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 13 May 2003 08:42:23 +0200
FromAndi Kleen <>
SubjectRe: [Lse-tech] Re: 2.5.69-mjb1
> > -#define KSTK_EIP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
> > -#define KSTK_ESP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1022])
> > +#define KSTK_EIP(task)	((task)->thread.eip)
> > +#define KSTK_ESP(task)	((task)->thread.esp)
> 
> Can I assume it's tested, or does it need someone to do that?

It's broken. It will report the kernel values, not the user values like the previous
version and also get it wrong for the current task

(KSTK_* is really a misnomer, it should be USTK_*. WCHAN is handled by a different 
mechanism) 

Something like this should work (untested)

#define KSTK_PTREGS(tsk) \
	((struct pt_regs *)((unsigned long)((tsk)->thread_info) + THREAD_SIZE) - 1)
#define KSTK_EIP(tsk) (KSTK_PTREGS(tsk)->eip)
#define KSTK_ESP(tsk) (KSTK_PTREGS(tsk)->esp)

-Andi
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:35    [from the cache]
©2003-2008