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

4.104.114.84.95
Last change on this file since df49c60 was 48bfd992, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 30, 1999 at 7:58:02 PM

Renamed shm.h to shm_driver.h to avoid conflicts with POSIX shm.h.

Renamed file shmsupp/intr.c in some BSPs to shmsupp/cause_intr.c to
avoid conflict with rtems/src/intr.c (Classic API Interrupt Manager).

  • 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-1999.
26 *  On-Line Applications Research Corporation (OAR).
27 *
28 *  The license and distribution terms for this file may be
29 *  found in the file LICENSE in this distribution or at
30 *  http://www.OARcorp.com/rtems/license.html.
31 *
32 *  $Id$
33 */
34
35#include <rtems.h>
36#include "shm_driver.h"
37
38#define INTERRUPT 1                   /* MVME136 target supports both */
39#define POLLING   0                   /* polling and interrupt modes  */
40
41shm_config_table BSP_shm_cfgtbl;
42
43rtems_unsigned32 *BSP_int_address()
44{
45  rtems_unsigned32 id, offset;
46
47  id      = (rtems_unsigned32) *(rtems_unsigned8 *)0xfffb0061;
48  offset  = ((id & 0x1f) << 5) | ((id & 0xe0) << 8);
49  offset |= 0xffff000b;
50  return( (rtems_unsigned32 * ) offset );
51}
52
53void Shm_Get_configuration(
54  rtems_unsigned32   localnode,
55  shm_config_table **shmcfg
56)
57{
58   BSP_shm_cfgtbl.base         = (rtems_unsigned32 *)0x20000000;
59   BSP_shm_cfgtbl.length       = 1 * MEGABYTE;
60   BSP_shm_cfgtbl.format       = SHM_BIG;
61
62   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
63
64#ifdef NEUTRAL_BIG
65   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
66#else
67   BSP_shm_cfgtbl.convert      = CPU_swap_u32;
68#endif
69
70#if (POLLING==1)
71   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
72   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
73   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
74   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
75#else
76   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
77   BSP_shm_cfgtbl.Intr.address = BSP_int_address();
78   BSP_shm_cfgtbl.Intr.value   = 0x80;
79   BSP_shm_cfgtbl.Intr.length  = BYTE;
80#endif
81
82   *shmcfg = &BSP_shm_cfgtbl;
83
84}
Note: See TracBrowser for help on using the repository browser.