summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/psim/shmsupp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-14 19:49:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-14 19:49:13 +0000
commit89611889fe6e255dec90a5157a4f25c0f65057b4 (patch)
tree2facca64edc8503b3149c8157a43fb6674e4523f /c/src/lib/libbsp/powerpc/psim/shmsupp
parentChanged arc to archive. (diff)
downloadrtems-89611889fe6e255dec90a5157a4f25c0f65057b4.tar.bz2
new files
Diffstat (limited to 'c/src/lib/libbsp/powerpc/psim/shmsupp')
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/README6
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c31
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c65
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c69
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c34
6 files changed, 260 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in b/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in
new file mode 100644
index 0000000000..031a0aa0cd
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in
@@ -0,0 +1,55 @@
+#
+# $Id$
+#
+
+@SET_MAKE@
+srcdir = @srcdir@
+VPATH = @srcdir@
+RTEMS_ROOT = @top_srcdir@
+PROJECT_ROOT = @PROJECT_ROOT@
+
+PGM=${ARCH}/shmsupp.rel
+
+# C source names, if any, go here -- minus the .c
+C_PIECES=addrconv getcfg lock mpisr
+C_FILES=$(C_PIECES:%=%.c)
+C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
+
+H_FILES=
+
+SRCS=$(C_FILES) $(H_FILES)
+OBJS=$(C_O_FILES)
+
+include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+DEFINES +=
+CPPFLAGS +=
+CFLAGS +=
+
+LD_PATHS +=
+LD_LIBS +=
+LDFLAGS +=
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS +=
+
+${PGM}: ${SRCS} ${OBJS}
+ $(make-rel)
+
+all: ${ARCH} $(SRCS) $(PGM)
+
+# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
+install: all
+
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/README b/c/src/lib/libbsp/powerpc/psim/shmsupp/README
new file mode 100644
index 0000000000..3c82078bac
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/README
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+
+This shared memory driver support code works with a modified version
+of the PowerPC Sim
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c
new file mode 100644
index 0000000000..3e1f16ec81
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c
@@ -0,0 +1,31 @@
+/* Shm_Convert_address
+ *
+ * No address range conversion is required.
+ *
+ * Input parameters:
+ * address - address to convert
+ *
+ * Output parameters:
+ * returns - converted address
+ *
+ * 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 in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <shm.h>
+
+void *Shm_Convert_address(
+ void *address
+)
+{
+ return ( address );
+}
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c
new file mode 100644
index 0000000000..5f94744a2f
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c
@@ -0,0 +1,65 @@
+/* void Shm_Get_configuration( localnode, &shmcfg )
+ *
+ * This routine initializes, if necessary, and returns a pointer
+ * to the Shared Memory Configuration Table for the PowerPC PSIM.
+ *
+ * INPUT PARAMETERS:
+ * localnode - local node number
+ * shmcfg - address of pointer to SHM Config Table
+ *
+ * OUTPUT PARAMETERS:
+ * *shmcfg - pointer to SHM Config Table
+ *
+ * NOTES: No interrupt support.
+ *
+ * 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 in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "shm.h"
+
+#define INTERRUPT 0 /* PSIM target supports only */
+#define POLLING 1 /* polling mode. */
+
+shm_config_table BSP_shm_cfgtbl;
+
+void Shm_Get_configuration(
+ rtems_unsigned32 localnode,
+ shm_config_table **shmcfg
+)
+{
+ BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0xc0000000;
+ BSP_shm_cfgtbl.length = 64 * 1024;
+ BSP_shm_cfgtbl.format = SHM_BIG;
+
+ BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
+
+#ifdef NEUTRAL_BIG
+ BSP_shm_cfgtbl.convert = NULL_CONVERT;
+#else
+ BSP_shm_cfgtbl.convert = CPU_swap_u32;
+#endif
+
+#if (POLLING==1)
+ BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
+ BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
+ BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
+ BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
+#else
+ BSP_shm_cfgtbl.poll_intr = INTR_MODE;
+ BSP_shm_cfgtbl.Intr.address = 0;
+ BSP_shm_cfgtbl.Intr.value = 0;
+ BSP_shm_cfgtbl.Intr.length = BYTE;
+#endif
+
+ *shmcfg = &BSP_shm_cfgtbl;
+
+}
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c
new file mode 100644
index 0000000000..56a1087e53
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c
@@ -0,0 +1,69 @@
+/* Shared Memory Lock Routines
+ *
+ * This shared memory locked queue support routine need to be
+ * able to lock the specified locked queue. Interrupts are
+ * disabled while the queue is locked to prevent preemption
+ * and deadlock when two tasks poll for the same lock.
+ * previous level.
+ *
+ * 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 in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <shm.h>
+
+typedef volatile unsigned int volint;
+
+/*
+ * Shm_Initialize_lock
+ *
+ * Initialize the lock for the specified locked queue.
+ */
+
+void Shm_Initialize_lock(
+ Shm_Locked_queue_Control *lq_cb
+)
+{
+ /* nothing required -- done implicitly by device tree */
+}
+
+/* void _Shm_Lock( &lq_cb )
+ *
+ * This shared memory locked queue support routine locks the
+ * specified locked queue. It disables interrupts to prevent
+ * a deadlock condition.
+ */
+
+void Shm_Lock(
+ Shm_Locked_queue_Control *lq_cb
+)
+{
+ volint *p = (volint *)0xc0010000;
+
+ (void) p[1];
+}
+
+/*
+ * Shm_Unlock
+ *
+ * Unlock the lock for the specified locked queue.
+ */
+
+void Shm_Unlock(
+ Shm_Locked_queue_Control *lq_cb
+)
+{
+ volint *p = (volint *)0xc0010000;
+
+ (void) p[2];
+}
+
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c
new file mode 100644
index 0000000000..e31dd2c615
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c
@@ -0,0 +1,34 @@
+/*
+ * NOTE: This routine is not used when in polling mode. Either
+ * this routine OR Shm_clockisr is used in a particular system.
+ *
+ * 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 in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <shm.h>
+
+
+/* void _Shm_setvec( )
+ *
+ * This driver routine sets the SHM interrupt vector to point to the
+ * driver's SHM interrupt service routine.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ */
+
+void Shm_setvec()
+{
+ /* not supported */
+}