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

Re: [MiNT] FreeMiNT for ColdFire



Here is today's patch.
Now FreeMiNT does not crash on shutdown anymore.

Alan, please commit!

- coldfire.patch
Added ColdFire support. Contributed by Vincent Riviere.

--
Vincent Rivière
diff -x CVS -aurN freemint.orig/sys/mint/arch/asm_spl.h freemint/sys/mint/arch/asm_spl.h
--- freemint.orig/sys/mint/arch/asm_spl.h	2011-03-21 20:13:53.218750000 +0100
+++ freemint/sys/mint/arch/asm_spl.h	2011-03-21 23:25:32.056500000 +0100
@@ -39,20 +39,24 @@
 static inline void
 cpu_stop (void)
 {
+#ifndef COLDFIRE /* Currently buggy with FireTOS */
 	__asm__ volatile
 	(
 		"stop  #0x2000"
 	);
+#endif
 }
 
 static inline void
 cpu_lpstop (void)
 {
+#ifndef __mcoldfire__
 	/* 68060's lpstop #$2000 instruction */
 	__asm__ volatile
 	(
 		"dc.w	0xf800,0x01c0,0x2000"
 	);
+#endif
 }
 
 static inline __u16
diff -x CVS -aurN freemint.orig/sys/module.c freemint/sys/module.c
--- freemint.orig/sys/module.c	2010-01-15 20:44:34.531250000 +0100
+++ freemint/sys/module.c	2011-03-20 22:32:47.578125000 +0100
@@ -457,12 +457,12 @@
 	
 	__asm__ volatile
 	(
-		"movem.l d3-d7/a3-a6,-(sp)\r\n"
-		"move.l	%2,-(sp)\r\n"
-		"move.l	%1,a0\r\n"
-		"jsr	(a0)\r\n"
-		"addqw	#4,sp\r\n"
-		"moveml	(sp)+,d3-d7/a3-a6\r\n"
+		PUSH_SP("d3-d7/a3-a6", 36)
+		"move.l	%2,-(sp)\n\t"
+		"move.l	%1,a0\n\t"
+		"jsr	(a0)\n\t"
+		"addq.l	#4,sp\n\t"
+		POP_SP("d3-d7/a3-a6", 36)
 		: "=r"(ret)				/* outputs */
 		: "r"(initfunc), "r"(k)			/* inputs  */
 		: LOCAL_CLOBBER_LIST /* clobbered regs */
diff -x CVS -aurN freemint.orig/sys/random.c freemint/sys/random.c
--- freemint.orig/sys/random.c	2007-07-13 23:32:49.000000000 +0200
+++ freemint/sys/random.c	2011-03-20 22:34:36.234375000 +0100
@@ -462,7 +462,7 @@
 INLINE ulong
 rotate_left (int i, ulong word)
 {
-# ifdef __GNUC__
+# if defined(__GNUC__) && !defined(__mcoldfire__)
 	__asm__
 	(
 		"roll  %2,%1"