diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-01-05 09:33:43 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-01-05 10:14:05 +0000 |
commit | 549db5c32bb025501e2eeb23d2e5cc669061eb71 (patch) | |
tree | a68fc142b125efd1b329ae560796acdae5a0f01d | |
parent | 1e397eadf1cf54920c45a2fdc204b1ade1b72d38 (diff) |
hw/i386: Fix broken build for non POSIX hosts
pc-testdev.c cannot be compiled with MinGW (and other non POSIX hosts):
CC i386-softmmu/hw/i386/../pc-testdev.o
qemu/hw/i386/../pc-testdev.c:38:22: warning: sys/mman.h: file not found
qemu/hw/i386/../pc-testdev.c: In function ‘test_flush_page’:
qemu/hw/i386/../pc-testdev.c:103: warning: implicit declaration of function ‘mprotect’
...
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | hw/pc-testdev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/pc-testdev.c b/hw/pc-testdev.c index 620c86c92a..192848998c 100644 --- a/hw/pc-testdev.c +++ b/hw/pc-testdev.c @@ -35,7 +35,10 @@ * git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git */ +#include "config-host.h" +#if defined(CONFIG_POSIX) #include <sys/mman.h> +#endif #include "hw.h" #include "qdev.h" #include "isa.h" @@ -100,8 +103,10 @@ static void test_flush_page(void *opaque, hwaddr addr, uint64_t data, /* We might not be able to get the full page, only mprotect what we actually have mapped */ +#if defined(CONFIG_POSIX) mprotect(a, page, PROT_NONE); mprotect(a, page, PROT_READ|PROT_WRITE); +#endif cpu_physical_memory_unmap(a, page, 0, 0); } |