summaryrefslogtreecommitdiffstats
path: root/boot/lpc32xxcdl/lpc32xxcdl-2.11-libnosys_gnu.patch
blob: cfd77bead6fe15ac892f21db81c5a6df0c95d101 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
Fix compilation and eabi issues

Since we are not linking with libc anymore, we need to define our own memset,
strlen and memcpy. Also, as we are using a *libc compiler, we need to "handle"
exceptions (mostly division by 0) by defining raise() and
__aeabi_unwind_cpp_pr0.

Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
---
 csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c  |   41 +++++++++++++++++++++++
 csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c |   41 +++++++++++++++++++++++
 csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c |   41 +++++++++++++++++++++++
 3 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
index cfdb674..6b50c60 100644
--- a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
-- 
1.7.7.3

OpenPOWER on IntegriCloud