dskt2.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2012, 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  */
00048 #ifndef DSKT2_
00049 #define DSKT2_
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 
00057 
00058 #include <xdc/std.h>
00059 #include <xdc/runtime/IHeap.h>
00060 
00061 #include <ti/xdais/ialg.h>
00062 #include <ti/xdais/ires.h>
00063 #include <stddef.h>
00064 
00065 #define DSKT2_NUM_SCRATCH_GROUPS 20     
00069 #define DSKT2_MAX_MEM_ALLOCATION_SIZE  0xFFFF   
00073 /* NOTE: DO NOT Change NUM_SHAREDHEAPS*/
00074 #define DSKT2_NUM_SHAREDHEAPS 2
00075 
00084 #define DSKT2_MODNAME  "ti.sdo.fc.dskt2"
00085 
00093 typedef Void (*DSKT2_CacheWBInvFxn)(Ptr blockPtr, size_t byteCnt, Bool wait);
00094 
00095 
00099 extern __FAR__ DSKT2_CacheWBInvFxn DSKT2_cacheWBInvFxn;
00100 
00101 /* TODO: Should these be declared here ? User should know they can initialize 
00102          these entries */ 
00103 extern xdc_runtime_IHeap_Handle DSKT2_daram0Heap;
00104 extern xdc_runtime_IHeap_Handle DSKT2_daram1Heap;
00105 extern xdc_runtime_IHeap_Handle DSKT2_daram2Heap;
00106 extern xdc_runtime_IHeap_Handle DSKT2_saram0Heap;
00107 extern xdc_runtime_IHeap_Handle DSKT2_saram1Heap;
00108 extern xdc_runtime_IHeap_Handle DSKT2_saram2Heap;
00109 extern xdc_runtime_IHeap_Handle DSKT2_iprogHeap;
00110 extern xdc_runtime_IHeap_Handle DSKT2_eprogHeap;
00111 extern xdc_runtime_IHeap_Handle DSKT2_esdataHeap;
00112 extern xdc_runtime_IHeap_Handle _DSKT2_heap;
00113 
00114 extern __FAR__ UInt _DSKT2_ALLOW_EXTERNAL_SCRATCH;
00115 
00116 extern UInt _DSKT2_DARAM_SCRATCH_SIZES[];
00117 extern UInt _DSKT2_SARAM_SCRATCH_SIZES[];
00118 
00119 /* ENDTODO */
00120 
00124 extern __FAR__ Bool ti_sdo_fc_dskt2_DSKT2_disableLazyDeactivate; 
00125 
00190 extern Void DSKT2_activateAlg(Int scratchMutexId, IALG_Handle alg);
00191 
00192 
00225 extern Int DSKT2_controlAlg(IALG_Handle alg, IALG_Cmd cmd,
00226     IALG_Status *status);
00227 
00228 
00307 extern IALG_Handle DSKT2_createAlg(Int scratchMutexId, IALG_Fxns * fxns,
00308     IALG_Handle parent, IALG_Params * params);
00309 
00310 
00404 extern IALG_Handle DSKT2_createAlg2(Int scratchMutexId, IALG_Fxns * fxns,
00405         IALG_Handle parent, IALG_Params * params,
00406         xdc_runtime_IHeap_Handle extHeapId);
00407 
00408 
00484 IALG_Handle DSKT2_createAlgExt(Int scratchId, IALG_Fxns * fxns,
00485         IALG_Handle parent, IALG_Params * params);
00486 
00539 extern Void DSKT2_deactivateAlg(Int scratchMutexId, IALG_Handle alg);
00540 
00552 extern Int DSKT2_deactivateAll();
00553 
00588 extern Bool DSKT2_freeAlg(Int scratchMutexId, IALG_Handle alg);
00589 
00619 extern Bool DSKT2_allocScratch(IALG_Handle alg,Int mutexId, IALG_MemRec *memTab,
00620         Int numRecs);
00621 
00622 extern Int DSKT2_getScratchId(IALG_Handle alg);
00623 
00647 extern Void DSKT2_freeScratch(Int mutexId, Void *addr, UInt size);
00648 
00661 extern Bool DSKT2_allocPersistent(IALG_MemRec *memTab, Int numRecs);
00662 
00675 extern Void DSKT2_freePersistent(IALG_MemRec *memTab, Int numRecs);
00676 
00677 /*
00678  * Functions below are friend functions that are used by RMAN and some IRES
00679  * implementations to cooperatively yield to higher priority algorithms.
00680  */
00688 Void DSKT2_yield(IRES_YieldResourceType resource,
00689         IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
00690 
00695 IRES_YieldArgs DSKT2_getYieldArgs(Int scratchId);
00696 
00701 IRES_YieldArgs DSKT2_setYieldArgs(Int scratchId, Bool yieldFlag);
00702 
00703 
00704 Void DSKT2_contextRelease(IRES_YieldResourceType resource,
00705         IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
00706 
00707 Void DSKT2_contextAcquire(IRES_YieldResourceType resource,
00708         IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
00709 
00710 
00714 
00715 #ifdef __cplusplus
00716 }
00717 #endif /* extern "C" */
00718 
00719 #endif  /* DSKT2_ */
00720 
00721 /*
00722  *  @(#) ti.sdo.fc.dskt2; 1, 0, 4,3; 4-16-2012 00:00:24; /db/atree/library/trees/fc/fc-q08/src/ xlibrary
00723 
00724  */
00725 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2012, Texas Instruments Incorporated