source: rtems/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c @ d637822

4.104.114.84.95
Last change on this file since d637822 was 98e4ebf, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 8, 1997 at 3:45:54 PM

Fixed typo in the pointer to the license terms.

  • Property mode set to 100644
File size: 2.6 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 HP PA-RISC
5 *  simulator.
6 *
7 *  INPUT PARAMETERS:
8 *    localnode - local node number
9 *    shmcfg    - address of pointer to SHM Config Table
10 *
11 *  OUTPUT PARAMETERS:
12 *    *shmcfg   - pointer to SHM Config Table
13 *
14 *  NOTES:  The MP interrupt used is the Runway bus' ability to directly
15 *          address the control registers of up to four CPUs and cause
16 *          interrupts on them.
17 *
18 *          The following table illustrates the configuration limitations:
19 *
20 *                                   BUS     MAX
21 *                          MODE    ENDIAN  NODES
22 *                        ========= ====== =======
23 *                         POLLED    BIG    2+
24 *                        INTERRUPT  BIG    2..4 (on Runway)
25 *
26 *  COPYRIGHT (c) 1989-1997.
27 *  On-Line Applications Research Corporation (OAR).
28 *  Copyright assigned to U.S. Government, 1994.
29 *
30 *  The license and distribution terms for this file may be
31 *  found in the file LICENSE in this distribution or at
32 *  http://www.OARcorp.com/rtems/license.html.
33 *
34 *  $Id$
35 */
36
37#include <bsp.h>
38
39#include <shm.h>
40
41#define INTERRUPT 0        /* can be interrupt or polling */
42#define POLLING   1
43
44#define HPPA_RUNWAY_PROC_HPA_BASE  ((void *) 0xFFFA0000)
45
46/* given a processor number, where is its HPA? */
47#define HPPA_RUNWAY_HPA(cpu)   \
48  ((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000)))
49
50#define HPPA_RUNWAY_REG_IO_EIR_OFFSET   0x000
51
52shm_config_table BSP_shm_cfgtbl;
53
54extern void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node );
55
56void Shm_Get_configuration(
57  rtems_unsigned32   localnode,
58  shm_config_table **shmcfg
59)
60{
61   BSP_shm_cfgtbl.base         = (vol_u32 *) 0x44000000;
62   BSP_shm_cfgtbl.length       = 16 * KILOBYTE;
63   BSP_shm_cfgtbl.format       = SHM_BIG;
64
65   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt_pxfl;
66
67#ifdef NEUTRAL_BIG
68   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
69#else
70   BSP_shm_cfgtbl.convert      = CPU_swap_u32;
71#endif
72
73#if ( POLLING == 1 )
74   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
75   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
76   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
77   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
78#else
79   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
80   BSP_shm_cfgtbl.Intr.address =
81        (vol_u32 *) (HPPA_RUNWAY_HPA( localnode - 1) +
82                     HPPA_RUNWAY_REG_IO_EIR_OFFSET);
83   BSP_shm_cfgtbl.Intr.value   = HPPA_INTERRUPT_EXTERNAL_MPCI;
84   BSP_shm_cfgtbl.Intr.length  = LONG;
85#endif
86
87   *shmcfg = &BSP_shm_cfgtbl;
88}
89
Note: See TracBrowser for help on using the repository browser.