Skip to contentSkip to conversation

[5980] Don't require linux/auxvec.h, which isn't always installed with libc .

Qemu-devel malc 1 participant 1 message Dec 11, 2008

lore
Share & tools
lore

malc

author
#0 lore raw

Revision: 5980

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5980
Author:   malc
Date:     2008-12-11 19:12:59 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
Don't require linux/auxvec.h, which isn't always installed with libc.

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.

Modified Paths:
--------------
trunk/cache-utils.c

Modified: trunk/cache-utils.c
===================================================================

cache-utils.c +7 -4
@@ -16,18 +16,21 @@
 }
 
 #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)
 {
     unsigned long *auxv;
 
     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;
         }
     }