summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch')
-rw-r--r--meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch96
1 files changed, 96 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch b/meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch
new file mode 100644
index 0000000000..3d1bbd31a7
--- /dev/null
+++ b/meta-oe/recipes-support/nspr/nspr/0003-Add-nios2-support.patch
@@ -0,0 +1,96 @@
1From 09a67d3945f1fde8372532ef2e19af20db2112cd Mon Sep 17 00:00:00 2001
2From: Marek Vasut <marex@denx.de>
3Date: Sat, 30 Jan 2016 07:18:02 +0100
4Subject: [PATCH] Add nios2 support
5
6Add support for the nios2 CPU.
7
8Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1244421 ]
9
10Signed-off-by: Marek Vasut <marex@denx.de>
11---
12 pr/include/md/_linux.cfg | 45 ++++++++++++++++++++++++++++++++++++++++
13 pr/include/md/_linux.h | 4 +++-
14 2 files changed, 48 insertions(+), 1 deletion(-)
15
16diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
17index 009d5e5..77c13df 100644
18--- a/pr/include/md/_linux.cfg
19+++ b/pr/include/md/_linux.cfg
20@@ -979,6 +979,51 @@
21 #define PR_BYTES_PER_WORD_LOG2 2
22 #define PR_BYTES_PER_DWORD_LOG2 3
23
24+#elif defined(__nios2__)
25+
26+#define IS_LITTLE_ENDIAN 1
27+#undef IS_BIG_ENDIAN
28+
29+#define PR_BYTES_PER_BYTE 1
30+#define PR_BYTES_PER_SHORT 2
31+#define PR_BYTES_PER_INT 4
32+#define PR_BYTES_PER_INT64 8
33+#define PR_BYTES_PER_LONG 4
34+#define PR_BYTES_PER_FLOAT 4
35+#define PR_BYTES_PER_DOUBLE 8
36+#define PR_BYTES_PER_WORD 4
37+#define PR_BYTES_PER_DWORD 8
38+
39+#define PR_BITS_PER_BYTE 8
40+#define PR_BITS_PER_SHORT 16
41+#define PR_BITS_PER_INT 32
42+#define PR_BITS_PER_INT64 64
43+#define PR_BITS_PER_LONG 32
44+#define PR_BITS_PER_FLOAT 32
45+#define PR_BITS_PER_DOUBLE 64
46+#define PR_BITS_PER_WORD 32
47+
48+#define PR_BITS_PER_BYTE_LOG2 3
49+#define PR_BITS_PER_SHORT_LOG2 4
50+#define PR_BITS_PER_INT_LOG2 5
51+#define PR_BITS_PER_INT64_LOG2 6
52+#define PR_BITS_PER_LONG_LOG2 5
53+#define PR_BITS_PER_FLOAT_LOG2 5
54+#define PR_BITS_PER_DOUBLE_LOG2 6
55+#define PR_BITS_PER_WORD_LOG2 5
56+
57+#define PR_ALIGN_OF_SHORT 2
58+#define PR_ALIGN_OF_INT 4
59+#define PR_ALIGN_OF_LONG 4
60+#define PR_ALIGN_OF_INT64 4
61+#define PR_ALIGN_OF_FLOAT 4
62+#define PR_ALIGN_OF_DOUBLE 4
63+#define PR_ALIGN_OF_POINTER 4
64+#define PR_ALIGN_OF_WORD 4
65+
66+#define PR_BYTES_PER_WORD_LOG2 2
67+#define PR_BYTES_PER_DWORD_LOG2 3
68+
69 #elif defined(__or1k__)
70
71 #undef IS_LITTLE_ENDIAN
72diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
73index ad57d08..45a2231 100644
74--- a/pr/include/md/_linux.h
75+++ b/pr/include/md/_linux.h
76@@ -55,6 +55,8 @@
77 #define _PR_SI_ARCHITECTURE "avr32"
78 #elif defined(__m32r__)
79 #define _PR_SI_ARCHITECTURE "m32r"
80+#elif defined(__nios2__)
81+#define _PR_SI_ARCHITECTURE "nios2"
82 #elif defined(__or1k__)
83 #define _PR_SI_ARCHITECTURE "or1k"
84 #elif defined(__riscv) && (__riscv_xlen == 32)
85@@ -143,7 +145,7 @@ extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval);
86 #define _MD_ATOMIC_SET _PR_x86_64_AtomicSet
87 #endif
88
89-#if defined(__loongarch__)
90+#if defined(__loongarch__) || defined(__nios2__)
91 #if defined(__GNUC__)
92 /* Use GCC built-in functions */
93 #define _PR_HAVE_ATOMIC_OPS
94--
952.25.1
96