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

Re: [MiNT] FreeMiNT for ColdFire : lp.xdd



Here are the ColdFire patches for lp.xdd.

There are 2 steps:

1) Please rename sys/xdd/lp/centr.s with a capital .S extension. In the same time, apply lp1.patch. Then commit with:
Added preprocessor support. Contributed by Vincent Riviere.

2) lp2.patch
Added ColdFire support. Contributed by Vincent Riviere.

Alan, please commit!

--
Vincent Rivière
diff -aurN -x CVS -x .deps freemint.orig/sys/xdd/lp/Makefile freemint/sys/xdd/lp/Makefile
--- freemint.orig/sys/xdd/lp/Makefile	2004-03-30 22:02:43.000000000 +0200
+++ freemint/sys/xdd/lp/Makefile	2011-05-24 22:18:32.578125000 +0200
@@ -27,7 +27,7 @@
 CPU = 000
 
 # default definitions
-OBJS = $(COBJS:.c=.o) $(SOBJS:.s=.o)
+OBJS = $(COBJS:.c=.o) $(SOBJS:.S=.o)
 
 $(TARGET): $(OBJS) $(LIBKERNTARGET)
 	$(LD) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
diff -aurN -x CVS -x .deps freemint.orig/sys/xdd/lp/SRCFILES freemint/sys/xdd/lp/SRCFILES
--- freemint.orig/sys/xdd/lp/SRCFILES	2003-06-17 23:25:49.000000000 +0200
+++ freemint/sys/xdd/lp/SRCFILES	2011-05-24 22:27:35.343750000 +0200
@@ -3,6 +3,6 @@
 
 HEADER = lp.h
 COBJS = lp.c
-SOBJS = centr.s
+SOBJS = centr.S
 
 SRCFILES = $(HEADER) $(COBJS) $(SOBJS)
diff -aurN -x CVS -x .deps freemint.orig/sys/xdd/lp/centr.S freemint/sys/xdd/lp/centr.S
--- freemint.orig/sys/xdd/lp/centr.S	2003-06-17 23:25:49.000000000 +0200
+++ freemint/sys/xdd/lp/centr.S	2011-05-24 22:34:50.812500000 +0200
@@ -8,17 +8,36 @@
 	.globl _print_byte
 
 _new_centr_vector:
+#ifdef __mcoldfire__
+	lea	sp@(-16), sp
+	moveml	d0-d1/a0-a1, sp@
+#else
 	moveml	d0-d1/a0-a1, sp@-
+#endif
 	jsr	_print_head		| prints the pending byte(s)
 	jsr	_wake_up		| has someone selected the printer?
+#ifdef __mcoldfire__
+	moveql	#0, d0
+	bclr	d0, 0xFFFFFA11
+	moveml	sp@, d0-d1/a0-a1
+	lea	sp@(16), sp
+#else
 	moveml	sp@+, d0-d1/a0-a1
 	bclr	#0, 0xFFFFFA11
+#endif
 	rte
 	
 _print_byte:
 	movew	sp@(4), d0		| character to print
+#ifdef __mcoldfire__
+	movew	sr, d1
+	movew	d1, sp@-
+	oril	#0x700, d1		| disable all interrupts
+	movew	d1, sr
+#else
 	movew	sr, sp@-
 	oriw	#0x700, sr		| disable all interrupts
+#endif
 	movel	#0xFFFF8800, a0
 	moveb	#15, a0@		| select port B
 	moveb	d0, a0@(2)		| and write the character
@@ -30,5 +49,10 @@
 	nop
 	bset	#5, d0
 	moveb	d0, a0@(2)		| strobe high
+#ifdef __mcoldfire__
+	movew	sp@+, d1
+	movew	d1, sr
+#else
 	movew	sp@+, sr
+#endif
 	rts