Module: wine Branch: master Commit: 62fa748f234ae5c1cf8ea5a94958049efd4f8c9d URL: https://source.winehq.org/git/wine.git/?a=commit;h=62fa748f234ae5c1cf8ea5a94...
Author: Alexandre Julliard julliard@winehq.org Date: Wed May 15 19:59:33 2019 +0200
include: Define fastcall assembly wrappers globally.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/hal/hal.c | 19 ------------------- dlls/ntdll/rtl.c | 12 ------------ dlls/ntoskrnl.exe/ntoskrnl_private.h | 20 -------------------- include/wine/asm.h | 25 +++++++++++++++++++++++++ 4 files changed, 25 insertions(+), 51 deletions(-)
diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 11a5591..f06264b 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -36,25 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
#ifdef __i386__ -#define DEFINE_FASTCALL1_WRAPPER(func) \ - __ASM_STDCALL_FUNC( __fastcall_ ## func, 4, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(4) ) -#define DEFINE_FASTCALL_WRAPPER(func,args) \ - __ASM_STDCALL_FUNC( __fastcall_ ## func, args, \ - "popl %eax\n\t" \ - "pushl %edx\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) -#else -#define DEFINE_FASTCALL1_WRAPPER(func) /* nothing */ -#define DEFINE_FASTCALL_WRAPPER(func,args) /* nothing */ -#endif - -#ifdef __i386__
extern void * WINAPI call_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( call_fastcall_func1, 8, diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 2e459b2..362fb75 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -50,18 +50,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
-#ifdef __i386__ -#define DEFINE_FASTCALL_WRAPPER(func,args) \ - __ASM_STDCALL_FUNC( __fastcall_ ## func, args, \ - "popl %eax\n\t" \ - "pushl %edx\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) -#else -#define DEFINE_FASTCALL_WRAPPER(func,args) /* nothing */ -#endif - /* CRC polynomial 0xedb88320 */ static const DWORD CRC_table[256] = { diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h index 65e2729..864a060 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl_private.h +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -60,24 +60,4 @@ extern POBJECT_TYPE PsProcessType; extern POBJECT_TYPE PsThreadType; extern POBJECT_TYPE SeTokenObjectType;
- -#ifdef __i386__ -#define DEFINE_FASTCALL1_WRAPPER(func) \ - __ASM_STDCALL_FUNC( __fastcall_ ## func, 4, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(4) ) -#define DEFINE_FASTCALL_WRAPPER(func,args) \ - __ASM_STDCALL_FUNC( __fastcall_ ## func, args, \ - "popl %eax\n\t" \ - "pushl %edx\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) -#else -#define DEFINE_FASTCALL1_WRAPPER(func) /* nothing */ -#define DEFINE_FASTCALL_WRAPPER(func,args) /* nothing */ -#endif - #endif diff --git a/include/wine/asm.h b/include/wine/asm.h index bf97bc0..f1c50fd 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -63,4 +63,29 @@
#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name) __ASM_STDCALL(args),code)
+/* fastcall support */ + +#ifdef __i386__ + +# define DEFINE_FASTCALL1_WRAPPER(func) \ + __ASM_STDCALL_FUNC( __fastcall_ ## func, 4, \ + "popl %eax\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME(#func) __ASM_STDCALL(4) ) +# define DEFINE_FASTCALL_WRAPPER(func,args) \ + __ASM_STDCALL_FUNC( __fastcall_ ## func, args, \ + "popl %eax\n\t" \ + "pushl %edx\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) + +#else /* __i386__ */ + +# define DEFINE_FASTCALL1_WRAPPER(func) /* nothing */ +# define DEFINE_FASTCALL_WRAPPER(func,args) /* nothing */ + +#endif /* __i386__ */ + #endif /* __WINE_WINE_ASM_H */