[질문] 현재 실행되는 Task의 선두 번지를 가져오는 방법에 대한 질문

calebrhee의 이미지

1 #ifndef _I386_CURRENT_H
2 #define _I386_CURRENT_H
3
4 struct task_struct;
5
6 static inline struct task_struct * get_current(void)
7 {
8 struct task_struct *current;
9 __asm__("andl %%esp,%0; ":"=r" (current) : "" (~8191UL)); <-- what is this ? pls, let me explain about this code ?
10 return current;
11 }
12
13 #define current get_current()
14
15 #endif /* !(_I386_CURRENT_H) */

__asm__("andl %%esp,%0; ":"=r" (current) : "" (~8191UL)); <-- what is this ? pls, let me explain about this code ?

제가 알고 싶은 것은 이 코드의 동작 원리가 무엇이냐는 것입니다.
즉, 어떻게 해서 현재실행되는 Task의 선두번지를 가져오느냐 하는 것입니다.

알려 주세요.