Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v4: fix build failure
dlls/dbghelp/minidump.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 975bb45c9a..ad40c79bcf 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include "config.h" #include <time.h>
#define NONAMELESSUNION @@ -542,20 +543,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 %esi\n\t" + "pushl %ebx\n\t" + "movl 12(%esp),%eax\n\t" + "movl 16(%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 %esi\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 ad40c79bcf..0671adaa37 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -565,28 +565,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