OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/rtos/rtems/c/src/lib/libbsp/powerpc/psim/shmsupp
    from Rev 30 to Rev 173
    Reverse comparison

Rev 30 → Rev 173

/getcfg.c
0,0 → 1,64
/* 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-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id: getcfg.c,v 1.2 2001-09-27 12:01:02 chris Exp $
*/
 
#include <rtems.h>
#include "shm_driver.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;
 
}
/addrconv.c
0,0 → 1,30
/* Shm_Convert_address
*
* No address range conversion is required.
*
* Input parameters:
* address - address to convert
*
* Output parameters:
* returns - converted address
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id: addrconv.c,v 1.2 2001-09-27 12:01:02 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
#include <shm_driver.h>
 
void *Shm_Convert_address(
void *address
)
{
return ( address );
}
/Makefile.am
0,0 → 1,34
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:02 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
PGM = $(ARCH)/shmsupp.rel
 
C_FILES = addrconv.c getcfg.c lock.c mpisr.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_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
 
if HAS_MP
all-local: $(ARCH) $(OBJS) $(PGM)
endif
 
.PRECIOUS: $(PGM)
 
EXTRA_DIST = README addrconv.c getcfg.c lock.c mpisr.c
 
include $(top_srcdir)/../../../../../../automake/local.am
/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: lock.c,v 1.2 2001-09-27 12:01:02 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
#include <shm_driver.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];
}
 
/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: mpisr.c,v 1.2 2001-09-27 12:01:02 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
#include <shm_driver.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 */
}
/README
0,0 → 1,7
#
# $Id: README,v 1.2 2001-09-27 12:01:02 chris Exp $
#
 
This shared memory driver support code works with a modified version
of the PowerPC Simulator. The modifications are not yet merged
into the mainsteam distribution.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.