mk: shared libraries
[dpdk.git] / app / test / test_red.c
index 2fb1938..526bfb4 100644 (file)
@@ -150,7 +150,15 @@ static void rdtsc_prof_init(struct rdtsc_prof *p, const char *name)
 
 static inline void rdtsc_prof_start(struct rdtsc_prof *p)
 {
+#ifdef __PIC__
+    asm volatile (
+    "mov %%ebx, %%edi\n"
+    "cpuid\n"
+    "xchgl %%ebx, %%edi;\n"
+       : : : "%eax", "%edi", "%ecx", "%edx" );
+#else
        asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
+#endif
        p->clk_start = rte_rdtsc();
 }