diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-29 08:14:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-29 08:14:41 (GMT) |
commit | 50a21353617798019e1200fb102877f4c1e1ca22 (patch) | |
tree | c27aad017d3cb9d2f5f651836bf8274157a1f0f1 /unix | |
parent | 5c6ecd58dc43872d579e7ee7d0cf65eb110aaddd (diff) | |
parent | 296348b0acfe641191926aee31c5484fd493cd5a (diff) | |
download | tcl-50a21353617798019e1200fb102877f4c1e1ca22.zip tcl-50a21353617798019e1200fb102877f4c1e1ca22.tar.gz tcl-50a21353617798019e1200fb102877f4c1e1ca22.tar.bz2 |
merge trunk
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixCompat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index f8f0080..e5929ba 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -993,11 +993,19 @@ TclWinCPUID( /* See: <http://en.wikipedia.org/wiki/CPUID> */ #if defined(HAVE_CPUID) +#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64) + __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */ + "cpuid \n\t" + "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */ + : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "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; |