__asm__("andl %%esp,%0; ":"=r" (current) : "" (~8191UL));
좀 알려 주세요.
inline assembler로 검색해 보시면 문법을 아실 수 있고요, stack size 가 8K인 architecture에서 현재 thread 정보를 current 변수로 가져오는 것으로 보이네요. 아래 C 코드와 같은 역할이죠.
http://lxr.linux.no/source/include/asm-i386/thread_info.h
90 /* how to get the thread information struct from C */ 91 static inline struct thread_info *current_thread_info(void) 92 { 93 return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1)); 94 }
inline assembler로
inline assembler로 검색해 보시면 문법을 아실 수 있고요,
stack size 가 8K인 architecture에서 현재 thread 정보를 current 변수로 가져오는 것으로 보이네요.
아래 C 코드와 같은 역할이죠.
http://lxr.linux.no/source/include/asm-i386/thread_info.h
90 /* how to get the thread information struct from C */ 91 static inline struct thread_info *current_thread_info(void) 92 { 93 return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1)); 94 }