Write comment for removed block.
[bertos.git] / kern / switch_win32.s
1 /*!
2  * \file
3  * <!--
4  * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5  * Copyright 1999,2000,2001 Bernardo Innocenti <bernie@develer.com>
6  * This file is part of DevLib - See devlib/README for information.
7  * -->
8  *
9  * \brief i386 context switch for WIN32
10  *
11  * \version $Id$
12  *
13  * \author Bernardo Innocenti <bernie@develer.com>
14  */
15
16 !!!!!! THIS FILE HAS NOT BEEN REVISED FOR THE NEW SCHEDULER API !!!!!!
17
18 __declspec(naked) void AsmSwitchContext(void * new_sp, void ** save_sp)
19 {
20         __asm
21         {
22                 push    eax
23                 push    ebx
24                 push    ecx
25                 push    edx
26                 push    esi
27                 push    edi
28                 push    ebp
29                 mov             ebp,dword ptr [esp+24h] ; ebp <- save_sp
30                 mov             dword ptr [ebp],esp             ; *save_sp = esp
31                 mov             esp,dword ptr [esp+20h] ; new_sp
32                 pop             ebp
33                 pop             edi
34                 pop             esi
35                 pop             edx
36                 pop             ecx
37                 pop             ebx
38                 pop             eax
39                 ret
40         }
41 }
42
43 __declspec(naked) void AsmReplaceContext(void * new_sp, void ** dummy)
44 {
45         __asm
46         {
47                 mov             esp,dword ptr [esp + 4] ; new_sp
48                 pop             ebp
49                 pop             edi
50                 pop             esi
51                 pop             edx
52                 pop             ecx
53                 pop             ebx
54                 pop             eax
55                 ret
56         }
57 }
58