aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common.mk1
-rw-r--r--packages/framework_components/Makefile.am5
-rw-r--r--packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h380
-rw-r--r--packages/xdais/ti/xdais/ires.h276
-rw-r--r--packages/xdais/ti/xdais/ires_common.h207
-rw-r--r--test_qnx/dce_enc_test/common.mk1
-rw-r--r--test_qnx/dce_test/common.mk1
7 files changed, 871 insertions, 0 deletions
diff --git a/common.mk b/common.mk
index 5b0ed0c..007db8e 100644
--- a/common.mk
+++ b/common.mk
@@ -22,6 +22,7 @@ EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/codec_engine
22EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/ivahd_codecs 22EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/ivahd_codecs
23EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdais 23EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdais
24EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdctools 24EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdctools
25EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/framework_components
25 26
26EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr 27EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr
27EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/ti/syslink/ 28EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/ti/syslink/
diff --git a/packages/framework_components/Makefile.am b/packages/framework_components/Makefile.am
new file mode 100644
index 0000000..a02ce9f
--- /dev/null
+++ b/packages/framework_components/Makefile.am
@@ -0,0 +1,5 @@
1## Process this file with automake to produce Makefile.in
2
3pkg_includedir = $(includedir)/dce
4
5nobase_pkg_include_HEADERS = ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
diff --git a/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h b/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
new file mode 100644
index 0000000..c2b0ada
--- /dev/null
+++ b/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
@@ -0,0 +1,380 @@
1/*
2 * Copyright 2013 by Texas Instruments Incorporated.
3 *
4 */
5
6/*
7 * Copyright (c) 2012 - 2013, Texas Instruments Incorporated
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * * Neither the name of Texas Instruments Incorporated nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38/**
39 * @file ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
40 *
41 * @brief IRES PROTOCOL HDVICP2 Interface Definitions -
42 * Allows algorithms to request and receive handles representing
43 * the HDVICP2 resource.
44 */
45
46/**
47 * @addtogroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 IRES HDVICP2 Protocol
48 *
49 * Allows algorithms to request and receive handles representing
50 * HDVICP2 resources.
51 */
52
53#ifndef ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_
54#define ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_
55
56/** @ingroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 */
57/*@{*/
58
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#include <ti/xdais/xdas.h>
65#include <ti/xdais/ires_common.h>
66#include <ti/xdais/ires.h>
67
68/**
69 * @brief Name used to describe this protocol
70 */
71#define IRES_HDVICP2_PROTOCOLNAME "ti.sdo.fc.ires.hdvicp.hdvicp2"
72
73/**
74 * @brief HDVICP2 module name
75 *
76 * @remarks This name can be passed to Diags_setMask() to enable/disable
77 * logging for this module. For example,
78 * Diags_setMask(HDVICP2_MODNAME"+EX1234567");
79 * enables all Log statements in this module.
80 *
81 * @remarks Diags_setMask() must be called after initialization to take
82 * effect.
83 */
84#define HDVICP2_MODNAME "ti.sdo.fc.ires.hdvicp2"
85
86
87/**
88 * @brief Used to specify the resource required in the protocol args,
89 * resource manager will return
90 * an HDVICP2 resource that is available to the scratch group.
91 */
92#define IRES_HDVICP2_ID_ANY -2
93
94/**
95 * @brief Used to specify the resource required for protocol args, late acquire
96 * implies that no resource is to be returned right now, resource will be
97 * acquired later in the process call, using the acquire fxn returned
98 * via the IRES_HDVICP2_Handle.
99 */
100#define IRES_HDVICP2_ID_LATE_ACQUIRE -1
101
102/**
103 * @brief Invalid address
104 *
105 * @remarks Indicates the address returned in the IRES_HDVICP2_Handle
106 * is not yet valid, and should not be used.
107 */
108#define IRES_HDVICP2_INVALID_ADDR 0xFFFFFFFF
109
110/**
111 * @brief Wait forever (never timeout)
112 *
113 * @remarks Used to indicate to IRES_HDVICP2_Obj::wait() that the call
114 * should never timeout.
115 */
116#define IRES_HDVICP2_TIMEOUTFOREVER ((UInt)(-1))
117
118/**
119 * @brief Unknown late acquire argument.
120 *
121 * @remarks This definition should be used when a particular algorithm
122 * doesn't have an application-provided late acquire argument.
123 * The codec should supply IRES_HDVICP2_UNKNOWNLATEACQUIREARG
124 * as the argument to acquire() in this case.
125 *
126 * @sa XDM_CmdId::XDM_SETLATEACQUIREARG
127 */
128#define IRES_HDVICP2_UNKNOWNLATEACQUIREARG (-1)
129
130/*
131 * Note, we wrap the PROTOCOLVERSION in an ifdef so the
132 * resource managers and algs get this version data placed in their object
133 * files. Apps, which include rman.h, will have this 'NOPROTOCOLREV' defined.
134 */
135#ifndef ti_sdo_fc_ires_NOPROTOCOLREV
136
137/**
138 * @brief Protocol Revision for this resource
139 */
140static IRES_ProtocolRevision IRES_HDVICP2_PROTOCOLREVISION = { 1, 0, 0 };
141
142#endif
143
144/**
145 * @brief Handle to "logical" resource
146 */
147typedef struct IRES_HDVICP2_Obj *IRES_HDVICP2_Handle;
148
149
150/**
151 * @brief Timeout value to be used by implementation of
152 * IRES_HDVICP2_Handle:wait function
153 */
154extern unsigned int ti_sdo_fc_ires_hdvicp_HDVICP2_timeoutVal;
155
156/**
157 * @brief
158 */
159typedef IRES_YieldArgs (*ti_sdo_fc_ires_hdvicp_HDVICP2_GetYieldArgsFxn)
160 (Int scratchId);
161
162/**
163 * @brief
164 */
165typedef Void (*ti_sdo_fc_ires_hdvicp_HDVICP2_YieldFxn)
166 (IRES_YieldResourceType resource, IRES_YieldContextHandle ctxt,
167 IRES_YieldArgs args);
168
169
170
171/**
172 * @brief HDVICP2 Protocol Arguments definition.
173 */
174typedef struct IRES_HDVICP2_ProtocolArgs {
175
176 IRES_ProtocolArgs base; /**< Base protocol Args */
177 XDAS_Int32 id; /**< HDVICP2 resource being requested.
178 *
179 * @remarks Could be 0, 1, 2,
180 * IRES_HDVICP2_ID_ANY or
181 * IRES_HDVICP2_ID_LATE_ACQUIRE.
182 */
183} IRES_HDVICP2_ProtocolArgs;
184
185/**
186 * @brief Callback function signature, used by the IRES_HDVICP2_
187 * Handle's configure function
188 */
189typedef void (*IRES_HDVICP2_CallbackFxn)(IALG_Handle handle, Void *args);
190
191/**
192 * @brief Describes the status/history of the HDVICP2 unit that is
193 * returned by the acquire call. This information can be
194 * used by the codec to avoid reloading the data memory or
195 * the program memory in the HDVICP2.
196 *
197 * @enumWarning
198 */
199typedef enum IRES_HDVICP2_Status {
200 SAMECODEC = 0, /**< Same codec was granted this unit, last time */
201 SAMECODECTYPE = 1, /**< Different codec, but of the same codec class
202 was granted this unit last time */
203 DIFFERENTCODEC = 2 /**< Completely different codec ran last time */
204} IRES_HDVICP2_Status;
205
206
207/**
208 * @brief IRES_HDVICP2_Obj extends the generic IRES_Obj structure
209 * that is returned back to the algorithm requesting the
210 * resource.
211 */
212typedef struct IRES_HDVICP2_Obj {
213
214 IRES_Obj ires; /**< Base IRES_Obj struct */
215 Void *info; /**< Reserved for future use */
216 XDAS_Int32 id; /**< HDVICP2 id granted
217 *
218 * @remark Could be 0, 1, 2, or
219 * LATE_ACQUIRE
220 */
221 XDAS_Void *registerBaseAddress; /**< Register space base address of the
222 * HDVICP2 being granted
223 */
224 XDAS_Void *memoryBaseAddress; /**< Memory space base address of the
225 * HDVICP2 being granted
226 */
227 XDAS_Void *resetControlAddress; /**< HDVICP reset controller address
228 *
229 * @remarks bit 0 -> ICONT1 reset,
230 * bit 1 -> ICONT2 reset
231 */
232
233 /**
234 * @brief Acquire the HDVICP2 resource.
235 *
236 * @remarks This call acquires the HDVICP resource which the alg may
237 * (or may not) have specifically requested.
238 *
239 * @remarks The returned @c hdvicp2Status indicates the status of
240 * the particular HDVICP2 unit that is returned.
241 * @sa IRES_HDVICP2_Status
242 *
243 * @remarks The @c configurationId argument is a codec specified
244 * parameter that is both an input and output parameter. It
245 * specifies the mode in which this particular HDVICP2 was
246 * used last time, and the mode in which it will be
247 * used this time.
248 *
249 * @remarks This API takes a @c yieldContext as argument, as it may
250 * yield the processor to higher priority codecs in the
251 * system.
252 *
253 * @remarks @c lateAcquireId is an optionally framework supplied
254 * parameter (sometimes provided via an XDM control() call
255 * setting the XDM_SETLATEACQUIREARG. If not supplied, the
256 * codec should pass the value
257 * #IRES_HDVICP2_UNKNOWNLATEACQUIREARG.
258 *
259 * @sa IRES_HDVICP2_UNKNOWNLATEACQUIREARG
260 */
261 XDAS_Void (*acquire)(IALG_Handle algHandle,
262 struct IRES_HDVICP2_Obj *hdvicpHandle,
263 IRES_YieldContext *yieldCtxt, XDAS_UInt32 *hdvicp2Status,
264 XDAS_UInt32 *configurationId, XDAS_Int32 lateAcquireArg);
265
266 /**
267 * @brief Release the HDVICP2 resource.
268 *
269 * @remarks This makes the resource available for use by other algorithms.
270 */
271 XDAS_Void (*release)(IALG_Handle algHandle,
272 struct IRES_HDVICP2_Obj *hdvicpHandle);
273
274 /**
275 * @brief Reacquire the HDVICP2 resource recent released.
276 *
277 * @returns XDAS_TRUE The resource was not yet acquired by another
278 * algorithm, and the resource handle is still
279 * valid.
280 * @returns XDAS_FALSE The resource is no longer available and has been
281 * deactivated.
282 */
283 XDAS_UInt32 (*reacquireIfOwner)(IALG_Handle algHandle,
284 struct IRES_HDVICP2_Obj *hdvicpHandle);
285
286 /**
287 * @brief Register a callback function with a HDVICP2 instance.
288 *
289 * @remarks The callback is invoked when an interrupt fires after
290 * processing data.
291 *
292 * @remarks It is the algorithm's responsibility to configure the HDVICP2
293 * to process data and fire the interrupt when done.
294 */
295 XDAS_Void (*configure)(IALG_Handle algHandle,
296 struct IRES_HDVICP2_Obj *hdvicpHandle,
297 IRES_HDVICP2_CallbackFxn cbFunctionPtr, XDAS_Void *cbArgs);
298
299 /**
300 * @brief Wait until the HDVICP2 is done processing and then return.
301 *
302 * @remarks This is a blocking call, unless a positive timeout value
303 * is configured, inwhich case the call returns after timeout.
304 *
305 * @remarks This function is passed a yieldContext, and will relinquish
306 * the processor while it waits for the HDVICP2 to finish the
307 * processing and return from wait.
308 *
309 * @returns XDAS_TRUE Success
310 * @returns XDAS_FALSE Failure/Timeout
311 */
312 XDAS_UInt32 (*wait)(IALG_Handle algHandle,
313 struct IRES_HDVICP2_Obj *hdvicpHandle,
314 IRES_YieldContext *yieldCtxt);
315
316 /**
317 * @brief Processing has completed.
318 *
319 * @remarks This is called from within the interrupt handler function when
320 * processing completes, and is used to unblock the wait() API.
321 *
322 * @remarks Typically, this is called from within the algortihm's callback
323 * function (see acquire() call).
324 */
325 XDAS_Void (*done)(IALG_Handle algHandle,
326 struct IRES_HDVICP2_Obj *hdvicpHandle);
327 /**
328 * @brief Reset the HDVICP2.
329 *
330 * @remarks This can be called by the algorithm to "reset" the HDVICP2, and
331 * is usually called when an acquired HDVICP2 is "dirty", i.e, it
332 * requires both program/data reload.
333 *
334 * @remarks It works off a configured maximum reset cycle delay.
335 *
336 * @returns XDAS_TRUE Success
337 * @returns XDAS_FALSE Failure
338 */
339 XDAS_UInt32 (*reset)(IALG_Handle algHandle,
340 struct IRES_HDVICP2_Obj *hdvicpHandle);
341
342} IRES_HDVICP2_Obj;
343
344
345/**
346 * @brief HDVICP2 Register Layout
347 */
348typedef struct IRES_HDVICP2_RegisterLayer {
349
350 int size;
351 /* TBD */
352} IRES_HDVICP2_RegisterLayer;
353
354/**
355 * @brief Static Resource Properties
356 */
357typedef struct IRES_HDVICP2_Properties {
358
359 int size;
360 IRES_HDVICP2_RegisterLayer *globalRegs; /* Register layer of HDVICP2 */
361} IRES_HDVICP2_Properties;
362
363typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_GetHdvicp2Fxn)
364 (XDAS_Int32 *Id, IALG_Handle alg, IRES_HDVICP2_Handle handle);
365
366typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_FreeHdvicp2Fxn)
367 (XDAS_Int32 Id, IALG_Handle alg, IRES_HDVICP2_Handle handle);
368
369#ifdef __cplusplus
370}
371#endif /* extern "C" */
372
373/*@}*/
374
375#endif
376/*
377 * @(#) ti.sdo.fc.ires.hdvicp; 1, 0, 1,1; 6-12-2013 19:57:33; /db/atree/library/trees/fc/fc-t09/src/ xlibrary
378
379 */
380
diff --git a/packages/xdais/ti/xdais/ires.h b/packages/xdais/ti/xdais/ires.h
new file mode 100644
index 0000000..ee066b7
--- /dev/null
+++ b/packages/xdais/ti/xdais/ires.h
@@ -0,0 +1,276 @@
1/*
2 * Copyright (c) 2006-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 */
33/**
34 * @file ti/xdais/ires.h
35 *
36 * @brief IRES Interface Definitions - Allows algorithms to
37 * request and receive handles representing private logical
38 * resources.
39 */
40
41/**
42 * @defgroup DSPIRES IRES
43 *
44 * The IRES interface enables algorithms to request and
45 * receive handles representing private logical resources.
46 */
47#ifndef IRES_
48#define IRES_
49
50/** @ingroup DSPIRES */
51/*@{*/
52
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#include "ires_common.h"
59
60typedef enum IRES_YieldResourceType {
61 IRES_ALL = 0, /**< Yielding all resources held by the
62 * algorithm.
63 */
64 IRES_SCRATCHMEMORY, /**< Yielding all scratch memory
65 * resources held by the algorithm.
66 */
67 IRES_SCRATCHDMA, /**< Yielding all IDMA3 resources held
68 * by the algorithm.
69 */
70 IRES_RESOURCEHANDLE /**< Yielding IRES resource handle only.
71 */
72
73} IRES_YieldResourceType;
74
75typedef Void (*IRES_ContextSaveFxn)(IALG_Handle algHandle, Void *contextArgs);
76typedef Void (*IRES_ContextRestoreFxn)
77 (IALG_Handle algHandle, Void *contextArgs);
78
79/**
80 * @brief Specifies the algorithm specific handles
81 * and context save & restore function pointers and arguments
82 * that the framework will call during a context switch.
83 */
84typedef struct IRES_YieldContext {
85
86 /**
87 * Handle of the algorithm instance issuing the "yield".
88 */
89 IALG_Handle algHandle;
90
91 /**
92 * Optional resource handle that may be used to yield a particular
93 * IRES resource.
94 * May be NULL when some other resource or ALL resources associated
95 * with an algorithm are to be yielded.
96 */
97 IRES_Handle resourceHandle;
98
99 /**
100 * The 'contextSave' function is implemented by the 'yielding' algorithm
101 * instance and must be called by the framework whenever the 'yield'
102 * results in a context switch.
103 * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must
104 * be considered in volatile state during a 'yield' call, and must be
105 * re-initialized and activated following any context switch.
106 * The 'contextSave' function must save any volatile state information in
107 * its persistent memory that it needs in the subsequent 'contextRestore'
108 * function call to re-initialize and activate its scratch resources.
109 */
110 IRES_ContextSaveFxn contextSave;
111
112 /**
113 * The 'contextRestore' function is implemented by the 'yielding' algorithm
114 * instance and must be called by the framework following a context switch
115 * which occured as a result of the 'yield', prior to returning from the
116 * framework supplied 'yield-function'.
117 *
118 * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must
119 * be considered in volatile state during a 'yield' call, and must be
120 * re-initialized and activated following any context swith.
121 * The 'contextRestore' function uses the saved context information in
122 * the preceeding 'contextSave' call to re-initialize and activate its
123 * scratch resources.
124 */
125 IRES_ContextRestoreFxn contextRestore;
126
127 /**
128 * The arguments that must be passed when calling the 'contextSave()'
129 * and 'contextRestore()' functions.
130 * The algorithm instance calling the 'yield function' optionally
131 * supplies any 'contextArgs' that it wants the framework to passed to the
132 * 'contextSave()' and 'contextRestore()' functions.
133 */
134 Void *contextArgs;
135
136} IRES_YieldContext;
137
138
139typedef IRES_YieldContext *IRES_YieldContextHandle;
140typedef Void *IRES_YieldArgs;
141
142/**
143 * @brief The 'yield function' pointer and 'yield arguments' are supplied
144 * to an algorithm during its IRES interface 'initialization'.
145 * The algorithm optionally calls the yield function during its
146 * 'process' stages for co-operative multi-tasking and pre-emption
147 * by a higher priority algorithm.
148 *
149 * An operating system level context switch may occur during the
150 * yield call. Whenever a context switch occurs, all
151 * scratch resources owned by the yielding algorithm must be
152 * context saved prior to the context switch and restored and
153 * initialized prior to 'resumption' by the framework/application.
154 * The 'yielding' algorithm must supply the IRES_YieldContext and
155 * the 'yield arguments' it received during IRES initialization.
156 * The framework calls the context save & restore functions
157 * provided by the yielding algorithm's IRES_YieldContext.
158 */
159typedef Void (*IRES_YieldFxn)(IRES_YieldResourceType resourceType,
160 IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
161
162/**
163 * @brief These fxns are used to query/grant the resources requested
164 * by the algorithm at initialization time, and to change these
165 * resources at runtime. All these fxns are implemented by the
166 * algorithm, and called by the client of the algorithm.
167 */
168typedef struct IRES_Fxns {
169
170 /**
171 * @brief Unique pointer that identifies the module implementing this
172 * interface.
173 */
174 Void *implementationId;
175
176 /**
177 * @brief Query function to obtain the list of IRES resources requested
178 * by the algorithm instance.
179 */
180 IRES_Status (*getResourceDescriptors)(IALG_Handle handle,
181 IRES_ResourceDescriptor *resourceDescriptors);
182
183 /**
184 * @brief Query function to obtain the number of IRES resources
185 * requested by the algorithm instance, which is also the number
186 * of resource descriptors that must be passed to the
187 * getResourceDescriptors() function.
188 *
189 */
190 Int32 (*numResourceDescriptors)(IALG_Handle handle);
191
192 /**
193 * @brief Assignment function to grant the algorithm instance the list
194 * of IRES resources it requested. The algorithm can initialize
195 * internal instance memory with resource information, but may not
196 * use or access the resource state until the resource is
197 * activated via the activateResource call.
198 *
199 * @remark Version of the resource handle being granted is updated in
200 * the resourceDescriptor, and may be different from the one
201 * requested.
202 */
203 IRES_Status (*initResources)(IALG_Handle handle,
204 IRES_ResourceDescriptor *resourceDescriptor,
205 IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs);
206
207 /**
208 * @brief Re-assignment function to grant the algorithm instance
209 * a list of "modified" IRES resources.
210 * The algorithm may choose to not support the re-assignment and
211 * indicate this by returning failure.
212 * In case of success the algorithm updates its internal state
213 * to reflect the new resource information, but may not
214 * use or access the resource state until the resource is
215 * activated via the activateResource call.
216 */
217 IRES_Status (*reinitResources)(IALG_Handle handle,
218 IRES_ResourceDescriptor *resourceDescriptor,
219 IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs);
220
221 /**
222 * @brief Deinitialization function to revoke back the resources
223 * that have been granted to the algorithm instance.
224 */
225 IRES_Status (*deinitResources)(IALG_Handle handle,
226 IRES_ResourceDescriptor *resourceDescriptor);
227
228 /**
229 * @brief Resource Activation call to grant the algorithm instance
230 * exclusive access to the potentially shared resource.
231 * Algorithm can now access, initialize and or restore from a
232 * previous context saved during deactivation to use the resource.
233 * Each resource must be activated individually to give the
234 * framework optimization opportunities by tracking and deciding
235 * which resources truely require activation.
236 */
237 IRES_Status (*activateResource)(IALG_Handle handle,
238 IRES_Handle resourceHandle);
239
240 /**
241 * @brief Resource Activation call to grant the algorithm instance
242 * exclusive access to all resources it acquired via IRES.
243 * Algorithm can now access, initialize and or restore from a
244 * previous context saved during deactivation to use the resources.
245 */
246 IRES_Status (*activateAllResources)(IALG_Handle handle);
247
248 /**
249 * @brief Resource Deactivation call to revoke the algorithm instance's
250 * exclusive access to the potentially shared resource.
251 * Algorithm must save any context that is needed to restore the
252 * state during the next resource activation call.
253 */
254 IRES_Status (*deactivateResource)(IALG_Handle handle,
255 IRES_Handle resourceHandle);
256
257 /**
258 * @brief Resource Deactivation call to revoke the algorithm instance's
259 * exclusive access to ALL shared resources.
260 * Algorithm must save any context that is needed to restore the
261 * state during the next resource activation call.
262 */
263 IRES_Status (*deactivateAllResources)(IALG_Handle handle);
264
265} IRES_Fxns;
266
267/*@}*/
268
269
270#ifdef __cplusplus
271}
272#endif /* extern "C" */
273
274
275#endif /* IRES_ */
276
diff --git a/packages/xdais/ti/xdais/ires_common.h b/packages/xdais/ti/xdais/ires_common.h
new file mode 100644
index 0000000..5562d45
--- /dev/null
+++ b/packages/xdais/ti/xdais/ires_common.h
@@ -0,0 +1,207 @@
1/*
2 * Copyright (c) 2006-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 */
33/**
34 * @file ti/xdais/ires_common.h
35 *
36 * @brief IRES Resource Protocol Definitions - IRES Resource
37 */
38
39#ifndef IRES_COMMON_
40#define IRES_COMMON_
41
42/** @ingroup DSPIRES */
43/*@{*/
44
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#include "ialg.h"
51
52
53/**
54 * @brief IRES_Status defines the standard error and success codes
55 * returned by IRES APIs.
56 */
57typedef enum IRES_Status {
58 IRES_OK = 0, /**< Success */
59 IRES_EALG = 1, /**< Error in algorithm IRES_Fxns functions */
60 IRES_EEXISTS = 2, /**< Error, already exists */
61 IRES_EFAIL = 3, /**< Generic Error Message */
62 IRES_EINIT = 4, /**< Error, already initialized */
63 IRES_ENOINIT = 5, /**< Error, not initialized */
64 IRES_ENOMEM = 6, /**< Error, not enough memory */
65 IRES_ENORESOURCE = 7, /**< Error, resource unavailable*/
66 IRES_ENOTFOUND = 8 /**< Error, not found */
67} IRES_Status;
68
69/**
70 * @brief Protocol revision type.
71 * Used to ensure the given 'protocol' revision can be validated.
72 */
73typedef struct IRES_ProtocolRevision {
74 unsigned int Major;
75 unsigned int Source;
76 unsigned int Radius; /* Using unsigned int here to support
77 * xdc/std.h as well as tistdtypes.h
78 */
79} IRES_ProtocolRevision;
80
81
82/**
83 * @brief Mode in which resources can be requested.
84 */
85typedef enum IRES_RequestMode {
86 IRES_SCRATCH, /**< Indicates that resource requested
87 * can be shared with other
88 * algorithms in the same group.
89 */
90 IRES_PERSISTENT, /**< Indicates that resource requested
91 * for allocation exclusively for
92 * this algorithm.
93 */
94 IRES_LATEACQUIRE /**< Indicates that resource requested
95 * will not be granted immediately, but
96 * afterwards. Specific IRES APIs will need
97 * to be called, to ensure that a particular
98 * algorithm is the only user of these
99 * resources.
100 */
101} IRES_RequestMode;
102
103
104/**
105 * @brief Abstract Protocol Arguments structure definition.
106 * Actual arguments passed by the algorithm to request a resource
107 * from a specific IRES Protocol will extend and supply the
108 * concrete definitions.
109 */
110typedef struct IRES_ProtocolArgs {
111
112 Int32 size; /**< Size of this structure. */
113 IRES_RequestMode mode; /**< Resource request mode.
114 *
115 * @sa IRES_RequestMode
116 */
117} IRES_ProtocolArgs;
118
119/**
120 * @brief Descriptor to Logical Resource.
121 */
122typedef struct IRES_ResourceDescriptor {
123
124 /**
125 * String containing the package name to identify the resource.
126 */
127 String resourceName;
128
129 /**
130 * @brief Pointer to the Resource Protocol Arguments.
131 *
132 * @remark The Resource Manager selects the appropriate resource protocol
133 * based on the supplied @c resourceName, and uses the protocol to
134 * construct the IRES Resource Handle.
135 */
136 struct IRES_ProtocolArgs *protocolArgs;
137
138 /**
139 * @brief The revision of the IRES_ResourceProtocol Interface expected
140 * by the client algorithm.
141 *
142 * @remark Depending on the resource manager implementation,
143 * the returned resource may/may not coincide with the version
144 * being requested. Resource manager will update this field with
145 * the version of the handle it returns (and supports).
146 */
147 IRES_ProtocolRevision *revision;
148
149 /**
150 * The handle to the object representing the requested resource.
151 * The handle is initially set to 'null' by the requesting algorithm.
152 * The 'resource manager' allocates the resource and constructs the
153 * handle.
154 */
155 struct IRES_Obj *handle;
156
157} IRES_ResourceDescriptor;
158
159/**
160 * @brief Abstract Resource Properties structure/pointer definition.
161 * Actual resource protocol will supply the concrete property
162 * definitions.
163 * The list of attributes for the actual resource will expose the
164 * relevant features that needs to be known to a client to use the
165 * resource, such as: resource register base addresses and offsets,
166 * critical register and memory region addresses, ...
167 */
168typedef struct IRES_Properties {
169 Int32 size; /**< Size of this structure. */
170} IRES_Properties;
171
172/**
173 * @brief IRES_Obj holds the private state associated with each
174 * logical resource.
175 */
176typedef struct IRES_Obj {
177
178 /**
179 * Indicates if the resource has been allocated as persistent.
180 */
181 Int32 persistent;
182
183 /**
184 * Obtain the static properties associated with this resource
185 * This could include information like the register layer of the
186 * device etc.
187 */
188 Void (*getStaticProperties)(struct IRES_Obj *resourceHandle,
189 IRES_Properties *resourceProperties);
190
191} IRES_Obj;
192
193/**
194 * @brief Handle to "logical" resource
195 */
196typedef struct IRES_Obj *IRES_Handle;
197
198
199
200#ifdef __cplusplus
201}
202#endif /* extern "C" */
203
204/*@}*/
205
206#endif /* IRES_COMMON_ */
207
diff --git a/test_qnx/dce_enc_test/common.mk b/test_qnx/dce_enc_test/common.mk
index 5a79898..5e30a14 100644
--- a/test_qnx/dce_enc_test/common.mk
+++ b/test_qnx/dce_enc_test/common.mk
@@ -20,6 +20,7 @@ EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/codec_engine
20EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs 20EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs
21EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais 21EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais
22EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools 22EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools
23EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/framework_components
23 24
24EXTRA_INCVPATH += $(PROJECT_ROOT)/../../ 25EXTRA_INCVPATH += $(PROJECT_ROOT)/../../
25EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr 26EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr
diff --git a/test_qnx/dce_test/common.mk b/test_qnx/dce_test/common.mk
index 3d9c9dd..2c83573 100644
--- a/test_qnx/dce_test/common.mk
+++ b/test_qnx/dce_test/common.mk
@@ -20,6 +20,7 @@ EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/codec_engine
20EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs 20EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs
21EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais 21EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais
22EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools 22EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools
23EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/framework_components
23 24
24EXTRA_INCVPATH += $(PROJECT_ROOT)/../../ 25EXTRA_INCVPATH += $(PROJECT_ROOT)/../../
25EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr 26EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr