Module: wine Branch: master Commit: e245df2a0c8d1270a4cc0129407072c917a0c325 URL: https://source.winehq.org/git/wine.git/?a=commit;h=e245df2a0c8d1270a4cc01294...
Author: Alexandre Julliard julliard@winehq.org Date: Sat Jul 6 12:56:13 2019 +0200
wineboot: Fix do_cpuid() calling convention.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47464 Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/wineboot/wineboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 834bf92..55f2c6c 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -185,13 +185,13 @@ static DWORD set_reg_value( HKEY hkey, const WCHAR *name, const WCHAR *value ) return RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)value, (lstrlenW(value) + 1) * sizeof(WCHAR) ); }
-extern void do_cpuid( unsigned int ax, unsigned int *p ); #if defined(_MSC_VER) -void do_cpuid( unsigned int ax, unsigned int *p ) +static void do_cpuid( unsigned int ax, unsigned int *p ) { __cpuid( p, ax ); } #elif defined(__i386__) +extern void __cdecl do_cpuid( unsigned int ax, unsigned int *p ); __ASM_GLOBAL_FUNC( do_cpuid, "pushl %esi\n\t" "pushl %ebx\n\t" @@ -206,18 +206,22 @@ __ASM_GLOBAL_FUNC( do_cpuid, "popl %esi\n\t" "ret" ) #elif defined(__x86_64__) +extern void __cdecl do_cpuid( unsigned int ax, unsigned int *p ); __ASM_GLOBAL_FUNC( do_cpuid, + "pushq %rsi\n\t" "pushq %rbx\n\t" - "movl %edi,%eax\n\t" + "movq %rcx,%rax\n\t" + "movq %rdx,%rsi\n\t" "cpuid\n\t" "movl %eax,(%rsi)\n\t" "movl %ebx,4(%rsi)\n\t" "movl %ecx,8(%rsi)\n\t" "movl %edx,12(%rsi)\n\t" "popq %rbx\n\t" + "popq %rsi\n\t" "ret" ) #else -void do_cpuid( unsigned int ax, unsigned int *p ) +static void do_cpuid( unsigned int ax, unsigned int *p ) { FIXME("\n"); }