From: Martin J. B. <mb...@ar...> - 2003-05-13 05:55:45
|
>> Wow, that's intuitive :) >> They're trying to access the variables that have been pushed onto the >> top of the stack. The thread_info field points to the bottom of the >> kernel's stack (no matter how big it is). I don't know where the -5 and >> -2 come from. It needs a big, fat stinking comment. > > I'm not 100% convinced it DTRT on modern kernels. I vaguely wonder if > the following would be more appropriate. Shame the typedef isn't there > yet; the _struct suffix is an eyesore. So are the new bits of the patch related to the KSTK_E* bit? They don't seem to be ... however, this bit looks really good: > -#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? Thanks, M. |