source: rtems/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c @ 44b06ca

4.104.11
Last change on this file since 44b06ca was 44b06ca, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 29, 2009 at 3:33:28 PM

Whitespace removal.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*  void Shm_Get_configuration( localnode, &shmcfg )
2 *
3 *  This routine initializes, if necessary, and returns a pointer
4 *  to the Shared Memory Configuration Table for the XXX target.
5 *
6 *  INPUT PARAMETERS:
7 *    localnode - local node number
8 *    shmcfg    - address of pointer to SHM Config Table
9 *
10 *  OUTPUT PARAMETERS:
11 *    *shmcfg   - pointer to SHM Config Table
12 *
13XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
14 *  NOTES:  The XYZ does not have an interprocessor interrupt.
15 *
16 *          The following table illustrates the configuration limitations:
17 *
18 *                                   BUS     MAX
19 *                          MODE    ENDIAN  NODES
20 *                        ========= ====== =======
21 *                         POLLED    BIG    2+
22 *                        INTERRUPT **** NOT SUPPORTED ****
23 *
24 *  COPYRIGHT (c) 1989-1999.
25 *  On-Line Applications Research Corporation (OAR).
26 *
27 *  The license and distribution terms for this file may be
28 *  found in the file LICENSE in this distribution or at
29 *  http://www.rtems.com/license/LICENSE.
30 *
31 *  getcfg.c,v 1.7.8.1 2003/09/04 18:44:56 joel Exp
32 */
33
34#include <rtems.h>
35#include <bsp.h>
36#include <shm_driver.h>
37
38/* multiprocessor communications interface (MPCI) table */
39
40
41extern rtems_mpci_entry Shm_Get_packet(
42  rtems_packet_prefix **
43);
44
45rtems_mpci_entry Shm_Initialization( void );
46
47extern rtems_mpci_entry Shm_Receive_packet(
48  rtems_packet_prefix **
49);
50
51extern rtems_mpci_entry Shm_Return_packet(
52  rtems_packet_prefix *
53);
54
55extern rtems_mpci_entry Shm_Send_packet(
56  uint32_t,
57  rtems_packet_prefix *
58);
59
60
61/* rtems_mpci_table MPCI_table  = { */
62/*   100000,                     /\* default timeout value in ticks *\/ */
63/*   MAX_PACKET_SIZE,            /\* maximum packet size *\/ */
64/*   Shm_Initialization,         /\* initialization procedure   *\/ */
65/*   Shm_Get_packet,             /\* get packet procedure       *\/ */
66/*   Shm_Return_packet,          /\* return packet procedure    *\/ */
67/*   Shm_Send_packet,            /\* packet send procedure      *\/ */
68/*   Shm_Receive_packet          /\* packet receive procedure   *\/ */
69/* }; */
70
71
72/*
73 *  configured if currently polling of interrupt driven
74 */
75
76#define INTERRUPT 0        /* XXX: */
77#define POLLING   1        /* XXX: fix me -- is polling ONLY!!! */
78
79
80shm_config_table BSP_shm_cfgtbl;
81
82void Shm_Get_configuration(
83  uint32_t   localnode,
84  shm_config_table **shmcfg
85)
86{
87  extern rtems_configuration_table Configuration;
88  int i;
89  unsigned int tmp;
90
91  BSP_shm_cfgtbl.base         = 0x40000000;
92  BSP_shm_cfgtbl.length       = 0x00001000;
93  BSP_shm_cfgtbl.format       = SHM_BIG;
94
95  /*
96   *  Override cause_intr or shm_isr if your target has
97   *  special requirements.
98   */
99
100  BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
101
102#ifdef NEUTRAL_BIG
103  BSP_shm_cfgtbl.convert      = NULL_CONVERT;
104#else
105  BSP_shm_cfgtbl.convert      = CPU_swap_u32;
106#endif
107
108  BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
109  BSP_shm_cfgtbl.Intr.address =
110     (vol_u32) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]);
111  BSP_shm_cfgtbl.Intr.value   = 1 << LEON3_MP_IRQ ;
112  BSP_shm_cfgtbl.Intr.length  = 4;
113
114  if (LEON3_Cpu_Index == 0) {
115    tmp = 0;
116    for (i = 1;
117         i < (Configuration.User_multiprocessing_table)->maximum_nodes+1; i++)
118      tmp |= (1 << i);
119    LEON3_IrqCtrl_Regs->mpstat = tmp;
120  }
121
122  *shmcfg = &BSP_shm_cfgtbl;
123}
Note: See TracBrowser for help on using the repository browser.