简单!!高分!!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这三个东东啊?
这个问题把我郁闷死了,求大家帮忙!不胜感激!!
...全文
相关推荐
Linux switch_to
switch_to 汇编宏是linux内核完成进程切换的核心代码
进程切换switch_to演示
对于switch_to的形象表述,直观反映进程切换的实现过程
linux下i2c switch -- pca9548
现有的关于 i2c switch 资料非常少。即使阅读完官方的datasheet.也不能写出完全正确的操作。 因为内核中的驱动本身不是那么完善的。还有一些资料是单片机编程的,可惜在linux上并不能成功执行.但是在现有的pca954x 驱动函数中,没有实现自动对内部控制寄存器进行相应配置,这样的话就需要额外的写一个附加的配置函数,实现这种功能
Ubuntu 18.04环境下Linux 0.11 内核编译及在bochs 2.6.9中的调试运行
Ubuntu 18.04环境下Linux 0.11 内核编译及在bochs 2.6.9中的调试运行
plugin_sched_switch.rar_The Switch
make sure the comm has a \0 at the end.


