Fastcall calling convention

Damjan Jovanovic damjan.jov at gmail.com
Tue Mar 23 03:59:56 CDT 2010


Hi

Wine doesn't seem to support the fastcall calling convention:

include/winternl.h:
/* These are implemented as __fastcall, so we can't let Winelib apps
link with them */

dlls/hal/hal.c:
#ifdef __i386__
#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
    __ASM_STDCALL_FUNC( name, 4, \
                       "popl %eax\n\t" \
                       "pushl %ecx\n\t" \
                       "pushl %eax\n\t" \
                       "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4))

GCC seems to support fastcall from version 3.4:
http://www.ohse.de/uwe/articles/gcc-attributes.html

Should we support it? Its absence makes kernel driver code a lot
uglier (eg. irp->Tail.Overlay.s.u2.CurrentStackLocation instead of
IoGetCurrentIrpStackLocation()). We also can't declare fastcall
functions in header files, so some functions that are actually
implemented are missing from header files and thus unusable from
inside Wine.

Thank you
Damjan Jovanovic



More information about the wine-devel mailing list