From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAq8H-0005IU-6p for qemu-devel@nongnu.org; Thu, 11 Dec 2008 13:19:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAq8F-0005IG-Cm for qemu-devel@nongnu.org; Thu, 11 Dec 2008 13:19:28 -0500 Received: from [199.232.76.173] (port=57328 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAq8F-0005ID-6f for qemu-devel@nongnu.org; Thu, 11 Dec 2008 13:19:27 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:39240) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAq8E-0004DF-SN for qemu-devel@nongnu.org; Thu, 11 Dec 2008 13:19:27 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mBBIIxAm014423 for ; Thu, 11 Dec 2008 13:18:59 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBBIJMQO194866 for ; Thu, 11 Dec 2008 13:19:22 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBBIJMuj003320 for ; Thu, 11 Dec 2008 13:19:22 -0500 Subject: Re: [Qemu-devel] [5973] Introduce and use cache-utils.[ch] From: Hollis Blanchard In-Reply-To: References: Content-Type: text/plain Date: Thu, 11 Dec 2008 12:19:23 -0600 Message-Id: <1229019563.26586.19.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, 2008-12-10 at 19:18 +0000, malc wrote: > +#elif defined __linux__ > +#include > + > +static void ppc_init_cacheline_sizes(char **envp) > +{ > + unsigned long *auxv; > + > + while (*envp++); > + > + for (auxv = (unsigned long *) envp; *auxv != AT_NULL; auxv += 2) { > + switch (*auxv) { > + case AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break; > + case AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break; > + default: break; > + } > + } > +} I'm cross-compiling, and linux/auxvec.h was not installed with my glibc headers. How about this: Don't require linux/auxvec.h, which isn't always installed with libc. Signed-off-by: Hollis Blanchard diff --git a/cache-utils.c b/cache-utils.c index 0b4a5ac..7c98144 100644 --- a/cache-utils.c +++ b/cache-utils.c @@ -16,7 +16,10 @@ static void ppc_init_cacheline_sizes(void) } #elif defined __linux__ -#include + +#define QEMU_AT_NULL 0 +#define QEMU_AT_DCACHEBSIZE 19 +#define QEMU_AT_ICACHEBSIZE 20 static void ppc_init_cacheline_sizes(char **envp) { @@ -24,10 +27,10 @@ static void ppc_init_cacheline_sizes(char **envp) while (*envp++); - for (auxv = (unsigned long *) envp; *auxv != AT_NULL; auxv += 2) { + for (auxv = (unsigned long *) envp; *auxv != QEMU_AT_NULL; auxv += 2) { switch (*auxv) { - case AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break; - case AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break; + case QEMU_AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break + case QEMU_AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break default: break; } } -- Hollis Blanchard IBM Linux Technology Center