Framework Components Application Programming Interface (API)  fc-w02
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dskt2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
48 #ifndef DSKT2_
49 #define DSKT2_
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
57 
58 #include <xdc/std.h>
59 #include <xdc/runtime/IHeap.h>
60 
61 #include <ti/xdais/ialg.h>
62 #include <ti/xdais/ires.h>
63 #include <stddef.h>
64 
65 #define DSKT2_NUM_SCRATCH_GROUPS 20
69 #define DSKT2_MAX_MEM_ALLOCATION_SIZE 0xFFFF
73 /* NOTE: DO NOT Change NUM_SHAREDHEAPS*/
74 #define DSKT2_NUM_SHAREDHEAPS 2
75 
84 #define DSKT2_MODNAME "ti.sdo.fc.dskt2"
85 
93 typedef Void (*DSKT2_CacheWBInvFxn)(Ptr blockPtr, size_t byteCnt, Bool wait);
94 
95 
100 
101 /* TODO: Should these be declared here ? User should know they can initialize
102  these entries */
103 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_daram0Heap;
104 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_daram1Heap;
105 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_daram2Heap;
106 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_saram0Heap;
107 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_saram1Heap;
108 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_saram2Heap;
109 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_iprogHeap;
110 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_eprogHeap;
111 extern __FAR__ xdc_runtime_IHeap_Handle DSKT2_esdataHeap;
112 extern __FAR__ xdc_runtime_IHeap_Handle _DSKT2_heap;
113 
114 extern __FAR__ UInt _DSKT2_ALLOW_EXTERNAL_SCRATCH;
115 
116 extern __FAR__ UInt _DSKT2_DARAM_SCRATCH_SIZES[];
117 extern __FAR__ UInt _DSKT2_SARAM_SCRATCH_SIZES[];
118 
119 /* ENDTODO */
120 
125 
190 extern Void DSKT2_activateAlg(Int scratchMutexId, IALG_Handle alg);
191 
192 
225 extern Int DSKT2_controlAlg(IALG_Handle alg, IALG_Cmd cmd,
226  IALG_Status *status);
227 
228 
307 extern IALG_Handle DSKT2_createAlg(Int scratchMutexId, IALG_Fxns * fxns,
308  IALG_Handle parent, IALG_Params * params);
309 
310 
404 extern IALG_Handle DSKT2_createAlg2(Int scratchMutexId, IALG_Fxns * fxns,
405  IALG_Handle parent, IALG_Params * params,
406  xdc_runtime_IHeap_Handle extHeapId);
407 
408 
484 IALG_Handle DSKT2_createAlgExt(Int scratchId, IALG_Fxns * fxns,
485  IALG_Handle parent, IALG_Params * params);
486 
539 extern Void DSKT2_deactivateAlg(Int scratchMutexId, IALG_Handle alg);
540 
552 extern Int DSKT2_deactivateAll();
553 
588 extern Bool DSKT2_freeAlg(Int scratchMutexId, IALG_Handle alg);
589 
619 extern Bool DSKT2_allocScratch(IALG_Handle alg,Int mutexId, IALG_MemRec *memTab,
620  Int numRecs);
621 
622 extern Int DSKT2_getScratchId(IALG_Handle alg);
623 
647 extern Void DSKT2_freeScratch(Int mutexId, Void *addr, UInt size);
648 
661 extern Bool DSKT2_allocPersistent(IALG_MemRec *memTab, Int numRecs);
662 
675 extern Void DSKT2_freePersistent(IALG_MemRec *memTab, Int numRecs);
676 
677 /*
678  * Functions below are friend functions that are used by RMAN and some IRES
679  * implementations to cooperatively yield to higher priority algorithms.
680  */
688 Void DSKT2_yield(IRES_YieldResourceType resource,
689  IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
690 
695 IRES_YieldArgs DSKT2_getYieldArgs(Int scratchId);
696 
701 IRES_YieldArgs DSKT2_setYieldArgs(Int scratchId, Bool yieldFlag);
702 
703 
704 Void DSKT2_contextRelease(IRES_YieldResourceType resource,
705  IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
706 
707 Void DSKT2_contextAcquire(IRES_YieldResourceType resource,
708  IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
709 
715 Int DSKT2_getNumAlgs();
716 
727 Int DSKT2_getAlgList(IALG_Handle * algList, Int * scratchIds);
728 
732 
733 #ifdef __cplusplus
734 }
735 #endif /* extern "C" */
736 
737 #endif /* DSKT2_ */
Int DSKT2_deactivateAll()
All algorithms that have been deactivated lazily are now really deactivate. Any algorithms that are s...
Void DSKT2_freeScratch(Int mutexId, Void *addr, UInt size)
Alocates memory from a DSKT2 shared scratch group buffer.
Bool DSKT2_freeAlg(Int scratchMutexId, IALG_Handle alg)
Deletes a XDAIS algorithm instance object and frees all persistent memory allocated for the instance ...
__FAR__ xdc_runtime_IHeap_Handle DSKT2_daram1Heap
__FAR__ xdc_runtime_IHeap_Handle DSKT2_daram2Heap
__FAR__ xdc_runtime_IHeap_Handle DSKT2_iprogHeap
__FAR__ xdc_runtime_IHeap_Handle DSKT2_saram1Heap
IALG_Handle DSKT2_createAlgExt(Int scratchId, IALG_Fxns *fxns, IALG_Handle parent, IALG_Params *params)
Creates and initializes a XDAIS algorithm instance object, allocating all algorithm memory in externa...
Memory records.
Definition: ialg.h:142
Pointer to algorithm specific status structure.
Definition: ialg.h:187
Algorithm instance object definition.
Definition: ialg.h:159
Void DSKT2_freePersistent(IALG_MemRec *memTab, Int numRecs)
Frees persistent memory from the requesting algorithm.
__FAR__ UInt _DSKT2_ALLOW_EXTERNAL_SCRATCH
Void DSKT2_activateAlg(Int scratchMutexId, IALG_Handle alg)
Prepares a XDAIS algorithm instance object to start using its scratch memory.
__FAR__ DSKT2_CacheWBInvFxn DSKT2_cacheWBInvFxn
Cache writeback function pointer used by DSKT2 if not NULL.
Bool DSKT2_allocPersistent(IALG_MemRec *memTab, Int numRecs)
Alocates persistent memory to the requesting algorithm.
Algorithm instance creation parameters.
Definition: ialg.h:176
IRES Interface Definitions - Allows algorithms to request and receive handles representing private lo...
__FAR__ xdc_runtime_IHeap_Handle _DSKT2_heap
Void(* DSKT2_CacheWBInvFxn)(Ptr blockPtr, size_t byteCnt, Bool wait)
Function prototype of cache writeback function: Writes back the memory within the range of blockPtr a...
Definition: dskt2.h:97
__FAR__ xdc_runtime_IHeap_Handle DSKT2_esdataHeap
This header defines all types, constants, and functions defined by XDAIS for algorithms.
__FAR__ Bool ti_sdo_fc_dskt2_DSKT2_disableLazyDeactivate
Set this to TRUE to disable lazy deactivate feature in DSKT2.
IALG_Handle DSKT2_createAlg(Int scratchMutexId, IALG_Fxns *fxns, IALG_Handle parent, IALG_Params *params)
Creates and initializes a XDAIS algorithm instance object.
Bool DSKT2_allocScratch(IALG_Handle alg, Int mutexId, IALG_MemRec *memTab, Int numRecs)
Alocates memory from a DSKT2 shared scratch group buffer.
Defines the fields and methods that must be supplied by all XDAIS algorithms.
Definition: ialg.h:225
IALG_Handle DSKT2_createAlg2(Int scratchMutexId, IALG_Fxns *fxns, IALG_Handle parent, IALG_Params *params, xdc_runtime_IHeap_Handle extHeapId)
Creates and initializes a XDAIS algorithm instance object.
Int DSKT2_controlAlg(IALG_Handle alg, IALG_Cmd cmd, IALG_Status *status)
This is a convenience API to call a XDAIS algorithm instance&#39;s algControl function.
__FAR__ xdc_runtime_IHeap_Handle DSKT2_eprogHeap
__FAR__ UInt _DSKT2_DARAM_SCRATCH_SIZES[]
__FAR__ xdc_runtime_IHeap_Handle DSKT2_saram0Heap
__FAR__ xdc_runtime_IHeap_Handle DSKT2_daram0Heap
__FAR__ xdc_runtime_IHeap_Handle DSKT2_saram2Heap
Specifies the algorithm specific handles and context save &amp; restore function pointers and arguments t...
Definition: ires.h:84
Void * IRES_YieldArgs
Definition: ires.h:140
Void DSKT2_deactivateAlg(Int scratchMutexId, IALG_Handle alg)
Prepares a XDAIS algorithm instance object to give up using its scratch memory.
Int DSKT2_getScratchId(IALG_Handle alg)
__FAR__ UInt _DSKT2_SARAM_SCRATCH_SIZES[]
unsigned int IALG_Cmd
Algorithm specific command.
Definition: ialg.h:199
IRES_YieldResourceType
Definition: ires.h:60
Copyright 2014, Texas Instruments Incorporated