File indexing completed on 2025-05-11 08:24:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <rtems.h>
0017 #include <bsp.h>
0018 #include <leon.h>
0019 #include <shm_driver.h>
0020
0021
0022 shm_config_table BSP_shm_cfgtbl __attribute__((weak)) =
0023 {
0024 (vol_u32 *)0x40000000,
0025 0x00001000,
0026 SHM_BIG,
0027 NULL_CONVERT,
0028 INTR_MODE,
0029 Shm_Cause_interrupt,
0030 {
0031 NULL,
0032 0,
0033 4,
0034 },
0035 };
0036
0037 void Shm_Get_configuration(
0038 uint32_t localnode,
0039 shm_config_table **shmcfg
0040 )
0041 {
0042 int i;
0043 unsigned int tmp;
0044 const rtems_multiprocessing_table *mptable;
0045
0046 BSP_shm_cfgtbl.format = SHM_BIG;
0047
0048
0049
0050
0051
0052
0053 BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
0054
0055 #ifdef NEUTRAL_BIG
0056 BSP_shm_cfgtbl.convert = NULL_CONVERT;
0057 #else
0058 BSP_shm_cfgtbl.convert = CPU_swap_u32;
0059 #endif
0060
0061 BSP_shm_cfgtbl.poll_intr = INTR_MODE;
0062 BSP_shm_cfgtbl.Intr.address =
0063 (vol_u32 *) &(LEON3_IrqCtrl_Regs->piforce[LEON3_Cpu_Index]);
0064 if (BSP_shm_cfgtbl.Intr.value == 0)
0065 BSP_shm_cfgtbl.Intr.value = 1 << LEON3_mp_irq;
0066 BSP_shm_cfgtbl.Intr.length = 4;
0067
0068 if (LEON3_Cpu_Index == 0) {
0069 tmp = 0;
0070 mptable = rtems_configuration_get_user_multiprocessing_table();
0071 for (i = 1; i < mptable->maximum_nodes; i++)
0072 tmp |= (1 << i);
0073 LEON3_IrqCtrl_Regs->mpstat = tmp;
0074 }
0075
0076 *shmcfg = &BSP_shm_cfgtbl;
0077 }