source: rtems/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c @ 40d6543

4.104.114.84.95
Last change on this file since 40d6543 was 40d6543, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 05:19:16

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • clock/clock.c, include/bsp.h, shmsupp/cause_intr.c, shmsupp/getcfg.c, shmsupp/lock.c, startup/bspstart.c: Convert to using c99 fixed size types.
  • 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  uint32_t         node
37);
38
39void Shm_Get_configuration(
40  uint32_t           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    (uint32_t*)&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.