]> git.droids-corp.org - dpdk.git/blobdiff - app/test/test_red.c
mk: shared libraries
[dpdk.git] / app / test / test_red.c
index 2fb19383e5d44f3cdc747de65c12e48fa9ea7ccd..526bfb4f1d71584970e92316c03e293c53819b57 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();
 }