summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-13 22:33:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-13 22:33:49 +0000
commit40323b5b3739f36cc96cffcc30111e95cde2d3b2 (patch)
tree9893a7d1526bc453b4b297bb191fe6f232e28154 /c/src/lib/libcpu
parent7a677fd7d3127d3fd93e32140532d4bad637bb71 (diff)
downloadrtems-40323b5b3739f36cc96cffcc30111e95cde2d3b2.tar.bz2
2000-12-13 Joel Sherrill <joel@OARcorp.com>
* configure.in: Added new directories. * shared/interrupts/Makefile.am: Added AM_CPPFLAGS to define TX39 when compiling for a TX3904. * shared/interrupts/maxvectors.c: Corrected conditional logic. * tx39/Makefile.am: Added vectorisrs. * tx39/vectorisrs/Makefile.am, tx39/vectorisrs/vectorisrs.c, * tx39/vectorisrs/.cvsignore: New files. This decodes the interrupt pending information on the TX3904 and vectors an interrupt.
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/mips/tx39/vectorisrs/.cvsignore13
-rw-r--r--c/src/lib/libcpu/mips/tx39/vectorisrs/Makefile.am30
-rw-r--r--c/src/lib/libcpu/mips/tx39/vectorisrs/vectorisrs.c41
3 files changed, 84 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/mips/tx39/vectorisrs/.cvsignore b/c/src/lib/libcpu/mips/tx39/vectorisrs/.cvsignore
new file mode 100644
index 0000000000..525275c115
--- /dev/null
+++ b/c/src/lib/libcpu/mips/tx39/vectorisrs/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
diff --git a/c/src/lib/libcpu/mips/tx39/vectorisrs/Makefile.am b/c/src/lib/libcpu/mips/tx39/vectorisrs/Makefile.am
new file mode 100644
index 0000000000..16c4dbef0b
--- /dev/null
+++ b/c/src/lib/libcpu/mips/tx39/vectorisrs/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+PGM = $(ARCH)/vectorisrs.rel
+
+C_FILES = vectorisrs.c
+
+vectorisrs_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.o) $(S_FILES:%.S=$(ARCH)/%.o)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../../../../../automake/compile.am
+include $(top_srcdir)/../../../../../automake/lib.am
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+$(PGM): $(vectorisrs_rel_OBJECTS)
+ $(make-rel)
+
+all-local: $(ARCH) $(vectorisrs_rel_OBJECTS) $(PGM)
+
+.PRECIOUS: $(PGM)
+
+EXTRA_DIST = vectorisrs.c
+
+include $(top_srcdir)/../../../../../automake/local.am
diff --git a/c/src/lib/libcpu/mips/tx39/vectorisrs/vectorisrs.c b/c/src/lib/libcpu/mips/tx39/vectorisrs/vectorisrs.c
new file mode 100644
index 0000000000..15a4753123
--- /dev/null
+++ b/c/src/lib/libcpu/mips/tx39/vectorisrs/vectorisrs.c
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <stdlib.h>
+#include <libcpu/tx3904.h>
+
+#define mips_get_cause( _cause ) \
+ do { \
+ asm volatile( "mfc0 %0, $13; nop" : "=g" (_cause) : ); \
+ } while (0)
+
+#define CALL_ISR(_vector) \
+ (_ISR_Vector_table[_vector])(_vector);
+
+void mips_vector_isr_handlers( void )
+{
+ unsigned int sr;
+ unsigned int cause;
+
+ mips_get_sr( sr );
+ mips_get_cause( cause );
+
+ cause &= (sr & SR_IMASK);
+ cause >>= CAUSE_IPSHIFT;
+
+ if ( cause & 0x80 ) /* IP[5] ==> INT0 */
+ CALL_ISR( TX3904_IRQ_INT0 );
+
+ if ( cause & 0x40 ) { /* (IP[4] == 1) ==> IP[0-3] are valid */
+ unsigned int v = (cause >> 2) & 0x0f;
+ CALL_ISR( v );
+ }
+
+ if ( cause & 0x02 ) /* SW[0] */
+ CALL_ISR( TX3904_IRQ_SOFTWARE_1 );
+
+ if ( cause & 0x01 ) /* IP[1] */
+ CALL_ISR( TX3904_IRQ_SOFTWARE_2 );
+}