aboutsummaryrefslogtreecommitdiff
blob: 4b3360399fa2658b39e83c7d7c104a3b066bd478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Fri, 11 Aug 2017 07:03:05 +0900
Subject: Bug 1389281 - Add GETRANDOM_NR definition for powerpc and mips.
 r?luke

At the same time, simplify the definitions, as:
- per python/mozbuild/mozbuild/configure/constants.py, supported
  compilers all support lowercase forms.
- all variants of powerpc, little endian or not, 32-bits or 64-bits,
  define __powerpc__.
- s390x also defines __s390__.
---
 js/src/jsmath.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp
index 0f8c6f4808cf..a7002aa37447 100644
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -70,19 +70,19 @@
 #  define GETRANDOM_NR 278
 # elif defined(__arm__)
 #  define GETRANDOM_NR 384
-// Added other architectures:
-# elif defined(__ppc64le__)
+# elif defined(__powerpc__)
 #  define GETRANDOM_NR 359
-# elif defined(__PPC64LE__)
-#  define GETRANDOM_NR 359
-# elif defined(__ppc64__)
-#  define GETRANDOM_NR 359
-# elif defined(__PPC64__)
-#  define GETRANDOM_NR 359
-# elif defined(__s390x__)
-#  define GETRANDOM_NR 349
 # elif defined(__s390__)
 #  define GETRANDOM_NR 349
+# elif defined(__mips__)
+#  include <sgidefs.h>
+#  if _MIPS_SIM == _MIPS_SIM_ABI32
+#    define GETRANDOM_NR 4353
+#  elif _MIPS_SIM == _MIPS_SIM_ABI64
+#    define GETRANDOM_NR 5313
+#  elif _MIPS_SIM == _MIPS_SIM_NABI32
+#    define GETRANDOM_NR 6317
+#  endif
 # endif
 
 # if defined(SYS_getrandom)