summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2005-04-11 17:04:49 +0000
committerwpaul <wpaul@FreeBSD.org>2005-04-11 17:04:49 +0000
commita5aab37b5d03f7dc00f097c0af46599660f14efb (patch)
tree811887d8cf69bf4c1e38d20cf29203e964c95ed8 /sys/compat
parent9917d4c3ed665b17ef69e1fa02f68e9183b76920 (diff)
downloadFreeBSD-src-a5aab37b5d03f7dc00f097c0af46599660f14efb.zip
FreeBSD-src-a5aab37b5d03f7dc00f097c0af46599660f14efb.tar.gz
In winx32_wrap.S, preserve return values in the fastcall and regparm
wrappers by pushing them onto the stack rather than keeping them in %esi and %edi.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/ndis/winx32_wrap.S22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/compat/ndis/winx32_wrap.S b/sys/compat/ndis/winx32_wrap.S
index 4014e88..4fadfb5 100644
--- a/sys/compat/ndis/winx32_wrap.S
+++ b/sys/compat/ndis/winx32_wrap.S
@@ -187,10 +187,12 @@ ENTRY(x86_fastcall_wrap)
x86_fastcall_wrap_call:
mov $0,%eax
call *%eax # branch to fastcall routine
+ push %eax # preserve return val
movl $ctxsw_utow, %eax
call *%eax # thunk
+ pop %eax # restore return val
add $12,%esp # clean the stack
x86_fastcall_wrap_arg:
ret $0xFF
@@ -212,11 +214,11 @@ ENTRY(x86_fastcall_call)
mov 12(%esp),%ecx
mov 16(%esp),%edx
call *8(%esp) # branch to fastcall routine
- mov %eax,%esi # preserve return val
+ push %eax # preserve return val
call ctxsw_wtou # unthunk
- mov %esi,%eax # restore return val
+ pop %eax # restore return val
add $4,%esp # clean the stack
ret
@@ -242,14 +244,14 @@ ENTRY(x86_regparm_wrap)
x86_regparm_wrap_call:
movl $0,%eax
call *%eax # jump to routine
- mov %eax,%esi # preserve return val
- mov %edx,%edi # preserve return val
+ push %eax # preserve return val
+ push %edx # preserve return val
movl $ctxsw_utow, %eax
call *%eax # thunk
- mov %esi,%eax # restore return val
- mov %edi,%edx # restore return val
+ pop %edx # restore return val
+ pop %eax # restore return val
add $12,%esp # restore stack
ret
x86_regparm_wrap_end:
@@ -268,13 +270,13 @@ ENTRY(x86_regparm_call)
mov 12(%esp),%edx
mov 16(%esp),%ecx
call *4(%esp) # branch to fastcall routine
- mov %eax,%esi # preserve return val
- mov %edx,%edi # preserve return val
+ push %eax # preserve return val
+ push %edx # preserve return val
call ctxsw_wtou # unthunk
- mov %esi,%eax # restore return val
- mov %edi,%edx # restore return val
+ pop %edx # restore return val
+ pop %eax # restore return val
ret
/*
OpenPOWER on IntegriCloud