简单!!高分!!Linux0.01中的简单问题—关于switch_to(n)。
我在阅读Linux0.01代码时怎么也弄不懂这一段的用处:
/*
* switch_to(n) should switch tasks to task nr n, first
* checking that n isn't the current task, in which case it does nothing.
* This also clears the TS-flag if the task we switched to has used
* tha math co-processor latest.
*/
#define switch_to(n) {\
struct {long a,b;} __tmp; \
__asm__("cmpl %%ecx,_current\n\t" \
"je 1f\n\t" \
"xchgl %%ecx,_current\n\t" \
"movw %%dx,%1\n\t" \
"ljmp %0\n\t" \
"cmpl %%ecx,%2\n\t" \
"jne 1f\n\t" \
"clts\n" \
"1:" \
::"m" (*&__tmp.a),"m" (*&__tmp.b), \
"m" (last_task_used_math),"d" _TSS(n),"c" ((long) task[n])); \
}
AT&T汇编实在太难懂了,请问各位这一段做了什么啊?
明明输入参数有5个,为什么只能在代码中找到%0、%1、%2这三个东东啊?
这个问题把我郁闷死了,求大家帮忙!不胜感激!!