/** * \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 %rax pushq %rbx pushq %rcx pushq %rdx pushq %rsi pushq %rdi pushq %rbp movq %rsp,(%rsi) /* *save_sp = rsp */ movq (%rdi),%rsp /* rsp = *new_sp */ popq %rbp popq %rdi popq %rsi popq %rdx popq %rcx popq %rbx popq %rax ret