From c26010c3ef84ee69a148788e17c75d12d23fadbd Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Mon, 7 Feb 2011 13:06:17 -0800 Subject: [PATCH] x86: More fixing oprofile compilation in PIC mode Change-Id: I4c58b95a9f6f13bdfa59a6b78248f97e86821e5a --- daemon/opd_ibs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon/opd_ibs.c b/daemon/opd_ibs.c index f4af7c2..ce6d90b 100644 --- a/daemon/opd_ibs.c +++ b/daemon/opd_ibs.c @@ -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;