[dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform

Jerin Jacob jerin.jacob at caviumnetworks.com
Thu Aug 27 06:08:41 CEST 2015


On Tue, Aug 25, 2015 at 02:03:13PM +0200, Thomas Monjalon wrote:
> 2015-08-18 18:10, Jerin Jacob:
> > --- a/app/test/test_red.c
> > +++ b/app/test/test_red.c
> > +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32)
> >  #ifdef __PIC__
> >      asm volatile (
> >      "mov %%ebx, %%edi\n"
> > @@ -155,6 +156,7 @@ static inline void rdtsc_prof_start(struct rdtsc_prof *p)
> >  #else
> >  	asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
> >  #endif
> > +#endif
> >  	p->clk_start = rte_rdtsc();
> 
> The right fix would be to move that arch-specific code into an EAL abstraction.

I agree. I thought the same. But I am not able to understand why 'cpuid'
instruction used here without any input/output parameters. What is the
role of 'cpuid' instruction in this specific function and what to
abstract in eal ?
 
> 


More information about the dev mailing list