Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/dbghelp/minidump.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 975bb45c9a..6829a700ac 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -542,20 +542,27 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf) return sz; }
-/* Calls cpuid with an eax of 'ax' and returns the 16 bytes in *p - * We are compiled with -fPIC, so we can't clobber ebx. - */ -static inline void do_x86cpuid(unsigned int ax, unsigned int *p) +extern void do_x86cpuid(unsigned int ax, unsigned int *p); + +#ifdef __i386__ +__ASM_GLOBAL_FUNC( do_x86cpuid, + "pushl %edi\n\t" + "pushl %ebx\n\t" + "movl 4(%esp),%eax\n\t" + "movl 8(%esp),%esi\n\t" + "cpuid\n\t" + "movl %eax,(%esi)\n\t" + "movl %ebx,4(%esi)\n\t" + "movl %ecx,8(%esi)\n\t" + "movl %edx,12(%esi)\n\t" + "popl %ebx\n\t" + "popl %edi\n\t" + "ret" ); +#else +void do_x86cpuid(unsigned int ax, unsigned int *p) { -#if defined(__GNUC__) && defined(__i386__) - __asm__("pushl %%ebx\n\t" - "cpuid\n\t" - "movl %%ebx, %%esi\n\t" - "popl %%ebx" - : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); -#endif } +#endif
/* From xf86info havecpuid.c 1.11 */ static inline int have_x86cpuid(void)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/dbghelp/minidump.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 6829a700ac..c2aef286a9 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -564,28 +564,27 @@ void do_x86cpuid(unsigned int ax, unsigned int *p) } #endif
-/* From xf86info havecpuid.c 1.11 */ -static inline int have_x86cpuid(void) -{ -#if defined(__GNUC__) && defined(__i386__) - unsigned int f1, f2; - __asm__("pushfl\n\t" - "pushfl\n\t" - "popl %0\n\t" - "movl %0,%1\n\t" - "xorl %2,%0\n\t" - "pushl %0\n\t" - "popfl\n\t" - "pushfl\n\t" - "popl %0\n\t" - "popfl" - : "=&r" (f1), "=&r" (f2) - : "ir" (0x00200000)); - return ((f1^f2) & 0x00200000) != 0; +extern int have_x86cpuid(void); + +#ifdef __i386__ +__ASM_GLOBAL_FUNC( have_x86cpuid, + "pushfl\n\t" + "pushfl\n\t" + "movl (%esp),%ecx\n\t" + "xorl $0x00200000,(%esp)\n\t" + "popfl\n\t" + "pushfl\n\t" + "popl %eax\n\t" + "popfl\n\t" + "xorl %ecx,%eax\n\t" + "andl $0x00200000,%eax\n\t" + "ret" ); #else +int have_x86cpuid(void) +{ return 0; -#endif } +#endif
/****************************************************************** * dump_system_info
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44985
Your paranoid android.
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8635: recipe for target 'dlls/dbghelp' failed Task: The win32 build failed
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8831: recipe for target 'dlls/dbghelp' failed Task: The wow32 build failed
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/nt.c | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 5c711ef25b..0972c14a83 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -944,27 +944,39 @@ static SYSTEM_CPU_INFORMATION cached_sci; #define INEI 0x49656e69 /* "ineI" */ #define NTEL 0x6c65746e /* "ntel" */
-/* Calls cpuid with an eax of 'ax' and returns the 16 bytes in *p - * We are compiled with -fPIC, so we can't clobber ebx. - */ -static inline void do_cpuid(unsigned int ax, unsigned int *p) -{ +extern void do_cpuid(unsigned int ax, unsigned int *p); + #ifdef __i386__ - __asm__("pushl %%ebx\n\t" - "cpuid\n\t" - "movl %%ebx, %%esi\n\t" - "popl %%ebx" - : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); +__ASM_GLOBAL_FUNC( do_cpuid, + "pushl %edi\n\t" + "pushl %ebx\n\t" + "movl 4(%esp),%eax\n\t" + "movl 8(%esp),%esi\n\t" + "cpuid\n\t" + "movl %eax,(%esi)\n\t" + "movl %ebx,4(%esi)\n\t" + "movl %ecx,8(%esi)\n\t" + "movl %edx,12(%esi)\n\t" + "popl %ebx\n\t" + "popl %edi\n\t" + "ret" ); #elif defined(__x86_64__) - __asm__("push %%rbx\n\t" - "cpuid\n\t" - "movq %%rbx, %%rsi\n\t" - "pop %%rbx" - : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); -#endif +__ASM_GLOBAL_FUNC( do_cpuid, + "pushq %rbx\n\t" + "movl %edi,%eax\n\t" + "movl 4(%esp),%eax\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" + "ret" ); +#else +void do_cpuid(unsigned int ax, unsigned int *p) +{ } +#endif
/* From xf86info havecpuid.c 1.11 */ static inline BOOL have_cpuid(void)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44989
Your paranoid android.
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8635: recipe for target 'dlls/dbghelp' failed Task: The win32 build failed
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8831: recipe for target 'dlls/dbghelp' failed Task: The wow32 build failed
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/nt.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 0972c14a83..5459d34e78 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -978,30 +978,32 @@ void do_cpuid(unsigned int ax, unsigned int *p) } #endif
-/* From xf86info havecpuid.c 1.11 */ -static inline BOOL have_cpuid(void) -{ +extern int have_cpuid(void); + #ifdef __i386__ - unsigned int f1, f2; - __asm__("pushfl\n\t" - "pushfl\n\t" - "popl %0\n\t" - "movl %0,%1\n\t" - "xorl %2,%0\n\t" - "pushl %0\n\t" - "popfl\n\t" - "pushfl\n\t" - "popl %0\n\t" - "popfl" - : "=&r" (f1), "=&r" (f2) - : "ir" (0x00200000)); - return ((f1^f2) & 0x00200000) != 0; +__ASM_GLOBAL_FUNC( have_cpuid, + "pushfl\n\t" + "pushfl\n\t" + "movl (%esp),%ecx\n\t" + "xorl $0x00200000,(%esp)\n\t" + "popfl\n\t" + "pushfl\n\t" + "popl %eax\n\t" + "popfl\n\t" + "xorl %ecx,%eax\n\t" + "andl $0x00200000,%eax\n\t" + "ret" ); #elif defined(__x86_64__) - return TRUE; +int have_cpuid(void) +{ + return 1; +} #else - return FALSE; -#endif +int have_cpuid(void) +{ + return 0; } +#endif
/* Detect if a SSE2 processor is capable of Denormals Are Zero (DAZ) mode. *
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44990
Your paranoid android.
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8635: recipe for target 'dlls/dbghelp' failed Task: The win32 build failed
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant ../../../wine/dlls/dbghelp/minidump.c:571:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8831: recipe for target 'dlls/dbghelp' failed Task: The wow32 build failed
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44984
Your paranoid android.
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8635: recipe for target 'dlls/dbghelp' failed Task: The win32 build failed
=== debian9 (build log) ===
../../../wine/dlls/dbghelp/minidump.c:549:20: error: expected ‘)’ before string constant Makefile:642: recipe for target 'minidump.o' failed Makefile:8831: recipe for target 'dlls/dbghelp' failed Task: The wow32 build failed
November 25, 2018 10:13 PM, "Zebediah Figura" z.figura12@gmail.com wrote:
@@ -542,20 +542,27 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf)
[...]
+#ifdef __i386__ +__ASM_GLOBAL_FUNC( do_x86cpuid,
"pushl %edi\n\t"
"pushl %ebx\n\t"
"movl 4(%esp),%eax\n\t"
"movl 8(%esp),%esi\n\t"
"cpuid\n\t"
"movl %eax,(%esi)\n\t"
"movl %ebx,4(%esi)\n\t"
"movl %ecx,8(%esi)\n\t"
"movl %edx,12(%esi)\n\t"
"popl %ebx\n\t"
"popl %edi\n\t"
"ret" );
You save EDI here, but then clobber ESI.
Chip
On 11/25/2018 10:28 PM, Chip Davis wrote:
November 25, 2018 10:13 PM, "Zebediah Figura" z.figura12@gmail.com wrote:
@@ -542,20 +542,27 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf)
[...]
+#ifdef __i386__ +__ASM_GLOBAL_FUNC( do_x86cpuid,
"pushl %edi\n\t"
"pushl %ebx\n\t"
"movl 4(%esp),%eax\n\t"
"movl 8(%esp),%esi\n\t"
"cpuid\n\t"
"movl %eax,(%esi)\n\t"
"movl %ebx,4(%esi)\n\t"
"movl %ecx,8(%esi)\n\t"
"movl %edx,12(%esi)\n\t"
"popl %ebx\n\t"
"popl %edi\n\t"
"ret" );
You save EDI here, but then clobber ESI.
Chip
Ack, thanks for the catch, will fix.