summaryrefslogtreecommitdiff
blob: 3443a91c288be59a11096b7eb6e0cc5d4c8a88f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- c/jcpuid/src/jcpuid.c	2008-10-06 09:44:53.000000000 -0400
+++ c/jcpuid/src/jcpuid.c.new2	2010-12-27 09:41:53.000000000 -0500
@@ -19,6 +19,7 @@
 			mov d, edx
 		}
 	#else
+	#ifdef _LP64
 		//Use GCC assembler notation
 		asm 
 		(
@@ -29,6 +30,20 @@
 			  "=d"(d)
 			:"a"(iFunction)
 		);
+	#elif defined(__i386__)
+		asm 
+		(
+			"pushl %%ebx\n\t"
+			"cpuid\n\t"
+			"movl %%ebx, %%edi\n\t"
+			"popl %%ebx"
+			: "=a" (a),
+			  "=D" (b),
+			  "=c" (c),
+			  "=d" (d)
+			:"a"(iFunction)
+		);
+	#endif
 	#endif
 	return (*env)->NewObject(env, clsResult,constructor,a,b,c,d);
 }