valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

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

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