Commit 4710036affbd9e88c40d433c3417f3d74f166f4d

Authored by malc
1 parent 5caf7bb2

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.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5980 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 4 deletions
cache-utils.c
@@ -16,7 +16,10 @@ static void ppc_init_cacheline_sizes(void) @@ -16,7 +16,10 @@ static void ppc_init_cacheline_sizes(void)
16 } 16 }
17 17
18 #elif defined __linux__ 18 #elif defined __linux__
19 -#include <linux/auxvec.h> 19 +
  20 +#define QEMU_AT_NULL 0
  21 +#define QEMU_AT_DCACHEBSIZE 19
  22 +#define QEMU_AT_ICACHEBSIZE 20
20 23
21 static void ppc_init_cacheline_sizes(char **envp) 24 static void ppc_init_cacheline_sizes(char **envp)
22 { 25 {
@@ -24,10 +27,10 @@ static void ppc_init_cacheline_sizes(char **envp) @@ -24,10 +27,10 @@ static void ppc_init_cacheline_sizes(char **envp)
24 27
25 while (*envp++); 28 while (*envp++);
26 29
27 - for (auxv = (unsigned long *) envp; *auxv != AT_NULL; auxv += 2) { 30 + for (auxv = (unsigned long *) envp; *auxv != QEMU_AT_NULL; auxv += 2) {
28 switch (*auxv) { 31 switch (*auxv) {
29 - case AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break;  
30 - case AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break; 32 + case QEMU_AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break
  33 + case QEMU_AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break
31 default: break; 34 default: break;
32 } 35 }
33 } 36 }