[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] xif inline patches



Hi,

when I tried to compile whole freemint kernel against gcc 4.3.2 I found
some errors with inline asm routines which doesn't appear in gcc 2.95 so
here's the fix. Thanks to Vincent for idea how to fix it in a quick and
elegant way :)

-- 
MiKRO / Mystic Bytes
http://mikro.atari.org

Index: sys/sockets/inet4/tcputil.c
===================================================================
RCS file: /mint/freemint/sys/sockets/inet4/tcputil.c,v
retrieving revision 1.4
diff -u -r1.4 tcputil.c
--- sys/sockets/inet4/tcputil.c	13 Jul 2007 21:32:52 -0000	1.4
+++ sys/sockets/inet4/tcputil.c	14 Nov 2008 15:35:49 -0000
@@ -431,28 +431,28 @@
 		"clrl	d0		\n\t"
 		"movew	%2, d1		\n\t"
 		"lsrw	#4, d1		\n\t"
-		"beq	l4		\n\t"
+		"beq	4f		\n\t"
 		"subqw	#1, d1		\n"	/* clears X bit */
-		"l1:			\n\t"
+		"1:			\n\t"
 		"moveml	%4@+, d0/d2-d4	\n\t"	/* 16 byte loop */
 		"addxl	d0, %0		\n\t"	/* ~5 clock ticks per byte */
 		"addxl	d2, %0		\n\t"
 		"addxl	d3, %0		\n\t"
 		"addxl	d4, %0		\n\t"
-		"dbra	d1, l1		\n\t"
+		"dbra	d1, 1b		\n\t"
 		"clrl	d0		\n\t"
 		"addxl	d0, %0		\n"
-		"l4:			\n\t"
+		"4:			\n\t"
 		"movew	%2, d1		\n\t"
 		"andiw	#0xf, d1	\n\t"
 		"lsrw	#2, d1		\n\t"
-		"beq	l2		\n\t"
+		"beq	2f		\n\t"
 		"subqw	#1, d1		\n"
-		"l3:			\n\t"
+		"3:			\n\t"
 		"addl	%4@+, %0	\n\t"	/* 4 byte loop */
 		"addxl	d0, %0		\n\t"	/* ~10 clock ticks per byte */
-		"dbra	d1, l3		\n"
-		"l2:			\n\t"
+		"dbra	d1, 3b		\n"
+		"2:			\n\t"
 		: "=d"(sum), "=a"(dgram)
 		: "g"(len), "0"(sum), "1"(dgram)
 		: "d0", "d1", "d2", "d3", "d4"
