__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 }
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
inline assembler로
inline assembler로 검색해 보시면 문법을 아실 수 있고요,
stack size 가 8K인 architecture에서 현재 thread 정보를 current 변수로 가져오는 것으로 보이네요.
아래 C 코드와 같은 역할이죠.
http://lxr.linux.no/source/include/asm-i386/thread_info.h
댓글 달기