[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] MiNTLib for ColdFire
Sorry, I forgot the attached file.
--
Vincent Rivière
diff -aurN -x CVS mintlib.orig/ChangeLog mintlib/ChangeLog
--- mintlib.orig/ChangeLog 2009-05-18 20:54:50.531250000 +0200
+++ mintlib/ChangeLog 2009-05-18 20:51:54.984375000 +0200
@@ -1,3 +1,10 @@
+2009-05-18 Monday 20:51 Vincent Riviere <vincent.riviere@freesbee.fr>
+
+ * mintlib/include/compiler.h, mintlib/include/macros.h,
+ mintlib/include/mint/linea.h, mintlib/mintlib/linea.c
+
+ Added ColdFire support for all the C files.
+
2009-05-18 Monday 18:44 Vincent Riviere <vincent.riviere@freesbee.fr>
* mint/mintbind.h, mint/osbind.h, mintlib/setjmp.S, syscall/traps.c
diff -aurN -x CVS mintlib.orig/include/compiler.h mintlib/include/compiler.h
--- mintlib.orig/include/compiler.h 2005-12-06 20:27:53.000000000 +0100
+++ mintlib/include/compiler.h 2009-05-18 20:47:59.718750000 +0200
@@ -62,6 +62,26 @@
# define __CLOBBER_RETURN(a) a,
#endif
+#ifdef __mcoldfire__
+
+#define PUSH_SP(regs,size) \
+ "lea sp@(-" #size "),sp\n\t" \
+ "movml " regs ",sp@\n\t"
+
+#define POP_SP(regs,size) \
+ "movml sp@," regs "\n\t" \
+ "lea sp@(" #size "),sp\n\t"
+
+#else
+
+#define PUSH_SP(regs,size) \
+ "movml " regs ",sp@-\n\t"
+
+#define POP_SP(regs,size) \
+ "movml sp@+," regs "\n\t"
+
+#endif
+
#endif /* __GNUC__ */
/* some default declarations */
diff -aurN -x CVS mintlib.orig/include/macros.h mintlib/include/macros.h
--- mintlib.orig/include/macros.h 2009-05-17 18:13:06.156250000 +0200
+++ mintlib/include/macros.h 2009-05-18 19:59:03.828125000 +0200
@@ -64,7 +64,7 @@
The same macros are available with a 1 appended. Semantics are
the same except that offset is always 1. */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__mcoldfire__)
#define ROLL(offset, x) \
({ unsigned long __arg = (x); \
__asm__ ("roll %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
diff -aurN -x CVS mintlib.orig/include/mint/linea.h mintlib/include/mint/linea.h
--- mintlib.orig/include/mint/linea.h 2009-05-17 18:13:06.250000000 +0200
+++ mintlib/include/mint/linea.h 2009-05-18 19:59:03.828125000 +0200
@@ -849,10 +849,10 @@
({ \
__asm__ volatile \
( \
- "movml d2/a2/a6,sp@-\n\t" \
+ PUSH_SP("d2/a2/a6", 12) \
"movl %0,a6\n\t" \
".word 0xA007\n\t" \
- "movml sp@+,d2/a2/a6" \
+ POP_SP("d2/a2/a6", 12) \
: /* outputs */ \
: "r"(P) /* inputs */ \
: "d0", "d1", "a0", "a1" /* clobbered regs */ \
diff -aurN -x CVS mintlib.orig/mintlib/linea.c mintlib/mintlib/linea.c
--- mintlib.orig/mintlib/linea.c 2009-05-17 18:13:06.562500000 +0200
+++ mintlib/mintlib/linea.c 2009-05-18 19:59:03.843750000 +0200
@@ -99,10 +99,10 @@
{
__asm__ volatile
(
- "movml d2/a2/a6, sp@-\n\t"
+ PUSH_SP("d2/a2/a6", 12)
"movl %0,a6\n\t"
".word 0xA007\n\t"
- "movml sp@+, d2/a2/a6"
+ POP_SP("d2/a2/a6", 12)
: /* outputs */
: "r"(P) /* inputs */
: "d0", "d1", "a0", "a1" /* clobbered regs */