在/arch/x86/include/asm/thread_info.h中,
可以找到current_thread_info(void)的定义:
from C code:
/* how to get the current stack pointer from C */
register unsigned long current_stack_pointer asm("esp") __used;
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
return (struct thread_info *) (current_stack_pointer & ~(THREAD_SIZE - 1));
}
register unsigned long current_stack_pointer asm("esp") __used;
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
return (struct thread_info *) (current_stack_pointer & ~(THREAD_SIZE - 1));
}
from ASM code:
/* how to get the thread information struct from ASM */
#define GET_THREAD_INFO(reg) \
#define GET_THREAD_INFO(reg) \