From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrSfb-0002NO-Ba for qemu-devel@nongnu.org; Sat, 05 Jan 2013 07:16:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrSfa-00040F-97 for qemu-devel@nongnu.org; Sat, 05 Jan 2013 07:16:11 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:61322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrSfa-000408-33 for qemu-devel@nongnu.org; Sat, 05 Jan 2013 07:16:10 -0500 Received: by mail-pb0-f44.google.com with SMTP id uo1so9714740pbc.17 for ; Sat, 05 Jan 2013 04:16:09 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1357374823-25173-1-git-send-email-sw@weilnetz.de> References: <1357374823-25173-1-git-send-email-sw@weilnetz.de> From: Blue Swirl Date: Sat, 5 Jan 2013 12:15:49 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] hw/i386: Fix broken build for non POSIX hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Lucas Meneghel Rodrigues , Anthony Liguori , Marcelo Tosatti , qemu-devel@nongnu.org, Alexander Graf , Gerd Hoffmann Thanks, applied. On Sat, Jan 5, 2013 at 8:33 AM, Stefan Weil wrote: > 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 =E2=80=98test_flush_page=E2=80= =99: > qemu/hw/i386/../pc-testdev.c:103: warning: implicit declaration of functi= on =E2=80=98mprotect=E2=80=99 > ... > > Signed-off-by: Stefan Weil > --- > > v2 > > This patch replaces my previous patch > > hw/i386: Fix broken build for MinGW > > Instead of disabling pc-testdev.o for non KVM hosts, > this version only excludes the mprotect code for non > POSIX hosts. Alex Graf suggested a similar solution. > > - Stefan > > hw/pc-testdev.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/hw/pc-testdev.c b/hw/pc-testdev.c > index 620c86c..1928489 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 > +#endif > #include "hw.h" > #include "qdev.h" > #include "isa.h" > @@ -100,8 +103,10 @@ static void test_flush_page(void *opaque, hwaddr add= r, 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); > } > > -- > 1.7.10.4 > >