summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nspr
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2018-06-21 14:26:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-04 00:02:16 +0100
commitb2a13cef91d5212257faf4aa4e12e0f550264241 (patch)
tree96abb5f37d05bc67ff16089483d6486a3c1364c6 /meta/recipes-support/nspr
parentc33c20733d9ff4f0403503b250a65dc487853ff0 (diff)
downloadpoky-b2a13cef91d5212257faf4aa4e12e0f550264241.tar.gz
nspr: Add RISC-V support
(From OE-Core rev: 47b76dd02007e96fc95099524d43d517daf2aa6e) Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/nspr')
-rw-r--r--meta/recipes-support/nspr/nspr/0003-Add-type-definitions-for-the-RISC-V-architecture.patch150
-rw-r--r--meta/recipes-support/nspr/nspr_4.19.bb1
2 files changed, 151 insertions, 0 deletions
diff --git a/meta/recipes-support/nspr/nspr/0003-Add-type-definitions-for-the-RISC-V-architecture.patch b/meta/recipes-support/nspr/nspr/0003-Add-type-definitions-for-the-RISC-V-architecture.patch
new file mode 100644
index 0000000000..47e1475e0e
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr/0003-Add-type-definitions-for-the-RISC-V-architecture.patch
@@ -0,0 +1,150 @@
1# HG changeset patch
2# User Karsten Merker <merker@debian.org>
3# Date 1523974333 -7200
4# Node ID f47871e2aeb16b39d4f516690e25c81b04d6d05a
5# Parent 776db96f834cb86e8863052201d55f60a2da91cb
6Bug 1308584, Add type definitions for the RISC-V architecture, r=kaie
7
8Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
9[ Changes by AF:
10 - Rebase on other Yocto patches
11]
12Upstream-Status: Backport [ https://hg.mozilla.org/projects/nspr/rev/f47871e2aeb1 ]
13
14diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
15--- a/pr/include/md/_linux.cfg
16+++ b/pr/include/md/_linux.cfg
17@@ -1015,16 +1015,108 @@
18 #define PR_ALIGN_OF_FLOAT 4
19 #define PR_ALIGN_OF_DOUBLE 4
20 #define PR_ALIGN_OF_POINTER 4
21 #define PR_ALIGN_OF_WORD 4
22
23 #define PR_BYTES_PER_WORD_LOG2 2
24 #define PR_BYTES_PER_DWORD_LOG2 3
25
26+#elif defined(__riscv) && (__riscv_xlen == 32)
27+
28+#undef IS_BIG_ENDIAN
29+#define IS_LITTLE_ENDIAN 1
30+#undef IS_64
31+
32+#define PR_BYTES_PER_BYTE 1
33+#define PR_BYTES_PER_SHORT 2
34+#define PR_BYTES_PER_INT 4
35+#define PR_BYTES_PER_INT64 8
36+#define PR_BYTES_PER_LONG 4
37+#define PR_BYTES_PER_FLOAT 4
38+#define PR_BYTES_PER_DOUBLE 8
39+#define PR_BYTES_PER_WORD 4
40+#define PR_BYTES_PER_DWORD 8
41+
42+#define PR_BITS_PER_BYTE 8
43+#define PR_BITS_PER_SHORT 16
44+#define PR_BITS_PER_INT 32
45+#define PR_BITS_PER_INT64 64
46+#define PR_BITS_PER_LONG 32
47+#define PR_BITS_PER_FLOAT 32
48+#define PR_BITS_PER_DOUBLE 64
49+#define PR_BITS_PER_WORD 32
50+
51+#define PR_BITS_PER_BYTE_LOG2 3
52+#define PR_BITS_PER_SHORT_LOG2 4
53+#define PR_BITS_PER_INT_LOG2 5
54+#define PR_BITS_PER_INT64_LOG2 6
55+#define PR_BITS_PER_LONG_LOG2 5
56+#define PR_BITS_PER_FLOAT_LOG2 5
57+#define PR_BITS_PER_DOUBLE_LOG2 6
58+#define PR_BITS_PER_WORD_LOG2 5
59+
60+#define PR_ALIGN_OF_SHORT 2
61+#define PR_ALIGN_OF_INT 4
62+#define PR_ALIGN_OF_LONG 4
63+#define PR_ALIGN_OF_INT64 8
64+#define PR_ALIGN_OF_FLOAT 4
65+#define PR_ALIGN_OF_DOUBLE 8
66+#define PR_ALIGN_OF_POINTER 4
67+#define PR_ALIGN_OF_WORD 4
68+
69+#define PR_BYTES_PER_WORD_LOG2 2
70+#define PR_BYTES_PER_DWORD_LOG2 3
71+
72+#elif defined(__riscv) && (__riscv_xlen == 64)
73+
74+#undef IS_BIG_ENDIAN
75+#define IS_LITTLE_ENDIAN 1
76+#define IS_64
77+
78+#define PR_BYTES_PER_BYTE 1
79+#define PR_BYTES_PER_SHORT 2
80+#define PR_BYTES_PER_INT 4
81+#define PR_BYTES_PER_INT64 8
82+#define PR_BYTES_PER_LONG 8
83+#define PR_BYTES_PER_FLOAT 4
84+#define PR_BYTES_PER_DOUBLE 8
85+#define PR_BYTES_PER_WORD 8
86+#define PR_BYTES_PER_DWORD 8
87+
88+#define PR_BITS_PER_BYTE 8
89+#define PR_BITS_PER_SHORT 16
90+#define PR_BITS_PER_INT 32
91+#define PR_BITS_PER_INT64 64
92+#define PR_BITS_PER_LONG 64
93+#define PR_BITS_PER_FLOAT 32
94+#define PR_BITS_PER_DOUBLE 64
95+#define PR_BITS_PER_WORD 64
96+
97+#define PR_BITS_PER_BYTE_LOG2 3
98+#define PR_BITS_PER_SHORT_LOG2 4
99+#define PR_BITS_PER_INT_LOG2 5
100+#define PR_BITS_PER_INT64_LOG2 6
101+#define PR_BITS_PER_LONG_LOG2 6
102+#define PR_BITS_PER_FLOAT_LOG2 5
103+#define PR_BITS_PER_DOUBLE_LOG2 6
104+#define PR_BITS_PER_WORD_LOG2 6
105+
106+#define PR_ALIGN_OF_SHORT 2
107+#define PR_ALIGN_OF_INT 4
108+#define PR_ALIGN_OF_LONG 8
109+#define PR_ALIGN_OF_INT64 8
110+#define PR_ALIGN_OF_FLOAT 4
111+#define PR_ALIGN_OF_DOUBLE 8
112+#define PR_ALIGN_OF_POINTER 8
113+#define PR_ALIGN_OF_WORD 8
114+
115+#define PR_BYTES_PER_WORD_LOG2 3
116+#define PR_BYTES_PER_DWORD_LOG2 3
117+
118 #else
119
120 #error "Unknown CPU architecture"
121
122 #endif
123
124 #ifndef HAVE_LONG_LONG
125 #define HAVE_LONG_LONG
126diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
127--- a/pr/include/md/_linux.h
128+++ b/pr/include/md/_linux.h
129@@ -54,16 +54,20 @@
130 #elif defined(__avr32__)
131 #define _PR_SI_ARCHITECTURE "avr32"
132 #elif defined(__m32r__)
133 #define _PR_SI_ARCHITECTURE "m32r"
134 #elif defined(__nios2__)
135 #define _PR_SI_ARCHITECTURE "nios2"
136 #elif defined(__or1k__)
137 #define _PR_SI_ARCHITECTURE "or1k"
138+#elif defined(__riscv) && (__riscv_xlen == 32)
139+#define _PR_SI_ARCHITECTURE "riscv32"
140+#elif defined(__riscv) && (__riscv_xlen == 64)
141+#define _PR_SI_ARCHITECTURE "riscv64"
142 #else
143 #error "Unknown CPU architecture"
144 #endif
145 #define PR_DLL_SUFFIX ".so"
146
147 #define _PR_VMBASE 0x30000000
148 #define _PR_STACK_VMBASE 0x50000000
149 #define _MD_DEFAULT_STACK_SIZE 65536L
150
diff --git a/meta/recipes-support/nspr/nspr_4.19.bb b/meta/recipes-support/nspr/nspr_4.19.bb
index de2c87131f..b43c78081d 100644
--- a/meta/recipes-support/nspr/nspr_4.19.bb
+++ b/meta/recipes-support/nspr/nspr_4.19.bb
@@ -11,6 +11,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz
11 file://remove-srcdir-from-configure-in.patch \ 11 file://remove-srcdir-from-configure-in.patch \
12 file://0002-Add-nios2-support.patch \ 12 file://0002-Add-nios2-support.patch \
13 file://0001-md-Fix-build-with-musl.patch \ 13 file://0001-md-Fix-build-with-musl.patch \
14 file://0003-Add-type-definitions-for-the-RISC-V-architecture.patch \
14 file://nspr.pc.in \ 15 file://nspr.pc.in \
15" 16"
16 17