[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-commits
Subject:    [oprof-cvs] CVS: oprofile/daemon opd_ibs.c,1.3,1.4
From:       "Maynard Johnson" <maynardj () users ! sourceforge ! net>
Date:       2010-12-14 17:40:22
Message-ID: E1PSYrO-0001mB-AL () sfp-cvsdas-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/oprofile/oprofile/daemon
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6758/daemon

Modified Files:
	opd_ibs.c 
Log Message:
Fix non-x86 build issue due to cpuid instruction 

Index: opd_ibs.c
===================================================================
RCS file: /cvsroot/oprofile/oprofile/daemon/opd_ibs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -d -r1.3 -r1.4
--- opd_ibs.c	29 Nov 2010 15:05:44 -0000	1.3
+++ opd_ibs.c	14 Dec 2010 17:40:20 -0000	1.4
@@ -34,21 +34,6 @@
 #include <string.h>
 #include <limits.h>
 
-#if defined(__i386__) && defined(__PIC__)
-/* %ebx may be the PIC register.  */
-        #define __cpuid(level, a, b, c, d)                      \
-          __asm__ ("xchgl\t%%ebx, %1\n\t"                       \
-                   "cpuid\n\t"                                  \
-                   "xchgl\t%%ebx, %1\n\t"                       \
-                   : "=a" (a), "=r" (b), "=c" (c), "=d" (d)     \
-                   : "0" (level))
-#else
-        #define __cpuid(level, a, b, c, d)                      \
-          __asm__ ("cpuid\n\t"                                  \
-                   : "=a" (a), "=b" (b), "=c" (c), "=d" (d)     \
-                   : "0" (level))
-#endif
-
 extern op_cpu cpu_type;
 extern int no_event_ok;
 extern int sfile_equal(struct sfile const * sf, struct sfile const * sf2);
@@ -495,6 +480,7 @@ static int ibs_parse_and_set_um_op(char 
 
 static void check_cpuid_family_model_stepping()
 {
+#if defined(__i386__) || defined(__x86_64__) 
        union {
                 unsigned eax;
                 struct {
@@ -510,11 +496,16 @@ static void check_cpuid_family_model_ste
 	unsigned ebx, ecx, edx;
 
 	/* CPUID Fn0000_0001_EAX Family, Model, Stepping */
-	__cpuid(1, v.eax, ebx, ecx, edx);
+	asm ("cpuid" : "=a" (v.eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "0" (1));
 
 	ibs_family   = v.family + v.ext_family;
 	ibs_model    = v.model + v.ext_model;
 	ibs_stepping = v.stepping;
+#else
+	ibs_family   = 0;
+	ibs_model    = 0;
+	ibs_stepping = 0;
+#endif
 }
 
 


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Oprofile-commits mailing list
Oprofile-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic