[5c491aef] | 1 | /* void Shm_get_config( localnode, &shmcfg ) |
---|
| 2 | * |
---|
| 3 | * This routine initializes, if necessary, and returns a pointer |
---|
| 4 | * to the Shared Memory Configuration Table for the UNIX |
---|
| 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: This driver is capable of supporting a practically unlimited |
---|
| 15 | * number of nodes. |
---|
| 16 | * |
---|
[08311cc3] | 17 | * COPYRIGHT (c) 1989-1999. |
---|
[5c491aef] | 18 | * On-Line Applications Research Corporation (OAR). |
---|
| 19 | * |
---|
[98e4ebf5] | 20 | * The license and distribution terms for this file may be |
---|
| 21 | * found in the file LICENSE in this distribution or at |
---|
[3e6211b] | 22 | * http://www.rtems.com/license/LICENSE. |
---|
[5c491aef] | 23 | * |
---|
| 24 | * $Id$ |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | #include <bsp.h> |
---|
[48bfd992] | 28 | #include <shm_driver.h> |
---|
[c64e4ed4] | 29 | #include <sys/types.h> /* pid_t */ |
---|
[5c491aef] | 30 | |
---|
| 31 | shm_config_table BSP_shm_cfgtbl; |
---|
| 32 | |
---|
[c64e4ed4] | 33 | int semid; |
---|
[5c491aef] | 34 | |
---|
| 35 | void Shm_Cause_interrupt_unix( |
---|
| 36 | rtems_unsigned32 node |
---|
| 37 | ); |
---|
| 38 | |
---|
| 39 | void Shm_Get_configuration( |
---|
| 40 | rtems_unsigned32 localnode, |
---|
| 41 | shm_config_table **shmcfg |
---|
| 42 | ) |
---|
| 43 | { |
---|
| 44 | _CPU_SHM_Init( |
---|
| 45 | Shm_Maximum_nodes, |
---|
| 46 | Shm_Is_master_node(), |
---|
| 47 | (void **)&BSP_shm_cfgtbl.base, |
---|
| 48 | (unsigned32 *)&BSP_shm_cfgtbl.length |
---|
| 49 | ); |
---|
| 50 | |
---|
| 51 | BSP_shm_cfgtbl.format = SHM_BIG; |
---|
| 52 | |
---|
| 53 | BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_unix; |
---|
| 54 | |
---|
| 55 | #ifdef NEUTRAL_BIG |
---|
| 56 | BSP_shm_cfgtbl.convert = NULL_CONVERT; |
---|
| 57 | #else |
---|
| 58 | BSP_shm_cfgtbl.convert = CPU_swap_u32; |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | if ( _CPU_SHM_Get_vector() ) { |
---|
| 62 | BSP_shm_cfgtbl.poll_intr = INTR_MODE; |
---|
| 63 | BSP_shm_cfgtbl.Intr.address = (vol_u32 *) _CPU_Get_pid(); /* process id */ |
---|
| 64 | BSP_shm_cfgtbl.Intr.value = _CPU_SHM_Get_vector(); /* signal to send */ |
---|
| 65 | BSP_shm_cfgtbl.Intr.length = LONG; |
---|
| 66 | } else { |
---|
| 67 | BSP_shm_cfgtbl.poll_intr = POLLED_MODE; |
---|
| 68 | BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT; |
---|
| 69 | BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT; |
---|
| 70 | BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | *shmcfg = &BSP_shm_cfgtbl; |
---|
| 74 | } |
---|