Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:51

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*  void Shm_Get_configuration( localnode, &shmcfg )
0004  *
0005  *  This routine initializes, if necessary, and returns a pointer
0006  *  to the Shared Memory Configuration Table for the XXX target.
0007  *
0008  *  INPUT PARAMETERS:
0009  *    localnode - local node number
0010  *    shmcfg    - address of pointer to SHM Config Table
0011  *
0012  *  OUTPUT PARAMETERS:
0013  *    *shmcfg   - pointer to SHM Config Table
0014  *
0015 XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
0016  *  NOTES:  The XYZ does not have an interprocessor interrupt.
0017  *
0018  *          The following table illustrates the configuration limitations:
0019  *
0020  *                                   BUS     MAX
0021  *                          MODE    ENDIAN  NODES
0022  *                        ========= ====== =======
0023  *                         POLLED    BIG    2+
0024  *                        INTERRUPT **** NOT SUPPORTED ****
0025  *
0026  *  COPYRIGHT (c) 1989-1999.
0027  *  On-Line Applications Research Corporation (OAR).
0028  *
0029  * Redistribution and use in source and binary forms, with or without
0030  * modification, are permitted provided that the following conditions
0031  * are met:
0032  * 1. Redistributions of source code must retain the above copyright
0033  *    notice, this list of conditions and the following disclaimer.
0034  * 2. Redistributions in binary form must reproduce the above copyright
0035  *    notice, this list of conditions and the following disclaimer in the
0036  *    documentation and/or other materials provided with the distribution.
0037  *
0038  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0039  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0040  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0041  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0042  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0043  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0044  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0045  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0046  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0047  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0048  * POSSIBILITY OF SUCH DAMAGE.
0049  */
0050 
0051 #include <rtems.h>
0052 #include <bsp.h>
0053 #include <shm_driver.h>
0054 
0055 /*
0056  *  configured if currently polling of interrupt driven
0057  */
0058 
0059 #define INTERRUPT 0        /* XXX: */
0060 #define POLLING   1        /* XXX: fix me -- is polling ONLY!!! */
0061 
0062 shm_config_table BSP_shm_cfgtbl;
0063 
0064 void Shm_Get_configuration(
0065   uint32_t           localnode,
0066   shm_config_table **shmcfg
0067 )
0068 {
0069    BSP_shm_cfgtbl.base         = 0x0;
0070    BSP_shm_cfgtbl.length       = 1 * MEGABYTE;
0071    BSP_shm_cfgtbl.format       = SHM_BIG;
0072 
0073    /*
0074     *  Override cause_intr or shm_isr if your target has
0075     *  special requirements.
0076     */
0077 
0078    BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
0079 
0080 #ifdef NEUTRAL_BIG
0081    BSP_shm_cfgtbl.convert      = NULL_CONVERT;
0082 #else
0083    BSP_shm_cfgtbl.convert      = CPU_swap_u32;
0084 #endif
0085 
0086    BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
0087    BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
0088    BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
0089    BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
0090 
0091    *shmcfg = &BSP_shm_cfgtbl;
0092 }