diff options
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/stressapptest/ChangeLog | 6 | ||||
-rw-r--r-- | dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch | 25 |
2 files changed, 28 insertions, 3 deletions
diff --git a/dev-util/stressapptest/ChangeLog b/dev-util/stressapptest/ChangeLog index d55a165af08f..9c0904d7be68 100644 --- a/dev-util/stressapptest/ChangeLog +++ b/dev-util/stressapptest/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-util/stressapptest # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/stressapptest/ChangeLog,v 1.4 2013/01/05 04:35:30 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-util/stressapptest/ChangeLog,v 1.5 2013/01/06 19:21:42 vapier Exp $ + + 06 Jan 2013; Mike Frysinger <vapier@gentoo.org> + files/stressapptest-1.0.4-cpuid-pic.patch: + Also tweak cpuid asm in worker.cc. 05 Jan 2013; Mike Frysinger <vapier@gentoo.org> +files/stressapptest-1.0.4-cpuid-pic.patch, stressapptest-1.0.4.ebuild: diff --git a/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch b/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch index 6bd6c3702f3e..740349bc6f1f 100644 --- a/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch +++ b/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch @@ -1,7 +1,7 @@ http://code.google.com/p/stressapptest/issues/detail?id=26 ---- src/os.cc -+++ src/os.cc +--- a/src/os.cc ++++ b/src/os.cc @@ -149,7 +149,16 @@ void OsLayer::GetFeatures() { // http://www.sandpile.org/ia32/cpuid.htm int ax, bx, cx, dx; @@ -20,3 +20,24 @@ http://code.google.com/p/stressapptest/issues/detail?id=26 has_clflush_ = (dx >> 19) & 1; has_sse2_ = (dx >> 26) & 1; +--- a/src/worker.cc ++++ b/src/worker.cc +@@ -85,7 +85,17 @@ namespace { + inline int apicid(void) { + int cpu; + #if defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686) +- __asm __volatile("cpuid" : "=b" (cpu) : "a" (1) : "cx", "dx"); ++ __asm__ __volatile__ ( ++# if defined(STRESSAPPTEST_CPU_I686) && defined(__PIC__) ++ "xchg %%ebx, %%esi;" ++ "cpuid;" ++ "xchg %%esi, %%ebx;" ++ : "=S" (cpu) ++# else ++ "cpuid;" ++ : "=b" (cpu) ++# endif ++ : "a" (1) : "cx", "dx"); + #elif defined(STRESSAPPTEST_CPU_ARMV7A) + #warning "Unsupported CPU type ARMV7A: unable to determine core ID." + cpu = 0; |