remove unused $Id tags
[reactos.git] / reactos / ntoskrnl / ke / i386 / stkswitch.S
1 /*
2 * FILE: ntoskrnl/ke/i386/tskswitch.S
3 * PURPOSE: Microkernel thread support
4 * PROGRAMMER: David Welch (welch@cwcom.net)
5 * UPDATE HISTORY:
6 * Created 09/10/00
7 */
8
9 /* INCLUDES ******************************************************************/
10 #include <ndk/asm.h>
11
12 /* FUNCTIONS ****************************************************************/
13
14 /*
15 * FUNCTION: KeStackSwitchAndRet
16 * PURPOSE: Switch to a new stack and return from the first frame on
17 * the new stack which was assumed to a stdcall function with
18 * 8 bytes of arguments and which saved edi, esi and ebx.
19 */
20 .globl _KeStackSwitchAndRet@4
21 _KeStackSwitchAndRet@4:
22 pushl %ebp
23 movl %esp, %ebp
24
25 cli
26
27 movl 8(%ebp), %esp
28
29 sti
30
31 popl %edi
32 popl %esi
33 popl %ebx
34
35 popl %ebp
36 ret $8
37
38 .globl _KePushAndStackSwitchAndSysRet@8
39 _KePushAndStackSwitchAndSysRet@8:
40 pushl %ebp
41 movl %esp, %ebp
42
43 pushl %ebx
44 pushl %esi
45 pushl %edi
46
47 cli
48
49 pushl 8(%ebp)
50
51 movl %fs:KPCR_CURRENT_THREAD, %ebx
52 movl %esp, KTHREAD_CALLBACK_STACK(%ebx)
53 movl 12(%ebp), %esp
54
55 sti
56
57 push $0
58 call _KeLowerIrql@4
59
60 jmp _KiServiceExit
61