Merge branch "preempt" in "trunk".
[bertos.git] / bertos / emul / switch_x86_64.s
index 61859834cb95f50dfa41aa219fa6c2c5b584544f..de0f8f65ad4315cb77974ddf67718233fed2c8de 100644 (file)
@@ -26,9 +26,8 @@
  * invalidate any other reasons why the executable file might be covered by
  * the GNU General Public License.
  *
- * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2004, 2008 Develer S.r.l. (http://www.develer.com/)
  * Copyright 1999, 2000, 2001 Bernie Innocenti <bernie@codewiz.org>
- * This file is part of DevLib - See devlib/README for information.
  * -->
  *
  * \version $Id$
  * \brief i386 context switch
  */
 
-/* I know it's ugly... */
-/* .intel_syntax */
-
-/* void AsmSwitchContext(void **new_sp, void **save_sp) */
-/*                       %rdi           %rsi            */
+/* 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
+       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    %rbp
-       popq    %rdi
-       popq    %rsi
-       popq    %rdx
-       popq    %rcx
+       popq    %r11
+       popq    %r10
+       popq    %r9
+       popq    %r8
        popq    %rbx
-       popq    %rax
-       ret
-
-/* int asm_switch_version(void) */
-.globl asm_switch_version
-asm_switch_version:
-       mov     $1,%rax
+       popq    %rsi
+       popq    %rdi
+       popq    %rbp
        ret
-