dman3.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2010, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  */
00054 #ifndef ti_sdo_fc_dman3_DMAN3_
00055 #define ti_sdo_fc_dman3_DMAN3_
00056 
00059 
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 #include <ti/xdais/ialg.h>
00066 #include <ti/xdais/idma3.h>
00067 
00068 #define DMAN3_GTNAME "ti.sdo.fc.dman3"  
00070 #define DMAN3_MAXGROUPS      20  
00078 #define DMAN3_SOK             0  
00079 #define DMAN3_EOUTOFMEMORY   -1  
00082 #define DMAN3_EFAIL          -2  
00083 #define DMAN3_EFREE          -3  
00085 #define DMAN3_EOUTOFTCCS     -4  
00088 #define DMAN3_EOUTOFPARAMS   -5  
00091 #define DMAN3_ETCCCONFIG     -6  
00097 #define DMAN3_EPARAMCONFIG   -7  
00104 
00105 
00114 typedef Bool (*DMAN3_ScratchAllocFxn)(IALG_Handle alg, Int mutexId,
00115         IALG_MemRec *memTab, Int numRecs);
00116 
00122 typedef Void (*DMAN3_ScratchFreeFxn)(Int mutexId, Void *addr, Uns size);
00123 
00124 
00135 typedef struct DMAN3_Params {
00142     Uns    *qdmaPaRamBase;
00143 
00150     Uns     maxPaRamEntries;
00151 
00161     Uns     paRamBaseIndex;
00162 
00170     Uns     numPaRamEntries;
00171 
00178     Uns     maxQdmaChannels;
00179 
00186     Uns     numQdmaChannels;
00187 
00195     Uns    *qdmaChannels;
00196 
00210     Uns     tccAllocationMaskH;
00211 
00225     Uns     tccAllocationMaskL;
00226 
00237     Int heapInternal;
00238 
00250     Int heapExternal;
00251 
00260     unsigned char numTccGroup[DMAN3_MAXGROUPS];    
00270     unsigned short numPaRamGroup[DMAN3_MAXGROUPS];  
00281     Bool          idma3Internal;
00282 
00295     DMAN3_ScratchAllocFxn scratchAllocFxn;
00296 
00308     DMAN3_ScratchFreeFxn scratchFreeFxn;
00309 
00316     Uns nullPaRamIndex;
00317 
00322     Uns     maxTCs;  
00323 
00331     Uns   *qdmaQueueMap; 
00332 
00337     Uns   *queueTCMap;
00338 
00343     Uns   *queuePri;
00344 
00372     Bool allowUnshared;
00373 } DMAN3_Params;
00374 
00375 
00379 extern DMAN3_Params DMAN3_PARAMS;
00380 
00385 extern Uns ti_sdo_fc_dman3_DMAN3_numQdmaGroup[DMAN3_MAXGROUPS + 1];
00386 
00387 
00431 extern Int DMAN3_grantDmaChannels(Int groupId, IALG_Handle algHandle[],
00432         IDMA3_Fxns *dmaFxns[], Int numAlgs);
00433 
00437 extern Void DMAN3_exit(Void);
00438 
00480 extern Int DMAN3_createChannels(Int groupId, IDMA3_ChannelRec dmaTab[],
00481         Int numChans);
00482 
00483 
00491 extern Void DMAN3_init(Void);
00492 
00493 
00515 extern Int  DMAN3_releaseDmaChannels(IALG_Handle algHandle[],
00516     IDMA3_Fxns *dmaFxns[], Int numAlgs);
00517 
00518 
00534 extern Int DMAN3_freeChannels(IDMA3_Handle channelTab[], Int numChans);
00535 
00536 
00537 #ifdef __cplusplus
00538 }
00539 #endif /* extern "C" */
00540 
00541 
00544 #endif
00545 /*
00546  *  @(#) ti.sdo.fc.dman3; 1, 0, 4,300; 12-1-2010 17:24:25; /db/atree/library/trees/fc/fc-p01x/src/ xlibrary
00547 
00548  */
00549 

Copyright 2010, Texas Instruments Incorporated