Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 1 | From ebf4bb2f51da83af0c61480414cfa156f7308b34 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 21 Mar 2022 10:09:38 -0700 |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 4 | Subject: [PATCH 09/12] Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 5 | systems |
| 6 | |
| 7 | linux only wires MAP_SYNC and MAP_SHARED_VALIDATE for architectures |
| 8 | which include asm-generic/mman.h and mips/powerpc are not including this |
| 9 | file in linux/mman.h, therefore these should be defined for such |
| 10 | architectures on Linux as well. This fixes build on mips/musl/linux |
| 11 | |
| 12 | Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg05298.html] |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | Cc: Zhang Yi <yi.z.zhang@linux.intel.com> |
| 15 | Cc: Michael S. Tsirkin <mst@redhat.com> |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 16 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 17 | --- |
| 18 | util/mmap-alloc.c | 10 +++++++--- |
| 19 | 1 file changed, 7 insertions(+), 3 deletions(-) |
| 20 | |
| 21 | diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 22 | index 893d86435..86d3cda24 100644 |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 23 | --- a/util/mmap-alloc.c |
| 24 | +++ b/util/mmap-alloc.c |
| 25 | @@ -10,14 +10,18 @@ |
| 26 | * later. See the COPYING file in the top-level directory. |
| 27 | */ |
| 28 | |
| 29 | +#include "qemu/osdep.h" |
| 30 | #ifdef CONFIG_LINUX |
| 31 | #include <linux/mman.h> |
| 32 | -#else /* !CONFIG_LINUX */ |
| 33 | +#endif /* CONFIG_LINUX */ |
| 34 | + |
| 35 | +#ifndef MAP_SYNC |
| 36 | #define MAP_SYNC 0x0 |
| 37 | +#endif /* MAP_SYNC */ |
| 38 | +#ifndef MAP_SHARED_VALIDATE |
| 39 | #define MAP_SHARED_VALIDATE 0x0 |
| 40 | -#endif /* CONFIG_LINUX */ |
| 41 | +#endif /* MAP_SHARED_VALIDATE */ |
| 42 | |
| 43 | -#include "qemu/osdep.h" |
| 44 | #include "qemu/mmap-alloc.h" |
| 45 | #include "qemu/host-utils.h" |
| 46 | #include "qemu/cutils.h" |
| 47 | -- |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 48 | 2.30.2 |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 49 | |