summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/armulator/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-31 18:29:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-31 18:29:37 +0000
commitcaf8869939b50ffc4e3e090b3572935e21327ae8 (patch)
treebd59aef32f9aeba0762726ca85aa95d54f6ce3ae /c/src/lib/libbsp/arm/armulator/console
parentPatch rtems-rc-20000713-1-cvs.diff from Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-caf8869939b50ffc4e3e090b3572935e21327ae8.tar.bz2
New bsp for simulator in gdb. Does not work yet.
Diffstat (limited to 'c/src/lib/libbsp/arm/armulator/console')
-rw-r--r--c/src/lib/libbsp/arm/armulator/console/.cvsignore2
-rw-r--r--c/src/lib/libbsp/arm/armulator/console/Makefile.am37
-rw-r--r--c/src/lib/libbsp/arm/armulator/console/console-io.c73
-rw-r--r--c/src/lib/libbsp/arm/armulator/console/mon-syscalls.S43
4 files changed, 155 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/armulator/console/.cvsignore b/c/src/lib/libbsp/arm/armulator/console/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/c/src/lib/libbsp/arm/armulator/console/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/c/src/lib/libbsp/arm/armulator/console/Makefile.am b/c/src/lib/libbsp/arm/armulator/console/Makefile.am
new file mode 100644
index 0000000000..371c0b2e36
--- /dev/null
+++ b/c/src/lib/libbsp/arm/armulator/console/Makefile.am
@@ -0,0 +1,37 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+VPATH = @srcdir@:@srcdir@/../../../shared
+
+PGM = $(ARCH)/console.rel
+
+C_FILES = console-io.c console-polled.c
+C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
+
+S_FILES =
+S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
+
+OBJS = $(C_O_FILES) $(S_O_FILES)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../../../../../../automake/lib.am
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+$(PGM): $(OBJS)
+ $(make-rel)
+
+# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
+
+all-local: $(ARCH) $(OBJS) $(PGM)
+
+.PRECIOUS: $(PGM)
+
+EXTRA_DIST = console.c
+
+include $(top_srcdir)/../../../../../../automake/local.am
diff --git a/c/src/lib/libbsp/arm/armulator/console/console-io.c b/c/src/lib/libbsp/arm/armulator/console/console-io.c
new file mode 100644
index 0000000000..da38d8d3c0
--- /dev/null
+++ b/c/src/lib/libbsp/arm/armulator/console/console-io.c
@@ -0,0 +1,73 @@
+/*
+ * This file contains the hardware specific portions of the TTY driver
+ * for the serial ports on the erc32.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+/* external prototypes for monitor interface routines */
+
+/*
+ * console_outbyte_polled
+ *
+ * This routine transmits a character using polling.
+ */
+
+extern int armulator_stdin;
+extern int armulator_stdout;
+extern int armulator_stderr;
+
+void console_outbyte_polled(
+ int port,
+ char ch
+)
+{
+ int nwritten;
+ int _swiwrite (int, char *, int);
+
+ nwritten = _swiwrite (armulator_stdout, &ch , 1);
+
+ /* error if (nwritten == -1 || nwritten == len) */
+}
+
+/*
+ * console_inbyte_nonblocking
+ *
+ * This routine polls for a character.
+ */
+
+int console_inbyte_nonblocking(
+ int port
+)
+{
+ int nread;
+ char c;
+ int _swiread (int, char *, int);
+
+ nread = _swiread (armulator_stdin, &c, 1);
+ if ( nread != 1 )
+ return -1;
+
+ return c;
+}
+
+#include <bspIo.h>
+
+void Armulator_BSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+
+BSP_output_char_function_type BSP_output_char = Armulator_BSP_output_char;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
+
diff --git a/c/src/lib/libbsp/arm/armulator/console/mon-syscalls.S b/c/src/lib/libbsp/arm/armulator/console/mon-syscalls.S
new file mode 100644
index 0000000000..e844274fc8
--- /dev/null
+++ b/c/src/lib/libbsp/arm/armulator/console/mon-syscalls.S
@@ -0,0 +1,43 @@
+#ifdef __STDC__
+# define _C_LABEL(x) _ ## x
+#else
+# define _C_LABEL(x) _/**/x
+#endif
+#define _ASM_LABEL(x) x
+
+#define _ENTRY(name) \
+ .text; .align 4; .globl name; name:
+
+#define ENTRY(name) \
+ _ENTRY(_C_LABEL(name))
+
+
+
+ENTRY(_sys_exit)
+ lda 257,g13
+ calls g13
+
+ENTRY(_sys_open)
+ lda 230,g13
+ calls g13
+ ret
+
+ENTRY(_sys_read)
+ lda 231,g13
+ calls g13
+ ret
+
+ENTRY(_sys_write)
+ lda 232,g13
+ calls g13
+ ret
+
+ENTRY(_sys_lseek)
+ lda 233,g13
+ calls g13
+ ret
+
+ENTRY(_sys_close)
+ lda 234,g13
+ calls g13
+ ret