From 62fa748f234ae5c1cf8ea5a94958049efd4f8c9d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 15 May 2019 19:59:33 +0200 Subject: [PATCH] include: Define fastcall assembly wrappers globally. Signed-off-by: Alexandre Julliard --- 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 11a559180e2..f06264bea41 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -35,25 +35,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 ); diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 2e459b2d3ca..362fb7550f8 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 65e27293972..864a06001b3 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 bf97bc03f46..f1c50fd6ad6 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 */