qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux systems
@ 2022-03-22 15:46 Khem Raj
  2022-03-22 15:53 ` Michael S. Tsirkin
  2022-03-22 16:24 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Khem Raj @ 2022-03-22 15:46 UTC (permalink / raw)
  To: qemu-devel, qemu-mips; +Cc: Zhang Yi, Khem Raj, Michael S . Tsirkin

linux only wires MAP_SYNC for architectures which include
asm-generic/mman-common.h and mips is one such architecture which is not
including this file via linux/mman.h, therefore as a fall back
these constants should be defined for such architectures on Linux
as well.

This fixes build on mips/musl/linux

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Zhang Yi <yi.z.zhang@linux.intel.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
---
v2: Improve commit message

 util/mmap-alloc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 893d864354..86d3cda248 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -10,14 +10,18 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #ifdef CONFIG_LINUX
 #include <linux/mman.h>
-#else  /* !CONFIG_LINUX */
+#endif  /* CONFIG_LINUX */
+
+#ifndef MAP_SYNC
 #define MAP_SYNC              0x0
+#endif /* MAP_SYNC */
+#ifndef MAP_SHARED_VALIDATE
 #define MAP_SHARED_VALIDATE   0x0
-#endif /* CONFIG_LINUX */
+#endif /* MAP_SHARED_VALIDATE */
 
-#include "qemu/osdep.h"
 #include "qemu/mmap-alloc.h"
 #include "qemu/host-utils.h"
 #include "qemu/cutils.h"
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-22 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 15:46 [PATCH v2] Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux systems Khem Raj
2022-03-22 15:53 ` Michael S. Tsirkin
2022-03-22 16:24 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).