2001-04-10 17:48:17 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
#include <asm.inc>
|
|
|
|
#include <ks386.inc>
|
2004-03-13 18:21:57 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
.code
|
|
|
|
|
|
|
|
PUBLIC _KdbpStackSwitchAndCall@8
|
2005-03-05 23:35:08 +00:00
|
|
|
_KdbpStackSwitchAndCall@8:
|
2010-11-27 22:12:15 +00:00
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
2009-09-09 13:49:04 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
mov eax, [esp + 8] /* New stack */
|
|
|
|
mov ecx, [esp + 12] /* Function to call */
|
|
|
|
mov edx, esp /* Old stack */
|
2009-09-09 13:49:04 +00:00
|
|
|
|
|
|
|
/* Switch stack */
|
2010-11-27 22:12:15 +00:00
|
|
|
mov esp, eax
|
|
|
|
push edx
|
2009-09-09 13:49:04 +00:00
|
|
|
|
|
|
|
/* Call function */
|
2010-11-27 22:12:15 +00:00
|
|
|
call ecx
|
2009-09-09 13:49:04 +00:00
|
|
|
|
|
|
|
/* Switch back to old stack */
|
2010-11-27 22:12:15 +00:00
|
|
|
pop esp
|
2009-09-09 13:49:04 +00:00
|
|
|
|
|
|
|
/* Return */
|
2010-11-27 22:12:15 +00:00
|
|
|
pop ebp
|
|
|
|
ret 8
|
2001-04-10 17:48:17 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
END
|