qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [5973] Introduce and use cache-utils.[ch]
Date: Thu, 11 Dec 2008 12:19:23 -0600	[thread overview]
Message-ID: <1229019563.26586.19.camel@localhost.localdomain> (raw)
In-Reply-To: <E1LAUa1-00047r-Eb@cvs.savannah.gnu.org>

On Wed, 2008-12-10 at 19:18 +0000, malc wrote:
> +#elif defined __linux__
> +#include <linux/auxvec.h>
> +
> +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 <hollisb@us.ibm.com>

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 <linux/auxvec.h>
+
+#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

  reply	other threads:[~2008-12-11 18:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10 19:18 [Qemu-devel] [5973] Introduce and use cache-utils.[ch] malc
2008-12-11 18:19 ` Hollis Blanchard [this message]
2008-12-11 18:52   ` malc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229019563.26586.19.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).