diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-06 13:41:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-06 13:41:23 (GMT) |
commit | 292be1554df2e6a02eab708e38cbbd0ab5977466 (patch) | |
tree | 7a20dbd5e4014a5d022ed40337476dc657d45cdb /unix/tclUnixCompat.c | |
parent | a30135ba031c53d2726673256a21b95ddf1b3551 (diff) | |
parent | c5e46efb954d7d3ec9a1594489918053bde2e758 (diff) | |
download | tcl-292be1554df2e6a02eab708e38cbbd0ab5977466.zip tcl-292be1554df2e6a02eab708e38cbbd0ab5977466.tar.gz tcl-292be1554df2e6a02eab708e38cbbd0ab5977466.tar.bz2 |
merge novemnovem_remove_va
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r-- | unix/tclUnixCompat.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index e201018..e5929ba 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -8,8 +8,6 @@ */ #include "tclInt.h" -#include <pwd.h> -#include <grp.h> #include <errno.h> #include <string.h> @@ -49,7 +47,7 @@ #ifdef TCL_THREADS -typedef struct ThreadSpecificData { +typedef struct { struct passwd pwd; #if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5) #define NEED_PW_CLEANER 1 @@ -995,12 +993,19 @@ TclWinCPUID( /* See: <http://en.wikipedia.org/wiki/CPUID> */ #if defined(HAVE_CPUID) - __asm__ __volatile__("mov %%ebx, %%edi \n\t" /* save %ebx */ +#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64) + __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */ "cpuid \n\t" - "mov %%ebx, %%esi \n\t" /* save what cpuid just put in %ebx */ - "mov %%edi, %%ebx \n\t" /* restore the old %ebx */ + "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) - : "a"(index) : "edi"); + : "a"(index)); +#else + __asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */ + "cpuid \n\t" + "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */ + : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "a"(index)); +#endif status = TCL_OK; #endif return status; |