xv6上下文切换代码

来源:互联网 发布:酒店水牌通过网络发送 编辑:程序博客网 时间:2024/05/29 02:29
# Context switch##   void swtch(struct context **old, struct context *new);# # Save current register context in old# and then load register context from new..globl swtchswtch:  movl 4(%esp), %eax  movl 8(%esp), %edx  # Save old callee-save registers  pushl %ebp  pushl %ebx  pushl %esi  pushl %edi  # Switch stacks  movl %esp, (%eax)  movl %edx, %esp  # Load new callee-save registers  popl %edi  popl %esi  popl %ebx  popl %ebp  ret

原创粉丝点击