File: 002_gcc34.patch

package info (click to toggle)
proll 18-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,012 kB
  • ctags: 3,459
  • sloc: ansic: 12,161; asm: 2,313; makefile: 546
file content (347 lines) | stat: -rw-r--r-- 8,875 bytes parent folder | download
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
#DPATCHLEVEL=1
diff -Naur proll-18.orig/src/hme.c proll-18/src/hme.c
--- proll-18.orig/src/hme.c	2002-07-23 08:52:52.000000000 +0300
+++ proll-18/src/hme.c	2005-04-06 22:10:02.000000000 +0300
@@ -655,10 +655,10 @@
 				    unsigned int flags,
 				    unsigned int addr)
 {
-	__asm__ __volatile__("
-	stwa	%3, [%0] %2
-	stwa	%4, [%1] %2
-"	: /* no outputs */
+	__asm__ __volatile__(
+	"stwa	%3, [%0] %2\n\t"
+	"stwa	%4, [%1] %2\n\t"
+	: /* no outputs */
 	: "r" (&rp->rx_addr), "r" (&rp->rx_flags),
 	  "i" (ASI_PL), "r" (addr), "r" (flags));
 }
@@ -667,10 +667,10 @@
 				    unsigned int flags,
 				    unsigned int addr)
 {
-	__asm__ __volatile__("
-	stwa	%3, [%0] %2
-	stwa	%4, [%1] %2
-"	: /* no outputs */
+	__asm__ __volatile__(
+	"stwa	%3, [%0] %2\n\t"
+	"stwa	%4, [%1] %2\n\t"
+	: /* no outputs */
 	: "r" (&tp->tx_addr), "r" (&tp->tx_flags),
 	  "i" (ASI_PL), "r" (addr), "r" (flags));
 }
@@ -2404,7 +2404,7 @@
 		TXD(("[%d]", elem));
 		this = &txbase[elem];
 #ifdef  __sparc_v9__
-		__asm__ __volatile__("lduwa [%1] %2, %0"
+		__asm__ __volatile__("lduwa [%1] %2, %0\n\t"
 				     : "=r" (flags)
 				     : "r" (&this->tx_flags), "i" (ASI_PL));
 #else
@@ -2447,7 +2447,7 @@
 	RXD(("RX<"));
 	this = &rxbase[elem];
 #ifdef  __sparc_v9__
-	__asm__ __volatile__("lduwa [%1] %2, %0"
+	__asm__ __volatile__("lduwa [%1] %2, %0\n\t"
 			     : "=r" (flags)
 			     : "r" (&this->rx_flags), "i" (ASI_PL));
 #else
@@ -2530,7 +2530,7 @@
 		elem = NEXT_RX(elem);
 		this = &rxbase[elem];
 #ifdef __sparc_v9__ 
-		__asm__ __volatile__("lduwa [%1] %2, %0"
+		__asm__ __volatile__("lduwa [%1] %2, %0\n\t"
 				     : "=r" (flags)
 				     : "r" (&this->rx_flags), "i" (ASI_PL));
 #else
diff -Naur proll-18.orig/src/le.c proll-18/src/le.c
--- proll-18.orig/src/le.c	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/src/le.c	2005-04-06 22:10:02.000000000 +0300
@@ -769,7 +769,7 @@
 	/* Clear the slack of the packet, do I need this? */
 	/* For a firewall its a good idea - AC */
 	if (len != skblen)
-		bzero((char *) &ib->tx_buf [entry][skblen], len - skblen);
+		memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen);
     
 	/* Now, give the packet to the lance */
 	ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
diff -Naur proll-18.orig/src/rconsole.c proll-18/src/rconsole.c
--- proll-18.orig/src/rconsole.c	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/src/rconsole.c	2005-04-06 22:10:02.000000000 +0300
@@ -52,18 +52,18 @@
 #endif
 
 static __inline__ void stfb_w(void *ptr, unsigned int data) {
-	__asm__ __volatile__ ("sta %0, [%1] %2" : :
+	__asm__ __volatile__ ("sta %0, [%1] %2\n\t" : :
 				"r" (data), "r" (ptr), "i" (ASI_M_BYPASS));
 }
 
 static __inline__ void stfb_b(void *ptr, unsigned int data) {
-	__asm__ __volatile__ ("stba %0, [%1] %2" : :
+	__asm__ __volatile__ ("stba %0, [%1] %2\n\t" : :
 				"r" (data), "r" (ptr), "i" (ASI_M_BYPASS));
 }
 
 static __inline__ unsigned int ldfb_w(void *ptr) {
 	unsigned int data;
-	__asm__ __volatile__ ("lda [%1] %2, %0" :
+	__asm__ __volatile__ ("lda [%1] %2, %0\n\t" :
 				"=r" (data) :
 				"r" (ptr), "i" (ASI_M_BYPASS));
 	return data;
@@ -71,7 +71,7 @@
 
 static __inline__ unsigned int ldfb_b(void *ptr) {
 	unsigned int data;
-	__asm__ __volatile__ ("lduba [%1] %2, %0" :
+	__asm__ __volatile__ ("lduba [%1] %2, %0\n\t" :
 				"=r" (data) :
 				"r" (ptr), "i" (ASI_M_BYPASS));
 	return data;
diff -Naur proll-18.orig/src/romlib.h proll-18/src/romlib.h
--- proll-18.orig/src/romlib.h	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/src/romlib.h	2005-04-06 22:10:02.000000000 +0300
@@ -27,6 +27,8 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <sys/types.h>
+
 
 /*
  **************************************************************************
@@ -72,10 +74,9 @@
  */
 #define memcpy(dst, src, len)	bcopy(src, dst, len)
 #define memcmp(x1, x2, len)	bcmp(x1, x2, len)
-#define memset(p, len, zero)	bzero(p, len)
 extern void bcopy(const void *b1, void *b2, int length);
 extern int  bcmp(const void *b1, const void *b2, int length);
-extern void bzero(void *b, int c);
+extern void *memset(void *p, int c, size_t len);
 /* gcc complains about "conflicting types for builtin function strlen". */
 #define strlen(s)		ssize(s)
 extern int ssize(const char *s);
diff -Naur proll-18.orig/src/system.c proll-18/src/system.c
--- proll-18.orig/src/system.c	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/src/system.c	2005-04-06 22:10:02.000000000 +0300
@@ -507,19 +507,30 @@
 {
 	char *p;
 
-	if ((p = mem_alloc(t, size, align)) != 0) bzero(p, size);
+	if ((p = mem_alloc(t, size, align)) != 0) memset(p, 0, size);
 	return p;
 }
 
 /*
  * Library functions
  */
-void bzero(void *s, int len) {
-	while (len--) *((char *)s)++ = 0;
+void *memset(void *s, int c, size_t len)
+{
+	void *p = s;
+
+	while (len--) {
+		*(char *)s = c;
+		s++;
+	}
+	return p;
 }
 
 void bcopy(const void *f, void *t, int len) {
-	while (len--) *((char *)t)++ = *((char *)f)++;
+	while (len--) {
+		*(char *)t = *(char *)f;
+		f++;
+		t++;
+	}
 }
 
 /* Comparison is 7-bit */
@@ -529,8 +540,11 @@
 	char ch;
 
 	while (len--) {
-		ch = *((char *)s1)++;
-		if ((i = ch - *((char *)s2)++) != 0)
+		ch = *(char *)s1;
+		i = ch - *(char *)s2;
+		s1++;
+		s2++;
+		if (i != 0)
 			return i;
 		if (ch == 0)
 			return 0;
diff -Naur proll-18.orig/qemu/system_qemu.c proll-18/qemu/system_qemu.c
--- proll-18.orig/qemu/system_qemu.c	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/qemu/system_qemu.c	2005-04-06 22:25:40.000000000 +0300
@@ -324,19 +324,30 @@
 {
 	char *p;
 
-	if ((p = mem_alloc(t, size, align)) != 0) bzero(p, size);
+	if ((p = mem_alloc(t, size, align)) != 0) memset(p, 0, size);
 	return p;
 }
 
 /*
  * Library functions
  */
-void bzero(void *s, int len) {
-	while (len--) *((char *)s)++ = 0;
+void *memset(void *s, int c, size_t len)
+{
+	void *p = s;
+
+	while (len--) {
+		*(char *)s = c;
+		s++;
+	}
+	return p;
 }
 
 void bcopy(const void *f, void *t, int len) {
-	while (len--) *((char *)t)++ = *((char *)f)++;
+	while (len--) {
+		*(char *)t = *(char *)f;
+		f++;
+		t++;
+	}
 }
 
 /* Comparison is 7-bit */
@@ -346,8 +357,11 @@
 	char ch;
 
 	while (len--) {
-		ch = *((char *)s1)++;
-		if ((i = ch - *((char *)s2)++) != 0)
+		ch = *(char *)s1;
+		i = ch - *(char *)s2;
+		s1++;
+		s2++;
+		if (i != 0)
 			return i;
 		if (ch == 0)
 			return 0;
diff -Naur proll-18.orig/src/system.h proll-18/src/system.h
--- proll-18.orig/src/system.h	2005-04-06 22:27:27.000000000 +0300
+++ proll-18/src/system.h	2005-04-06 22:10:02.000000000 +0300
@@ -164,10 +164,10 @@
 
 extern __inline__ void setipl(unsigned long __orig_psr)
 {
-	__asm__ __volatile__("
-		wr	%0, 0x0, %%psr
-		nop; nop; nop
-"		: /* no outputs */
+	__asm__ __volatile__(
+		"wr	%0, 0x0, %%psr\n\t"
+		"nop; nop; nop\n\t"
+		: /* no outputs */
 		: "r" (__orig_psr)
 		: "memory", "cc");
 }
@@ -176,13 +176,13 @@
 {
 	unsigned long tmp;
 
-	__asm__ __volatile__("
-		rd	%%psr, %0
-		nop; nop; nop;		/* Sun4m + Cypress + SMP bug */
-		or	%0, %1, %0
-		wr	%0, 0x0, %%psr
-		nop; nop; nop
-"		: "=r" (tmp)
+	__asm__ __volatile__(
+		"rd	%%psr, %0\n\t"
+		"nop; nop; nop;\n\t"	/* Sun4m + Cypress + SMP bug */
+		"or	%0, %1, %0\n\t"
+		"wr	%0, 0x0, %%psr\n\t"
+		"nop; nop; nop\n\t"
+		: "=r" (tmp)
 		: "i" (PSR_PIL)
 		: "memory");
 }
@@ -191,13 +191,13 @@
 {
 	unsigned long tmp;
 
-	__asm__ __volatile__("
-		rd	%%psr, %0	
-		nop; nop; nop;		/* Sun4m + Cypress + SMP bug */
-		andn	%0, %1, %0
-		wr	%0, 0x0, %%psr
-		nop; nop; nop
-"		: "=r" (tmp)
+	__asm__ __volatile__(
+		"rd	%%psr, %0\n\t"
+		"nop; nop; nop;\n\t"	/* Sun4m + Cypress + SMP bug */
+		"andn	%0, %1, %0\n\t"
+		"wr	%0, 0x0, %%psr\n\t"
+		"nop; nop; nop\n\t"
+		: "=r" (tmp)
 		: "i" (PSR_PIL)
 		: "memory");
 }
@@ -214,18 +214,18 @@
 {
 	unsigned long retval;
 
-	__asm__ __volatile__("
-		rd	%%psr, %0
-		nop; nop; nop;		/* Sun4m + Cypress + SMP bug */
-		and	%0, %2, %%g1
-		and	%1, %2, %%g2
-		xorcc	%%g1, %%g2, %%g0
-		be	1f
-		 nop
-		wr	%0, %2, %%psr
-		nop; nop; nop;
-1:
-"		: "=r" (retval)
+	__asm__ __volatile__(
+		"rd	%%psr, %0\n\t"
+		"nop; nop; nop;\n\t"	/* Sun4m + Cypress + SMP bug */
+		"and	%0, %2, %%g1\n\t"
+		"and	%1, %2, %%g2\n\t"
+		"xorcc	%%g1, %%g2, %%g0\n\t"
+		"be	1f\n\t"
+		"nop\n\t"
+		"wr	%0, %2, %%psr\n\t"
+		"nop; nop; nop;\n\t"
+		"1:\n\t"
+		: "=r" (retval)
 		: "r" (__new_psr), "i" (PSR_PIL)
 		: "g1", "g2", "memory", "cc");
 
@@ -236,13 +236,13 @@
 {
 	unsigned long retval;
 
-	__asm__ __volatile__("
-		rd	%%psr, %0
-		nop; nop; nop;		/* Sun4m + Cypress + SMP bug */
-		or	%0, %1, %%g1
-		wr	%%g1, 0x0, %%psr
-		nop; nop; nop
-"		: "=r" (retval)
+	__asm__ __volatile__(
+		"rd	%%psr, %0\n\t"
+		"nop; nop; nop;\n\t"	/* Sun4m + Cypress + SMP bug */
+		"or	%0, %1, %%g1\n\t"
+		"wr	%%g1, 0x0, %%psr\n\t"
+		"nop; nop; nop\n\t"
+		: "=r" (retval)
 		: "i" (PSR_PIL)
 		: "g1", "memory");