X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fasm-i386%2Fthread_info.h;h=ff1e2b1a7c849cbac9a93efffe82eae27a7c9626;hb=c723e084606ca1c81e91b80b2c0c44bde7bbc4df;hp=fdbc7f422ea5501ec586eabed02b349072e0184b;hpb=4b89aff930d632be10d557d08d1b60dee7163dbe;p=powerpc.git diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index fdbc7f422e..ff1e2b1a7c 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -83,17 +83,15 @@ struct thread_info { #define init_stack (init_thread_union.stack) +/* how to get the current stack pointer from C */ +register unsigned long current_stack_pointer asm("esp") __attribute_used__; + /* how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) { - struct thread_info *ti; - __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1))); - return ti; + return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1)); } -/* how to get the current stack pointer from C */ -register unsigned long current_stack_pointer asm("esp") __attribute_used__; - /* thread information allocation */ #ifdef CONFIG_DEBUG_STACK_USAGE #define alloc_thread_info(tsk) \