source: rtems/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c @ 2803314e

Last change on this file since 2803314e was 2803314e, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 23, 2016 at 3:37:09 PM

bsp/leon3: Remove dead code

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 *  @file
3 *
4 *  LEON3 Shared Memory Driver Support - Configuration
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-2012.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#include <rtems.h>
17#include <bsp.h>
18#include <shm_driver.h>
19
20/* Let user override this configuration by declaring this a weak variable */
21shm_config_table BSP_shm_cfgtbl __attribute__((weak)) =
22{
23  (vol_u32 *)0x40000000,    /* USER OVERRIDABLE */
24  0x00001000,               /* USER OVERRIDABLE */
25  SHM_BIG,
26  NULL_CONVERT,
27  INTR_MODE,
28  Shm_Cause_interrupt,
29  {
30    NULL,
31    0,                      /* USER OVERRIDABLE - Uses default MP-IRQ if 0 */
32    4,
33  },
34};
35
36void Shm_Get_configuration(
37  uint32_t   localnode,
38  shm_config_table **shmcfg
39)
40{
41  int i;
42  unsigned int tmp;
43  rtems_multiprocessing_table *mptable;
44
45  BSP_shm_cfgtbl.format       = SHM_BIG;
46
47  /*
48   *  Override cause_intr or shm_isr if your target has
49   *  special requirements.
50   */
51
52  BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
53
54#ifdef NEUTRAL_BIG
55  BSP_shm_cfgtbl.convert      = NULL_CONVERT;
56#else
57  BSP_shm_cfgtbl.convert      = CPU_swap_u32;
58#endif
59
60  BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
61  BSP_shm_cfgtbl.Intr.address =
62     (vol_u32 *) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]);
63  if (BSP_shm_cfgtbl.Intr.value == 0)
64    BSP_shm_cfgtbl.Intr.value = 1 << LEON3_mp_irq; /* Use default MP-IRQ */
65  BSP_shm_cfgtbl.Intr.length  = 4;
66
67  if (LEON3_Cpu_Index == 0) {
68    tmp = 0;
69    mptable = rtems_configuration_get_user_multiprocessing_table();
70    for (i = 1; i < mptable->maximum_nodes; i++)
71      tmp |= (1 << i);
72    LEON3_IrqCtrl_Regs->mpstat = tmp;
73  }
74
75  *shmcfg = &BSP_shm_cfgtbl;
76}
Note: See TracBrowser for help on using the repository browser.