0004-Properly-define-the-__NR_memfd_create-macro-for-MIPS.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Properly define the __NR_memfd_create macro for MIPS
  2. This is an upstream patch which has been applied to the master branch
  3. and I have adapted it to make it apply to the v217 version.
  4. Upstream commit:
  5. http://cgit.freedesktop.org/systemd/systemd/commit/?id=e6c019026b8cfd27a997e6e6ed1349f8f289b7e2
  6. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  7. From a51496db6edc8168268c86ea55915405f95b0212 Mon Sep 17 00:00:00 2001
  8. From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  9. Date: Thu, 13 Nov 2014 17:32:52 +0000
  10. Subject: [PATCH] Properly define the __NR_memfd_create macro for MIPS
  11. This macro exists for MIPS since v3.17:
  12. https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=42944521af97a3b25516f15f3149aec3779656dc
  13. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  14. ---
  15. src/shared/missing.h | 11 +++++++++--
  16. 1 files changed, 9 insertions(+), 2 deletions(-)
  17. diff --git a/src/shared/missing.h b/src/shared/missing.h
  18. index bb4f8f2..66bedcf 100644
  19. --- a/src/shared/missing.h
  20. +++ b/src/shared/missing.h
  21. @@ -125,8 +125,15 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
  22. # endif
  23. #elif defined _MIPS_SIM
  24. # ifndef __NR_memfd_create
  25. -# warning "__NR_memfd_create not yet defined for MIPS"
  26. -# define __NR_memfd_create 0xffffffff
  27. +# if _MIPS_SIM == _MIPS_SIM_ABI32
  28. +# define __NR_memfd_create 4354
  29. +# endif
  30. +# if _MIPS_SIM == _MIPS_SIM_NABI32
  31. +# define __NR_memfd_create 6318
  32. +# endif
  33. +# if _MIPS_SIM == _MIPS_SIM_ABI64
  34. +# define __NR_memfd_create 5314
  35. +# endif
  36. # endif
  37. #else
  38. # ifndef __NR_memfd_create
  39. --
  40. 1.7.1