diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-05-06 17:33:19 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-05-06 17:33:19 (GMT) |
commit | cfc88759ab9d2a7118cb286943fc3074b430804b (patch) | |
tree | 02e14967bdeaf76e67719c5ee06443dc36b3ffa3 /unix/tclUnixCompat.c | |
parent | 21ffddf58f04c4a455f133435b83bc79da913805 (diff) | |
parent | 14452102b5028ba9b20ceae48237a751f97f3b43 (diff) | |
download | tcl-cfc88759ab9d2a7118cb286943fc3074b430804b.zip tcl-cfc88759ab9d2a7118cb286943fc3074b430804b.tar.gz tcl-cfc88759ab9d2a7118cb286943fc3074b430804b.tar.bz2 |
merge trunk
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r-- | unix/tclUnixCompat.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 5971272..3818121 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -973,8 +973,7 @@ CopyString( * Get CPU ID information on an Intel box under UNIX (either Linux or Cygwin) * * Results: - * Returns TCL_OK if successful, TCL_ERROR if CPUID is not supported or - * fails. + * Returns TCL_OK if successful, TCL_ERROR if CPUID is not supported. * * Side effects: * If successful, stores EAX, EBX, ECX and EDX registers after the CPUID @@ -990,14 +989,14 @@ TclWinCPUID( { int status = TCL_ERROR; -#ifdef HAVE_CPUID - __asm__ __volatile__("pushl %%ebx \n\t" /* save %ebx */ + /* See: <http://en.wikipedia.org/wiki/CPUID> */ +#if defined(HAVE_CPUID) + __asm__ __volatile__("mov %%ebx, %%edi \n\t" /* save %ebx */ "cpuid \n\t" - "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ - "popl %%ebx \n\t" /* restore the old %ebx */ - : "=a"(regsPtr[0]), "=r"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) - : "a"(index) - : "cc"); + "mov %%ebx, %%esi \n\t" /* save what cpuid just put in %ebx */ + "mov %%edi, %%ebx \n\t" /* restore the old %ebx */ + : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "a"(index) : "edi"); status = TCL_OK; #endif return status; |