anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0028-systemd-add-getrandom-syscall-numbers-for-MIPS.patch

1ff636
From 32213f2f1d98bf851a570ecc35c018001e5d5ac4 Mon Sep 17 00:00:00 2001
1ff636
From: Aaro Koskinen <aaro.koskinen@nokia.com>
1ff636
Date: Mon, 23 Feb 2015 16:01:31 +0200
1ff636
Subject: [PATCH] systemd: add getrandom syscall numbers for MIPS
1ff636
1ff636
Add getrandom syscall numbers for MIPS. Based on Linux 3.17 kernel
1ff636
(commit 42944521af97a3b25516f15f3149aec3779656dc, "MIPS: Wire up new
1ff636
syscalls getrandom and memfd_create").
1ff636
1ff636
(cherry picked from commit 3bec6d4690d2a7f08dc27b8221299c1db94978c4)
1ff636
---
1ff636
 src/shared/missing.h | 10 ++++++++++
1ff636
 1 file changed, 10 insertions(+)
1ff636
1ff636
diff --git a/src/shared/missing.h b/src/shared/missing.h
181b3f
index 06a55769a..8cb0b2c96 100644
1ff636
--- a/src/shared/missing.h
1ff636
+++ b/src/shared/missing.h
1ff636
@@ -243,6 +243,16 @@ static inline int memfd_create(const char *name, unsigned int flags) {
1ff636
 #    define __NR_getrandom 349
1ff636
 #  elif defined(__powerpc__)
1ff636
 #    define __NR_getrandom 359
1ff636
+#  elif defined _MIPS_SIM
1ff636
+#    if _MIPS_SIM == _MIPS_SIM_ABI32
1ff636
+#      define __NR_getrandom 4353
1ff636
+#    endif
1ff636
+#    if _MIPS_SIM == _MIPS_SIM_NABI32
1ff636
+#      define __NR_getrandom 6317
1ff636
+#    endif
1ff636
+#    if _MIPS_SIM == _MIPS_SIM_ABI64
1ff636
+#      define __NR_getrandom 5313
1ff636
+#    endif
1ff636
 #  else
1ff636
 #    warning "__NR_getrandom unknown for your architecture"
1ff636
 #    define __NR_getrandom 0xffffffff