ires.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  */
00047 #ifndef IRES_
00048 #define IRES_
00049 
00052 
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 #include "ires_common.h"
00059 
00060 typedef enum IRES_YieldResourceType {
00061     IRES_ALL = 0,                       
00064     IRES_SCRATCHMEMORY,                 
00067     IRES_SCRATCHDMA,                    
00070     IRES_RESOURCEHANDLE                 
00073 } IRES_YieldResourceType;
00074 
00075 typedef Void (*IRES_ContextSaveFxn)(IALG_Handle algHandle, Void *contextArgs);
00076 typedef Void (*IRES_ContextRestoreFxn)
00077         (IALG_Handle algHandle, Void *contextArgs);
00078 
00084 typedef struct IRES_YieldContext {
00085 
00089     IALG_Handle                algHandle;
00090 
00097     IRES_Handle                resourceHandle;
00098 
00110     IRES_ContextSaveFxn        contextSave;
00111 
00125     IRES_ContextRestoreFxn      contextRestore;
00126 
00134     Void                        *contextArgs;
00135 
00136 } IRES_YieldContext ;
00137 
00138 
00139 typedef IRES_YieldContext *IRES_YieldContextHandle;
00140 typedef Void *IRES_YieldArgs;
00141 
00159 typedef Void (*IRES_YieldFxn)(IRES_YieldResourceType resourceType,
00160     IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
00161 
00168 typedef struct IRES_Fxns {
00169 
00174     Void *implementationId;
00175 
00180     IRES_Status (*getResourceDescriptors)(IALG_Handle handle,
00181         IRES_ResourceDescriptor *resourceDescriptors);
00182 
00190     Int32 (*numResourceDescriptors)(IALG_Handle handle);
00191 
00199     IRES_Status (*initResources)(IALG_Handle handle,
00200             IRES_ResourceDescriptor * resourceDescriptor,
00201             IRES_YieldFxn  yieldFxn,
00202             IRES_YieldArgs yieldArgs);
00203 
00214     IRES_Status (*reinitResources)(IALG_Handle handle,
00215             IRES_ResourceDescriptor * resourceDescriptor,
00216             IRES_YieldFxn  yieldFxn,
00217             IRES_YieldArgs yieldArgs);
00218 
00223     IRES_Status (*deinitResources)(IALG_Handle handle,
00224             IRES_ResourceDescriptor * resourceDescriptor);
00225 
00235     IRES_Status (*activateResource)(IALG_Handle handle,
00236             IRES_Handle resourceHandle);
00237 
00244     IRES_Status (*activateAllResources)(IALG_Handle handle);
00245 
00252     IRES_Status (*deactivateResource)(IALG_Handle handle,
00253             IRES_Handle resourceHandle);
00254 
00261      IRES_Status (*deactivateAllResources)(IALG_Handle handle);
00262 
00263 } IRES_Fxns;
00264 
00268 #ifdef __cplusplus
00269 }
00270 #endif /* extern "C" */
00271 
00272 
00273 #endif  /* IRES_ */
00274 /*
00275  *  @(#) ti.xdais; 1, 2.0, 1,192; 3-13-2009 12:27:22; /db/wtree/library/trees/dais/dais-o05x/src/
00276  */
00277 

Copyright 2009, Texas Instruments Incorporated