From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH 3/3] app/test: enable test_red to build on non x86 platform Date: Thu, 27 Aug 2015 09:38:41 +0530 Message-ID: <20150827040839.GA5223@localhost.localdomain> References: <1439901605-31164-1-git-send-email-jerin.jacob@caviumnetworks.com> <1439901605-31164-3-git-send-email-jerin.jacob@caviumnetworks.com> <1439901605-31164-4-git-send-email-jerin.jacob@caviumnetworks.com> <1759749.jiktJN44xV@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0081.outbound.protection.outlook.com [65.55.169.81]) by dpdk.org (Postfix) with ESMTP id B23815A33 for ; Thu, 27 Aug 2015 06:09:02 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1759749.jiktJN44xV@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 ? >