3 * Copyright (C) 2000 David Welch <welch@cwcom.net>
5 * Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * FILE: ntoskrnl/ke/i386/vm86_sup.S
23 * PURPOSE: V86 mode support
24 * PROGRAMMER: David Welch (welch@cwcom.net)
29 /* INCLUDES ******************************************************************/
33 #include <ddk/ntddk.h>
34 #include <ddk/status.h>
35 #include <internal/i386/segment.h>
36 #include <internal/i386/fpu.h>
37 #include <internal/ps.h>
38 #include <ddk/defines.h>
39 #include <internal/v86m.h>
41 //#include <ntos/service.h>
42 #include <internal/trap.h>
43 #include <internal/ps.h>
46 #include <internal/ntoskrnl.h>
47 #include <internal/i386/segment.h>
50 void KeReturnFromSystemCall();
53 * FUNCTION: KeStackSwitchAndRet
54 * PURPOSE: Switch to a new stack and return from the first frame on
55 * the new stack which was assumed to a stdcall function with
56 * 8 bytes of arguments and which saved edi, esi and ebx.
60 KeStackSwitchAndRet(PVOID NewStack
)
84 KePushAndStackSwitchAndSysRet(ULONG Push
, PVOID NewStack
)
99 mov ebx
, fs
:KPCR_CURRENT_THREAD
100 mov KTHREAD_CALLBACK_STACK
[ebx
], esp
108 jmp KeReturnFromSystemCall