@@ -466,17 +466,17 @@
 	(
 		"clrl	d0		\n\t"
 		"btst	#1, %2		\n\t"
-		"beq	l5		\n\t"
+		"beq	5f		\n\t"
 		"addw	%4@+, %0	\n\t"	/* extra word */
 		"addxw	d0, %0		\n"
-		"l5:			\n\t"
+		"5:			\n\t"
 		"btst	#0, %2		\n\t"
-		"beq	l6		\n\t"
+		"beq	6f		\n\t"
 		"moveb	%4@+, d1	\n\t"	/* extra byte */
 		"lslw	#8, d1		\n\t"
 		"addw	d1, %0		\n\t"
 		"addxw	d0, %0		\n"
-		"l6:			\n\t"
+		"6:			\n\t"
 		"movel	%0, d1		\n\t"	/* convert to short */
 		"swap	d1		\n\t"
 		"addw	d1, %0		\n\t"
Index: sys/sockets/inet4/udp.c
===================================================================
RCS file: /mint/freemint/sys/sockets/inet4/udp.c,v
retrieving revision 1.7
diff -u -r1.7 udp.c
--- sys/sockets/inet4/udp.c	25 Nov 2003 19:06:20 -0000	1.7
+++ sys/sockets/inet4/udp.c	14 Nov 2008 15:35:50 -0000
@@ -515,28 +515,28 @@
 		"clrl	d0		\n\t"
 		"movew	%2, d1		\n\t"
 		"lsrw	#4, d1		\n\t"
-		"beq	l4		\n\t"
+		"beq	4f		\n\t"
 		"subqw	#1, d1		\n"	/* clears X bit */
-		"l1:			\n\t"
+		"1:			\n\t"
 		"moveml	%4@+, d0/d2-d4	\n\t"	/* 16 byte loop */
 		"addxl	d0, %0		\n\t"	/* ~5 clock ticks per byte */
 		"addxl	d2, %0		\n\t"
 		"addxl	d3, %0		\n\t"
 		"addxl	d4, %0		\n\t"
-		"dbra	d1, l1		\n\t"
+		"dbra	d1, 1b		\n\t"
 		"clrl	d0		\n\t"
 		"addxl	d0, %0		\n"
-		"l4:			\n\t"
+		"4:			\n\t"
 		"movew	%2, d1		\n\t"
 		"andiw	#0xf, d1	\n\t"
 		"lsrw	#2, d1		\n\t"
-		"beq	l2		\n\t"
+		"beq	2f		\n\t"
 		"subqw	#1, d1		\n"
-		"l3:			\n\t"
+		"3:			\n\t"
 		"addl	%4@+, %0	\n\t"	/* 4 byte loop */
 		"addxl	d0, %0		\n\t"	/* ~10 clock ticks per byte */
-		"dbra	d1, l3		\n"
-		"l2:			\n\t"
+		"dbra	d1, 3b		\n"
+		"2:			\n\t"
 		: "=d"(sum), "=a"(dgram)
 		: "g"(len), "0"(sum), "1"(dgram)
 		: "d0", "d1", "d2", "d3", "d4"
@@ -550,17 +550,17 @@
 	(
 		"clrl	d0		\n\t"
 		"btst	#1, %2		\n\t"
-		"beq	l5		\n\t"
+		"beq	5f		\n\t"
 		"addw	%4@+, %0	\n\t"	/* extra word */
 		"addxw	d0, %0		\n"
-		"l5:			\n\t"
+		"5:			\n\t"
 		"btst	#0, %2		\n\t"
-		"beq	l6		\n\t"
+		"beq	6f		\n\t"
 		"moveb	%4@+, d1	\n\t"	/* extra byte */
 		"lslw	#8, d1		\n\t"
 		"addw	d1, %0		\n\t"
 		"addxw	d0, %0		\n"
-		"l6:			\n\t"
+		"6:			\n\t"
 		"movel	%0, d1		\n\t"	/* convert to short */
 		"swap	d1		\n\t"
 		"addw	d1, %0		\n\t"
Index: sys/sockets/xif/de600.h
===================================================================
RCS file: /mint/freemint/sys/sockets/xif/de600.h,v
retrieving revision 1.1
diff -u -r1.1 de600.h
--- sys/sockets/xif/de600.h	29 Jun 2000 21:07:22 -0000	1.1
+++ sys/sockets/xif/de600.h	14 Nov 2008 15:35:50 -0000
@@ -249,12 +249,12 @@
 		"moveb	%2@(18), d0	\n"
 		"lsrb	#4, d0		\n"
 		"subqw	#2, %0		\n"
-		"l1:			\n"
+		"1:			\n"
 		"orb	%2@(2), d0	\n"
 		"moveb	d0, %1@+	\n"
 		"moveb	%2@(18), d0	\n"
 		"lsrb	#4, d0		\n"
-		"dbra	%0, l1		\n"
+		"dbra	%0, 1b		\n"
 		"orb	%2@(18), d0	\n"
 		"moveb	d0, %1@		\n"
 		: "=d"(len), "=a"(cp)
@@ -272,7 +272,7 @@
 {
 	__asm__ volatile (
 		"subqw	#1, %0		\n"
-		"l2:			\n"
+		"2:			\n"
 		"moveb	%1@+, d0	\n"
 		"addw	d0, d0		\n"
 		"movew	d0, d1		\n"
@@ -282,7 +282,7 @@
 		"andw	%5, d0		\n"
 		"bset	#4, d0		\n"
 		"tstb	%2@(d0:w)	\n"
-		"dbra	%0, l2		\n"
+		"dbra	%0, 2b		\n"
 		: "=d"(len), "=a"(cp)
 		: "a"(de600_base), "0"(len), "1"(cp), "d"(0x1e0)
 		: "d0", "d1");