summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-18 16:47:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-18 16:47:54 +0000
commit6dcf06ec7f2275a65b734f1226e09de1a4e5deb3 (patch)
treeebc4f39ee7b7141d95f932adead1ce0b5d068851 /c/src/lib/libbsp/m68k
parent2008-08-18 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-6dcf06ec7f2275a65b734f1226e09de1a4e5deb3.tar.bz2
2008-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, console/console.c: Split debug IO code into separate file. * console/debugio.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/m68k')
-rw-r--r--c/src/lib/libbsp/m68k/mcf52235/ChangeLog6
-rw-r--r--c/src/lib/libbsp/m68k/mcf52235/Makefile.am3
-rw-r--r--c/src/lib/libbsp/m68k/mcf52235/console/console.c38
-rw-r--r--c/src/lib/libbsp/m68k/mcf52235/console/debugio.c32
4 files changed, 40 insertions, 39 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf52235/ChangeLog b/c/src/lib/libbsp/m68k/mcf52235/ChangeLog
index 28102b19cb..c9c8f8c8a4 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/ChangeLog
+++ b/c/src/lib/libbsp/m68k/mcf52235/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, console/console.c: Split debug IO code into separate
+ file.
+ * console/debugio.c: New file.
+
2008-06-19 Matthew Riek <matthew.riek@ibiscomputer.com.au>
* startup/cfinit.c, startup/init52235.c: Missed the last patch.
diff --git a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
index 468ebbb2b9..4bd8555479 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
@@ -35,6 +35,7 @@ startup_SOURCES = startup/bspclean.c ../../shared/bsppredriverhook.c \
../../shared/gnatinstallhandler.c
clock_SOURCES = clock/clock.c
console_SOURCES = console/console.c
+debugio_SOURCES = console/debugio.c
timer_SOURCES = timer/timer.c
#if HAS_NETWORKING
@@ -48,7 +49,7 @@ timer_SOURCES = timer/timer.c
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
- $(timer_SOURCES)
+ $(debugio_SOURCES) $(timer_SOURCES)
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
diff --git a/c/src/lib/libbsp/m68k/mcf52235/console/console.c b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
index b99f127109..94cdf52a1e 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
@@ -25,23 +25,6 @@
static int IntUartPollWrite(int minor, const char *buf, int len);
static int IntUartInterruptWrite(int minor, const char *buf, int len);
-static void _BSP_null_char(char c)
-{
- int level;
-
- if (c == '\n')
- _BSP_null_char('\r');
- rtems_interrupt_disable(level);
- while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
- continue;
- MCF_UART_UTB(CONSOLE_PORT) = c;
- while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
- continue;
- rtems_interrupt_enable(level);
-}
-
-BSP_output_char_function_type BSP_output_char = _BSP_null_char;
-
#define MAX_UART_INFO 3
#define RX_BUFFER_SIZE 512
@@ -670,24 +653,3 @@ rtems_device_driver console_control(rtems_device_major_number major,
{
return (rtems_termios_ioctl(arg));
}
-int DEBUG_OUTCHAR(int c)
-{
- if (c == '\n')
- DEBUG_OUTCHAR('\r');
- _BSP_null_char(c);
- return c;
-}
-void DEBUG_OUTSTR(const char *msg)
-{
- while (*msg)
- DEBUG_OUTCHAR(*msg++);
-}
-void DEBUG_OUTNUM(int i)
-{
- int n;
- static const char map[] = "0123456789ABCDEF";
-
- DEBUG_OUTCHAR(' ');
- for (n = 28; n >= 0; n -= 4)
- DEBUG_OUTCHAR(map[(i >> n) & 0xF]);
-}
diff --git a/c/src/lib/libbsp/m68k/mcf52235/console/debugio.c b/c/src/lib/libbsp/m68k/mcf52235/console/debugio.c
new file mode 100644
index 0000000000..7d59c66569
--- /dev/null
+++ b/c/src/lib/libbsp/m68k/mcf52235/console/debugio.c
@@ -0,0 +1,32 @@
+ /*
+ * Multi UART console serial I/O.
+ *
+ * TO DO: Add DMA input/output
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <rtems/libio.h>
+#include <rtems/termiostypes.h>
+#include <termios.h>
+#include <bsp.h>
+#include <malloc.h>
+#include <rtems/mw_uid.h>
+
+#include <rtems/bspIo.h>
+
+static void _BSP_null_char(char c)
+{
+ int level;
+
+ rtems_interrupt_disable(level);
+ while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
+ continue;
+ MCF_UART_UTB(CONSOLE_PORT) = c;
+ while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
+ continue;
+ rtems_interrupt_enable(level);
+}
+
+BSP_output_char_function_type BSP_output_char = _BSP_null_char;
+