From: Martin J. B. <mb...@ar...> - 2003-05-12 16:06:37
|
--On Monday, May 12, 2003 08:34:13 -0700 Dave Hansen <hav...@us...> wrote: > Martin J. Bligh wrote: >> OK, so maybe I'm still asleep, but I don't see why the hardcoded >> magic constant (grrr) is 4096 in mainline, when the stacksize is 8K. >> Presumably the 1019*4 makes up the rest of it? Maybe the real question >> is what the hell was whoever wrote that in the first place smoking ? ;-) >> Why on earth would you skip halfway through the stack with one stupid >> magic constant, and then the rest of the way with another? > > You can go ask the author: > > http://linus.bkbits.net:8080/linux-2.5/diffs/include/asm-i386/processor.h@1.12?nav=index.html|src/|src/include|src/include/asm-i386|hist/include/asm-i386/processor.h -#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019]) -#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1022]) ... +#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]) Nope, not his fault, really. M. |