source: rtems/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c @ 7593d56c

4.104.114.84.95
Last change on this file since 7593d56c was 37f4c2d, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 27, 1995 at 8:53:58 PM

Modified UNIX simulator port so all references to native unix
stuff is in the executive source proper in the file cpu.c. This
should help avoid conflicts between RTEMS POSIX files and UNIX files.

  • Property mode set to 100644
File size: 2.0 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, 1990, 1991, 1992, 1993, 1994.
18 *  On-Line Applications Research Corporation (OAR).
19 *  All rights assigned to U.S. Government, 1994.
20 *
21 *  This material may be reproduced by or for the U.S. Government pursuant
22 *  to the copyright license under the clause at DFARS 252.227-7013.  This
23 *  notice must appear in all copies of this file and its derivatives.
24 *
25 *  $Id$
26 */
27
28#include <bsp.h>
29#include <shm.h>
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.