Revised for new scheduler API.
authormarco <marco@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 20 Sep 2006 14:01:37 +0000 (14:01 +0000)
committermarco <marco@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 20 Sep 2006 14:01:37 +0000 (14:01 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@705 38d2e660-2303-0410-9eaa-f027e97ec537

kern/switch_i386.s

index d4f91d802b51a8cbc6b85ec22af717714844caf4..6931d45c9986636b931ebb4be1411338dda471e7 100755 (executable)
  * \author Bernardo Innocenti <bernie@develer.com>
  */
 
- *
- * $Log$
- * Revision 1.2  2004/06/06 16:14:12  bernie
- * Add DevLib license information.
- *
- * Revision 1.1  2004/05/23 17:27:00  bernie
- * Import kern/ subdirectory.
- *
- */
-
-!!!!!! THIS FILE HAS NOT BEEN REVISED FOR THE NEW SCHEDULER API !!!!!!
-
-/* I know it's ugly... */
-#.intel_syntax
-
-/* void AsmSwitchContext(void * new_sp, void ** save_sp) */
-.globl AsmSwitchContext
-AsmSwitchContext:
+/* void asm_switch_context(void ** new_sp, void ** save_sp) */
+.globl asm_switch_context
+asm_switch_context:
        pushl   %eax
        pushl   %ebx
        pushl   %ecx
@@ -38,9 +23,10 @@ AsmSwitchContext:
        pushl   %esi
        pushl   %edi
        pushl   %ebp
-       movl    0x24(%esp),%ebp         /* ebp = save_sp */
-       movl    %esp,(%ebp)                     /* *save_sp = esp */
-       movl    0x20(%esp),%esp         /* esp = new_sp */
+       movl    0x24(%esp),%ebp         /* ebp = save_sp */
+       movl    %esp,(%ebp)             /* *save_sp = esp */
+       movl    0x20(%esp),%ebp         /* ebp = new_sp */
+       movl    (%ebp),%esp             /* esp = *new_sp */
        popl    %ebp
        popl    %edi
        popl    %esi
@@ -50,16 +36,9 @@ AsmSwitchContext:
        popl    %eax
        ret
 
-/* void AsmReplaceContext(void * new_sp, void ** dummy) */
-.globl AsmReplaceContext
-AsmReplaceContext:
-       movl    4(%esp),%esp            /* esp = new_sp */
-       popl    %ebp
-       popl    %edi
-       popl    %esi
-       popl    %edx
-       popl    %ecx
-       popl    %ebx
-       popl    %eax
+/* int asm_switch_version(void) */
+.globl asm_switch_version
+asm_switch_version:
+       mov     $1,%eax
        ret