source: rtems/bsps/powerpc/psim/mpci/getcfg.c

Last change on this file was 1efa1c8, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 20, 2018 at 11:38:33 AM

bsps: Move MPCI support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.7 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 PowerPC PSIM.
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:  No interrupt support.
14 *
15 *  COPYRIGHT (c) 1989-2008.
16 *  On-Line Applications Research Corporation (OAR).
17 *
18 *  The license and distribution terms for this file may be
19 *  found in the file LICENSE in this distribution or at
20 *  http://www.rtems.org/license/LICENSE.
21 */
22
23#include <rtems.h>
24#include <psim.h>
25#include "shm_driver.h"
26
27#define INTERRUPT 0                   /* PSIM target supports only */
28#define POLLING   1                   /* polling mode. */
29
30shm_config_table BSP_shm_cfgtbl;
31
32void Shm_Get_configuration(
33  uint32_t           localnode,
34  shm_config_table **shmcfg
35)
36{
37   BSP_shm_cfgtbl.base         = (uint32_t*)PSIM.SharedMemory;
38   BSP_shm_cfgtbl.length       = sizeof(PSIM.SharedMemory);
39   BSP_shm_cfgtbl.format       = SHM_BIG;
40
41   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
42
43#ifdef NEUTRAL_BIG
44   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
45#else
46   BSP_shm_cfgtbl.convert      = CPU_swap_u32;
47#endif
48
49#if (POLLING==1)
50   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
51   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
52   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
53   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
54#else
55   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
56   BSP_shm_cfgtbl.Intr.address = 0;
57   BSP_shm_cfgtbl.Intr.value   = 0;
58   BSP_shm_cfgtbl.Intr.length  = BYTE;
59#endif
60
61   *shmcfg = &BSP_shm_cfgtbl;
62
63}
Note: See TracBrowser for help on using the repository browser.