Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: client/deps/fio/crc32c-intel.patch

Issue 3412036: Basis for cryptohome+power_SuspendResume stress test. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: tweaks to test params Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/deps/fio/crc32c-intel.patch
diff --git a/client/deps/fio/crc32c-intel.patch b/client/deps/fio/crc32c-intel.patch
new file mode 100644
index 0000000000000000000000000000000000000000..86ad5a10b7d4dfe56a2f75854f9a54065f5dfb70
--- /dev/null
+++ b/client/deps/fio/crc32c-intel.patch
@@ -0,0 +1,39 @@
+--- crc/crc32c-intel.c 2010-08-27 09:04:13.000000000 +0200
++++ crc/crc32c-intel.c.new2 2010-09-17 15:04:28.000000000 +0200
+@@ -74,30 +74,12 @@
+ return crc;
+ }
+
+-static void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
+- unsigned int *edx)
+-{
+- int id = *eax;
+-
+- asm("movl %4, %%eax;"
+- "cpuid;"
+- "movl %%eax, %0;"
+- "movl %%ebx, %1;"
+- "movl %%ecx, %2;"
+- "movl %%edx, %3;"
+- : "=r" (*eax), "=r" (*ebx), "=r" (*ecx), "=r" (*edx)
+- : "r" (id)
+- : "eax", "ebx", "ecx", "edx");
+-}
+-
+-int crc32c_intel_works(void)
+-{
+- unsigned int eax, ebx, ecx, edx;
+-
+- eax = 1;
+-
+- do_cpuid(&eax, &ebx, &ecx, &edx);
+- return (ecx & (1 << 20)) != 0;
++int crc32c_intel_works(void) {
++ unsigned int _eax, _ebx, _ecx, _edx;
++ unsigned int op = 1;
++ asm ("cpuid" : "=a" (_eax), "=r" (_ebx), "=c" (_ecx), "=d" (_edx)
++ : "a" (op));
++ return (_ecx & (1 << 20)) != 0;
+ }
+
+ #endif /* ARCH_HAVE_SSE */

Powered by Google App Engine
This is Rietveld 408576698