From 2da74632feb5001487488a037996ca6bba982fe7 Mon Sep 17 00:00:00 2001 From: Kevin Tew Date: Fri, 22 Oct 2010 21:21:38 -0600 Subject: [PATCH] cpuid assembly fix Merge to 5.0.2 (cherry picked from commit c1f2dea1ed9206617b0be9d157c282b638f917ad) --- src/racket/src/future.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/racket/src/future.c b/src/racket/src/future.c index 12900981b5..0b069eb862 100644 --- a/src/racket/src/future.c +++ b/src/racket/src/future.c @@ -546,14 +546,24 @@ void scheme_future_block_until_gc() } # else { +# if defined(i386) || defined(__i386__) +# define MZ_PUSH_EBX "pushl %%ebx" +# define MZ_POP_EBX "popl %%ebx" +# endif +# if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) +# define MZ_PUSH_EBX "pushq %%rbx" +# define MZ_POP_EBX "popq %%rbx" +# endif int _eax, _ebx, _ecx, _edx, op = 0; /* we can't always use EBX, so save and restore it: */ - asm ("pushl %%ebx \n\t" + asm (MZ_PUSH_EBX "\n\t" "cpuid \n\t" "movl %%ebx, %1 \n\t" - "popl %%ebx" + MZ_POP_EBX : "=a" (_eax), "=r" (_ebx), "=c" (_ecx), "=d" (_edx) : "a" (op)); } +# undef MZ_PUSH_EBX +# undef MZ_POP_EBX # endif #endif }