Permalink
Browse files

x86: More fixing oprofile compilation in PIC mode

Change-Id: I4c58b95a9f6f13bdfa59a6b78248f97e86821e5a
  • Loading branch information...
1 parent 87866d9 commit c26010c3ef84ee69a148788e17c75d12d23fadbd @kruton kruton committed Feb 7, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 daemon/opd_ibs.c
View
@@ -496,7 +496,17 @@ static void check_cpuid_family_model_stepping()
unsigned ebx, ecx, edx;
/* CPUID Fn0000_0001_EAX Family, Model, Stepping */
+#ifdef __PIC__
+ __asm__ __volatile__ (
+ "pushl %%ebx\n"
+ "cpuid\n"
+ "mov %%ebx, %1\n"
+ "popl %%ebx"
+ : "=a" (v.eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "0" (1)
+ );
+#else
asm ("cpuid" : "=a" (v.eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "0" (1));
+#endif
ibs_family = v.family + v.ext_family;
ibs_model = v.model + v.ext_model;

0 comments on commit c26010c

Please sign in to comment.