Changeset 39e8aa9 in rtems


Ignore:
Timestamp:
Feb 17, 2012, 8:28:19 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
99aebcb
Parents:
77998753
Message:

PR 2015 - LEON3: make SHM driver configurable using weak

PR 2015/bsps

Since the configuration struct is always present one can let
DATA initialize it to reduce footprint, at the same time it
is made weak to let the user able to configure the SHM driver
without editing the driver code.

Signed-off-by: Daniel Hellstrom <daniel@…>

Location:
c/src/lib/libbsp/sparc/leon3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/ChangeLog

    r77998753 r39e8aa9  
     12012-02-17      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        PR 2015/bsps
     4        * shmsupp/getcfg.c: Make SHM driver configurable using weak symbol.
     5
    162011-06-29      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c

    r77998753 r39e8aa9  
    7777#define POLLING   1        /* XXX: fix me -- is polling ONLY!!! */
    7878
    79 
    80 shm_config_table BSP_shm_cfgtbl;
     79/* Let user override this configuration by declaring this a weak variable */
     80shm_config_table BSP_shm_cfgtbl __attribute__((weak)) =
     81{
     82  (vol_u32 *)0x40000000,    /* USER OVERRIDABLE */
     83  0x00001000,               /* USER OVERRIDABLE */
     84  SHM_BIG,
     85  NULL_CONVERT,
     86  INTR_MODE,
     87  Shm_Cause_interrupt,
     88  {
     89    NULL,
     90    1 << LEON3_MP_IRQ,      /* USER OVERRIDABLE */
     91    4,
     92  },
     93};
    8194
    8295void Shm_Get_configuration(
     
    89102  unsigned int tmp;
    90103
    91   BSP_shm_cfgtbl.base         = 0x40000000;
    92   BSP_shm_cfgtbl.length       = 0x00001000;
    93104  BSP_shm_cfgtbl.format       = SHM_BIG;
    94105
     
    109120  BSP_shm_cfgtbl.Intr.address =
    110121     (vol_u32 *) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]);
    111   BSP_shm_cfgtbl.Intr.value   = 1 << LEON3_MP_IRQ ;
     122  if (BSP_shm_cfgtbl.Intr.value == 0)
     123    BSP_shm_cfgtbl.Intr.value = 1 << LEON3_MP_IRQ; /* Use default MP-IRQ */
    112124  BSP_shm_cfgtbl.Intr.length  = 4;
    113125
Note: See TracChangeset for help on using the changeset viewer.