0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch 1.5 KB

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