/** * \file * * * \version $Id$ * \author Bernie Innocenti * * \brief i386 context switch */ /* void asm_switch_context(void **new_sp [%rdi], void **save_sp [%rsi]) */ .globl asm_switch_context asm_switch_context: pushq %rbp pushq %rdi pushq %rsi pushq %rbx pushq %r8 pushq %r9 pushq %r10 pushq %r11 movq %rsp,(%rsi) /* *save_sp = rsp */ movq (%rdi),%rsp /* rsp = *new_sp */ popq %r11 popq %r10 popq %r9 popq %r8 popq %rbx popq %rsi popq %rdi popq %rbp ret