summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i960/i960sim/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 16:34:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 16:34:46 +0000
commit68c498f47761a00aee669aeb52a8e473c4d802ba (patch)
tree79d2517b87d95d739067c9b3764cc6f02496c649 /c/src/lib/libbsp/i960/i960sim/console
parentMerge lossage. Apparently the DOS/UNIX CRLF issue got lost. (diff)
downloadrtems-68c498f47761a00aee669aeb52a8e473c4d802ba.tar.bz2
Added i960sim BSP which (ignoring the 3 instructions not supported
by gdb 5.0's i960 simulator) is enough to run hello world.
Diffstat (limited to 'c/src/lib/libbsp/i960/i960sim/console')
-rw-r--r--c/src/lib/libbsp/i960/i960sim/console/.cvsignore2
-rw-r--r--c/src/lib/libbsp/i960/i960sim/console/Makefile.am35
-rw-r--r--c/src/lib/libbsp/i960/i960sim/console/console-io.c62
-rw-r--r--c/src/lib/libbsp/i960/i960sim/console/mon-syscalls.S43
4 files changed, 142 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/i960/i960sim/console/.cvsignore b/c/src/lib/libbsp/i960/i960sim/console/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/c/src/lib/libbsp/i960/i960sim/console/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/c/src/lib/libbsp/i960/i960sim/console/Makefile.am b/c/src/lib/libbsp/i960/i960sim/console/Makefile.am
new file mode 100644
index 0000000000..1af713f147
--- /dev/null
+++ b/c/src/lib/libbsp/i960/i960sim/console/Makefile.am
@@ -0,0 +1,35 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+PGM = $(ARCH)/console.rel
+
+C_FILES = console-io.c console-polled.c
+C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
+
+S_FILES = mon-syscalls.S
+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/i960/i960sim/console/console-io.c b/c/src/lib/libbsp/i960/i960sim/console/console-io.c
new file mode 100644
index 0000000000..6b6b9da148
--- /dev/null
+++ b/c/src/lib/libbsp/i960/i960sim/console/console-io.c
@@ -0,0 +1,62 @@
+/*
+ * 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 */
+
+void outbyte( char );
+char inbyte( void );
+
+/*
+ * console_outbyte_polled
+ *
+ * This routine transmits a character using polling.
+ */
+
+void console_outbyte_polled(
+ int port,
+ char ch
+)
+{
+ int status;
+ int nwritten;
+
+ status = _sys_write (1, &ch, 1, &nwritten);
+}
+
+/*
+ * console_inbyte_nonblocking
+ *
+ * This routine polls for a character.
+ */
+
+int console_inbyte_nonblocking(
+ int port
+)
+{
+ int status;
+ int nread;
+ char c;
+
+ status = _sys_read (0, &c, 1, &nread);
+ if ( status == 0 )
+ return c;
+ return -1;
+}
+
diff --git a/c/src/lib/libbsp/i960/i960sim/console/mon-syscalls.S b/c/src/lib/libbsp/i960/i960sim/console/mon-syscalls.S
new file mode 100644
index 0000000000..e844274fc8
--- /dev/null
+++ b/c/src/lib/libbsp/i960/i960sim/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