/* how to get the thread information struct from C */ staticinlinestruct thread_info *current_thread_info(void)
{ return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));
}
上头 current_stack_pointer 就是堆栈指针 ESP,它是这样定义的:
/* how to get the current stack pointer from C */ registerunsignedlong current_stack_pointer asm("esp") __attribute_used__;