|
Linux内核代码,switch_to中
跳转到Tss,也就是进行了任务切换,后面还有代码。不解中...
-
- #define switch_to(n) \
- {\
- struct {long a,b;} __tmp; \
- __asm(\
- "cmpl %%ecx,current\n"\
- "je 1f\n"\
- "movw %%dx,%1\n"\
- "ljmp %0\n"\
- "cmpl %%ecx,last_task_used_math\n"\
- "jne 1f\n"\
- "clts\n"\
- "1:"\
- ::"m"(*&__tmp.a),"m"(*&__tmp.b),"d"(_TSS(b)),"c"((long) task[n]));\
- }
复制代码
也就是相当于:
-
- movl n,%ebx
- movl task[%ebx],%ecx
- cmpl %ecx,current
- je 1f
- movw %dx,__tmp.b
- ljmp __tmp
- cmpl %ecx,last_task_used_math
- jne 1f
- clts
- 1:
复制代码 |
|