source: rtems/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c @ 3e6211b

Last change on this file since 3e6211b was 3e6211b, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:45:40 PM

2003-09-04 Joel Sherrill <joel@…>

  • clock/clock.c, console/console.c, include/bsp.h, shmsupp/addrconv.c, shmsupp/cause_intr.c, shmsupp/getcfg.c, shmsupp/lock.c, shmsupp/mpisr.c, startup/bspclean.c, startup/bspstart.c, startup/exit.c, startup/setvec.c, timer/timer.c: URL for license changed.
  • Property mode set to 100644
File size: 1.9 KB
Line 
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 *
17 *  COPYRIGHT (c) 1989-1999.
18 *  On-Line Applications Research Corporation (OAR).
19 *
20 *  The license and distribution terms for this file may be
21 *  found in the file LICENSE in this distribution or at
22 *  http://www.rtems.com/license/LICENSE.
23 *
24 *  $Id$
25 */
26
27#include <bsp.h>
28#include <shm_driver.h>
29#include <sys/types.h>    /* pid_t */
30
31shm_config_table BSP_shm_cfgtbl;
32
33int semid;
34
35void Shm_Cause_interrupt_unix(
36  rtems_unsigned32 node
37);
38
39void 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}
Note: See TracBrowser for help on using the repository browser.