dman3.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2009, 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  
00079 #define DMAN3_SOK             0  
00080 #define DMAN3_EOUTOFMEMORY   -1  
00083 #define DMAN3_EFAIL          -2  
00084 #define DMAN3_EFREE          -3  
00086 #define DMAN3_EOUTOFTCCS     -4  
00089 #define DMAN3_EOUTOFPARAMS   -5  
00092 #define DMAN3_ETCCCONFIG     -6  
00098 #define DMAN3_EPARAMCONFIG   -7  
00105 
00106 
00115 typedef Bool (*DMAN3_ScratchAllocFxn)(IALG_Handle alg, Int mutexId,
00116         IALG_MemRec *memTab, Int numRecs);
00117 
00123 typedef Void (*DMAN3_ScratchFreeFxn)(Int mutexId, Void *addr, Uns size);
00124 
00125 
00136 typedef struct DMAN3_Params {
00143     Uns    *qdmaPaRamBase;
00144 
00151     Uns     maxPaRamEntries;
00152 
00162     Uns     paRamBaseIndex;
00163 
00171     Uns     numPaRamEntries;
00172 
00179     Uns     maxQdmaChannels;
00180 
00187     Uns     numQdmaChannels;
00188 
00196     Uns    *qdmaChannels;
00197 
00211     Uns     tccAllocationMaskH;
00212 
00226     Uns     tccAllocationMaskL;
00227 
00238     Int heapInternal;
00239 
00251     Int heapExternal;
00252 
00261     unsigned char numTccGroup[DMAN3_MAXGROUPS];    
00271     unsigned short numPaRamGroup[DMAN3_MAXGROUPS];  
00282     Bool          idma3Internal;
00283 
00296     DMAN3_ScratchAllocFxn scratchAllocFxn;
00297 
00309     DMAN3_ScratchFreeFxn scratchFreeFxn;
00310 
00317     Uns nullPaRamIndex;
00318 
00323     Uns     maxTCs;  
00324 
00332     Uns   *qdmaQueueMap; 
00333 
00338     Uns   *queueTCMap;
00339 
00344     Uns   *queuePri;
00345 
00373     Bool allowUnshared;
00374 } DMAN3_Params;
00375 
00376 
00380 extern DMAN3_Params DMAN3_PARAMS;
00381 
00382 
00426 extern Int DMAN3_grantDmaChannels(Int groupId, IALG_Handle algHandle[],
00427         IDMA3_Fxns *dmaFxns[], Int numAlgs);
00428 
00432 extern Void DMAN3_exit(Void);
00433 
00475 extern Int DMAN3_createChannels(Int groupId, IDMA3_ChannelRec dmaTab[],
00476         Int numChans);
00477 
00478 
00486 extern Void DMAN3_init(Void);
00487 
00488 
00510 extern Int  DMAN3_releaseDmaChannels(IALG_Handle algHandle[],
00511     IDMA3_Fxns *dmaFxns[], Int numAlgs);
00512 
00513 
00529 extern Int DMAN3_freeChannels(IDMA3_Handle channelTab[], Int numChans);
00530 
00531 
00532 #ifdef __cplusplus
00533 }
00534 #endif /* extern "C" */
00535 
00536 
00539 #endif
00540 /*
00541  *  @(#) ti.sdo.fc.dman3; 1, 0, 4,278; 11-8-2009 20:57:20; /db/atree/library/trees/fc/fc-l04x/src/
00542  */
00543 

Copyright 2009, Texas Instruments Incorporated