2012. 11. 5. 14:18
thread_info 이해 카테고리 없음2012. 11. 5. 14:18
static inline struct thread_info *current_thread_info(void) { 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_info 구조체를 찾는다.
스택은 높은주소에서 낮은주소로 자라므로, 위 그림같은 구조가 된다.