source: rtems/c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c @ 98e4ebf5

4.104.114.84.95
Last change on this file since 98e4ebf5 was 98e4ebf5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/97 at 15:45:54

Fixed typo in the pointer to the license terms.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*  void Shm_Get_configuration( localnode, &shmcfg )
2 *
3 *  This routine initializes, if necessary, and returns a pointer
4 *  to the Shared Memory Configuration Table for the Cyclone CVME961.
5 *
6 *  INPUT PARAMETERS:
7 *    localnode - local node number
8 *    shmcfg    - address of pointer to SHM Config Table
9 *
10 *  OUTPUT PARAMETERS:
11 *    *shmcfg   - pointer to SHM Config Table
12 *
13 *  NOTES:  The MPCSR interrupt on the MVME136 is used as an interprocessor
14 *          interrupt.   The capablities of the MPCSR are used to generate
15 *          interprocessor interrupts for up to eight nodes.
16 *
17 *          The following table illustrates the configuration limitations:
18 *
19 *                                   BUS     MAX
20 *                          MODE    ENDIAN  NODES
21 *                        ========= ====== =======
22 *                         POLLED   LITTLE  2+
23 *                        INTERRUPT LITTLE  2-8
24 *
25 *  COPYRIGHT (c) 1989-1997.
26 *  On-Line Applications Research Corporation (OAR).
27 *  Copyright assigned to U.S. Government, 1994.
28 *
29 *  The license and distribution terms for this file may be
30 *  found in the file LICENSE in this distribution or at
31 *  http://www.OARcorp.com/rtems/license.html.
32 *
33 *  $Id$
34 */
35
36#include <rtems.h>
37#include "shm.h"
38
39#define INTERRUPT 1                   /* MVME136 target supports both */
40#define POLLING   0                   /* polling and interrupt modes  */
41
42shm_config_table BSP_shm_cfgtbl;
43
44rtems_unsigned32 *BSP_int_address()
45{
46  rtems_unsigned32 id, offset;
47
48  id      = (rtems_unsigned32) *(rtems_unsigned8 *)0xfffb0061;
49  offset  = ((id & 0x1f) << 5) | ((id & 0xe0) << 8);
50  offset |= 0xffff000b;
51  return( (rtems_unsigned32 * ) offset );
52}
53
54void Shm_Get_configuration(
55  rtems_unsigned32   localnode,
56  shm_config_table **shmcfg
57)
58{
59   BSP_shm_cfgtbl.base         = (rtems_unsigned32 *)0x20000000;
60   BSP_shm_cfgtbl.length       = 1 * MEGABYTE;
61   BSP_shm_cfgtbl.format       = SHM_BIG;
62
63   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
64
65#ifdef NEUTRAL_BIG
66   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
67#else
68   BSP_shm_cfgtbl.convert      = CPU_swap_u32;
69#endif
70
71#if (POLLING==1)
72   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
73   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
74   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
75   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
76#else
77   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
78   BSP_shm_cfgtbl.Intr.address = BSP_int_address();
79   BSP_shm_cfgtbl.Intr.value   = 0x80;
80   BSP_shm_cfgtbl.Intr.length  = BYTE;
81#endif
82
83   *shmcfg = &BSP_shm_cfgtbl;
84
85}
Note: See TracBrowser for help on using the repository browser.