]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/pc-testdev.c
Make all static TypeInfos const
[mirror_qemu.git] / hw / pc-testdev.c
index 620c86c92a317ce132ff04212ce861fbb610485e..ec0bc4bb95eb4c756f0bbdd8569ab425f59b44f7 100644 (file)
  * 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);
 }
 
@@ -167,7 +172,7 @@ static void testdev_class_init(ObjectClass *klass, void *data)
     k->init = init_test_device;
 }
 
-static TypeInfo testdev_info = {
+static const TypeInfo testdev_info = {
     .name           = TYPE_TESTDEV,
     .parent         = TYPE_ISA_DEVICE,
     .instance_size  = sizeof(struct PCTestdev),