summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixCompat.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-02 06:50:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-02 06:50:54 (GMT)
commit1546d6669e22d47728f48c7f81c58afdf2715ecc (patch)
tree5362859f7163fe6a3d7add68da5cea7325f351cf /unix/tclUnixCompat.c
parent4b2ebc3c6da8c4c97d1304f5f1871ee0d2a2afc2 (diff)
parentceffdc238ed1a181d39b020f0f98177f93067d28 (diff)
downloadtcl-1546d6669e22d47728f48c7f81c58afdf2715ecc.zip
tcl-1546d6669e22d47728f48c7f81c58afdf2715ecc.tar.gz
tcl-1546d6669e22d47728f48c7f81c58afdf2715ecc.tar.bz2
TclWinCPUID now respects -fPIC compilation on 32-bit Linux
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r--unix/tclUnixCompat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 1c42056..5971272 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -991,12 +991,14 @@ TclWinCPUID(
int status = TCL_ERROR;
#ifdef HAVE_CPUID
- /* disabled in emergency -- fails on linux */
-# if 0
- __asm__ __volatile__ ("cpuid":\
- "=a" (regsPtr[0]), "=b" (regsPtr[1]), "=c" (regsPtr[2]), "=d" (regsPtr[3]) : "a" (index));
+ __asm__ __volatile__("pushl %%ebx \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");
status = TCL_OK;
-# endif
#endif
return status;
}