Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dsp/inc/dsplink.h

Go to the documentation of this file.
00001 /** ============================================================================
00002  *  @file   dsplink.h
00003  *
00004  *  @path   $(DSPLINK)/dsp/inc/
00005  *
00006  *  @brief  Defines constants, data types and structures used by
00007  *          DSP/BIOS(TM) LINK.
00008  *
00009  *  @ver    1.65.00.03
00010  *  ============================================================================
00011  *  @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated -
00012  *  http://www.ti.com/
00013  *
00014  *  Redistribution and use in source and binary forms, with or without
00015  *  modification, are permitted provided that the following conditions
00016  *  are met:
00017  *  
00018  *  *  Redistributions of source code must retain the above copyright
00019  *     notice, this list of conditions and the following disclaimer.
00020  *  
00021  *  *  Redistributions in binary form must reproduce the above copyright
00022  *     notice, this list of conditions and the following disclaimer in the
00023  *     documentation and/or other materials provided with the distribution.
00024  *  
00025  *  *  Neither the name of Texas Instruments Incorporated nor the names of
00026  *     its contributors may be used to endorse or promote products derived
00027  *     from this software without specific prior written permission.
00028  *  
00029  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00030  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00031  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00032  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00033  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00034  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00035  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00036  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00037  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00038  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00039  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00040  *  ============================================================================
00041  */
00042 
00043 
00044 #if !defined (DSPLINK_)
00045 #define DSPLINK_
00046 
00047 
00048 /*  ----------------------------------- DSP/BIOS Headers            */
00049 #include <que.h>
00050 #include <pool.h>
00051 #if defined (MSGQ_COMPONENT)
00052 #include <msgq.h>
00053 #endif /* #if defined (MSGQ_COMPONENT) */
00054 
00055 /*  ----------------------------------- DSP/BIOS LINK Headers       */
00056 #include <platform.h>
00057 #include <version.h>
00058 
00059 
00060 #if defined (__cplusplus)
00061 extern "C" {
00062 #endif /* defined (__cplusplus) */
00063 
00064 
00065 /** ============================================================================
00066  *  @macro  IN/OUT/CONST
00067  *
00068  *  @brief  Argument specification syntax
00069  *  ============================================================================
00070  */
00071 #define IN                              /* The argument is INPUT  only */
00072 #define OUT                             /* The argument is OUTPUT only */
00073 #define CONST   const
00074 
00075 /** ============================================================================
00076  *  @const  DSP_MAX_STRLEN
00077  *
00078  *  @brief  Maximum length of string.
00079  *  ============================================================================
00080  */
00081 #define DSP_MAX_STRLEN        32
00082 
00083 
00084 /*  ============================================================================
00085  *  @const  MAX_IPS
00086  *
00087  *  @brief  Maximum number of IPS objects supported for each DSP.
00088  *  ============================================================================
00089  */
00090 #define  MAX_IPS              16
00091 
00092 #if defined (POOL_COMPONENT)
00093 /** ============================================================================
00094  *  @name   MAX_POOLENTRIES
00095  *
00096  *  @brief  The maximum number of pools that can be configured.
00097  *  ============================================================================
00098  */
00099 #define MAX_POOLENTRIES       32
00100 #endif /* if defined (POOL_COMPONENT) */
00101 
00102 /** ============================================================================
00103  *  @const  DSPLINK_DRIVER_NAME
00104  *
00105  *  @brief  DSPLINK driver name
00106  *  ============================================================================
00107  */
00108 #define DSPLINK_DRIVER_NAME   "/dsplink"
00109 
00110 /** ============================================================================
00111  *  @const  MAX_DRIVER_NAME_LEN
00112  *
00113  *  @brief  Maximum length of the driver name.
00114  *  ============================================================================
00115  */
00116 #define MAX_DRIVER_NAME_LEN    16
00117 
00118 
00119 #if defined (POOL_COMPONENT)
00120 #if !defined (POOL_open) /* To ensure no clash with future BIOS definition */
00121 /** ============================================================================
00122  *  @name   POOL_open
00123  *
00124  *  @brief  Function to set allocator pool id in POOL as well as call init and
00125  *          open function.
00126  *
00127  *  @param poolId
00128  *              Pool id.
00129  *  @param poolObj
00130  *              Allocator object of type POOL_Obj.
00131  *  @return SYS_OK
00132  *              Operation completed successfully.
00133  *          SYS_EINVAL
00134  *              POOL is not defined.
00135  *
00136  *  @pre    None.
00137  *
00138  *  @post   None.
00139  *
00140  *  @see    POOL_close
00141  *  ============================================================================
00142  */
00143 Int
00144 POOL_open(Uint16     poolId,
00145           POOL_Obj * poolObj) ;
00146 #endif /* if !defined (POOL_open) */
00147 
00148 
00149 #if !defined (POOL_close) /* To ensure no clash with future BIOS definition */
00150 /** ============================================================================
00151  *  @name   POOL_close
00152  *
00153  *  @brief  Macro over the allocator for closing a pool.
00154  *
00155  *  @param poolId
00156  *              Pool id.
00157  *
00158  *  @see    POOL_open
00159  *  ============================================================================
00160  */
00161 #define POOL_close(poolId)                           \
00162         (((POOL->allocators [poolId]).fxns->close)       \
00163                 (POOL->allocators [poolId].object))
00164 #endif /* if !defined (POOL_close) */
00165 
00166 
00167 #if !defined (POOL_alloc) /* To ensure no clash with future BIOS definition */
00168 /** ============================================================================
00169  *  @name   POOL_alloc
00170  *
00171  *  @brief  Macro over the allocator for allocating a buffer.
00172  *
00173  *  @param poolId
00174  *              Pool id.
00175  *  @param bufPtr
00176  *              Placeholder to return the allocator buffer.
00177  *  @param size
00178  *              Size of buffer to be allocated.
00179  *
00180  *  @see    POOL_free
00181  *  ============================================================================
00182  */
00183 #define POOL_alloc(poolId, bufPtr, size)                        \
00184         (((POOL->allocators [poolId]).fxns->alloc)              \
00185                 (POOL->allocators [poolId].object,              \
00186                  bufPtr,                                        \
00187                  size))
00188 #endif /* if !defined (POOL_alloc) */
00189 
00190 
00191 #if !defined (POOL_free) /* To ensure no clash with future BIOS definition */
00192 /** ============================================================================
00193  *  @name   POOL_free
00194  *
00195  *  @brief  Macro over the allocator for freeing a buffer.
00196  *
00197  *  @param poolId
00198  *              Pool id.
00199  *  @param buf
00200  *              Pointer to the buffer to be freed.
00201  *  @param size
00202  *              Size of buffer to be freed.
00203  *
00204  *  @see    POOL_alloc
00205  *  ============================================================================
00206  */
00207 #define POOL_free(poolId, buf, size)                            \
00208         (((POOL->allocators [poolId]).fxns->free)               \
00209                 (POOL->allocators [poolId].object,              \
00210                  buf,                                           \
00211                  size))
00212 #endif /* if !defined (POOL_free) */
00213 #endif /* if defined (POOL_COMPONENT) */
00214 
00215 
00216 #if defined (CHNL_COMPONENT)
00217 /** ============================================================================
00218  *  @name   CHNL_Irp
00219  *
00220  *  @brief  CHIRP (Channel Input/output Request Packet) data structure.
00221  *          This structure matches its counterpart on the GPP side.
00222  *
00223  *  @param  link
00224  *              List element header needed for this structure.
00225  *  @param  buffer
00226  *              Buffer to be filled/emptied.
00227  *  @param  arg
00228  *              Issue reclaim argument.
00229  *  @param  size
00230  *              Buffer length.
00231  *  @param  iocStatus
00232  *              Status of IO Completion.
00233  *  @param  chnlId
00234  *              Channel ID
00235  *  ============================================================================
00236  */
00237 typedef struct CHNL_Irp_tag {
00238     QUE_Elem  link      ;
00239     Ptr       buffer    ;
00240     LgUns     arg       ;
00241     LgUns     size      ;
00242     LgUns     iocStatus ;
00243     LgUns     chnlId ;
00244 } CHNL_Irp ;
00245 #endif /* if defined (CHNL_COMPONENT) */
00246 
00247 
00248 
00249 /** ============================================================================
00250  *  @name   POOL
00251  *
00252  *  @brief  POOL variable defined by MSGQ module. This is temporary until
00253  *          this definition is exported by DSP/BIOS configuration tool.
00254  *  ============================================================================
00255  */
00256 extern POOL_Config  * POOL ;
00257 
00258 
00259 /** ============================================================================
00260  *  @func   DSPLINK_init
00261  *
00262  *  @brief  This function initializes DSP/BIOS LINK.
00263  *
00264  *  @param None.
00265  *
00266  *  @return None.
00267  *
00268  *  @pre    None.
00269  *
00270  *  @post   None.
00271  *
00272  *  @see    None.
00273  *  ============================================================================
00274  */
00275 Void
00276 DSPLINK_init (Void) ;
00277 
00278 
00279 #if defined (__cplusplus)
00280 }
00281 #endif /* defined (__cplusplus) */
00282 
00283 
00284 #endif /* if !defined (DSPLINK_) */

Generated on Fri Jul 16 14:34:02 2010 for DSP/BIOSLink by  doxygen 1.4.4