DSMCC
15.3.1
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2004 Ocean Blue Software Ltd 00004 * Copyright © 2001 Koninklijke Philips Electronics N.V 00005 * 00006 * This file is part of a DTVKit Software Component 00007 * You are permitted to copy, modify or distribute this file subject to the terms 00008 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00009 * 00010 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00011 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00012 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00013 * 00014 * If you or your organisation is not a member of DTVKit then you have access 00015 * to this source code outside of the terms of the licence agreement 00016 * and you are expected to delete this and any associated files immediately. 00017 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00018 *******************************************************************************/ 00025 #ifndef _LOADMGR_H_ 00026 #define _LOADMGR_H_ 00027 00028 00029 /*-------------------------------- Includes --------------------------------*/ 00030 #include "clDsmSystem.h" 00031 00032 #include "linkList.h" 00033 #include "object.h" 00034 #include "dsmObject.h" 00035 #include "objectCarousel.h" 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 00041 /*----------------------------- Exported Macros ----------------------------*/ 00042 00043 #define LOAD_REQUEST_MAGIC 0x4C525154 /*'LRQT'*/ 00044 #define CRSL_LOAD_TIMEOUT 50000 00045 00046 /*------------------------------ Exported Types ----------------------------*/ 00047 00048 typedef enum { 00049 LRS_INITIAL = 0, 00050 LRS_STALLED_DSI, 00051 LRS_STALLED_SRG_MODULE, 00052 LRS_STALLED_MODULE, 00053 LRS_ABORTED_TIMEOUT, 00054 LRS_ABORTED_PATH_ERROR, 00055 LRS_ABORTED_LOAD_ERROR, 00056 LRS_ABORTED_BY_REQUESTER, 00057 LRS_LOADED, 00058 LRS_LITE_OPTIONS_LOADED, 00059 LRS_LITE_OPTIONS_PENDING, 00060 LRS_ABORT_PENDING_RELOAD 00061 } LRStatus_t; 00062 00063 00064 typedef enum { 00065 TT_NONE = 0, 00066 TT_SRG, 00067 TT_GEN_OBJECT, 00068 TT_PREFETCH_DIR_OBJ, 00069 TT_PREFETCH_NON_DIR_OBJ, 00070 TT_MODULE 00071 } TargetType_t; 00072 00073 typedef struct LoadRequest_tag LoadRequest_t, *pLoadRequest_t; 00074 00075 typedef void (*LoadFinaliseFunc_t) ( pclDsmInstData_t idp, 00076 /*I*/ pLoadRequest_t pLoadRequest ); 00077 00078 struct LoadRequest_tag { 00079 S_LLObject llData[NUM_LISTS_LOAD_REQUEST]; 00080 U32BIT magic; 00081 LRStatus_t status; /* -- Curent load state */ 00082 TargetType_t targetKind; /* -- Kind of final load target */ 00083 00084 pObjectCarousel_t pObjCarousel; /* -- OC this load is requested on */ 00085 00086 MemHandle hDataCarousel; /* -- DC that load is currently progressed to */ 00087 MemHandle hModule; /* -- Module that load is currently progressed to */ 00088 00089 DeliveryParaTap_t tap; /* -- Next tap that load needs */ 00090 ObjectLocation_t objectLocation; /* -- Next object that load needs */ 00091 00092 clDsmCachingRules_t cachingRules; 00093 00094 /* -- Reference/handle to target */ 00095 union { 00096 pDsmObject_t pDsmObject; 00097 MemHandle hOC; 00098 } targetRef; 00099 00100 LoadFinaliseFunc_t loadFinaliseFunc; /* -- Callback */ 00101 00102 U32BIT targetObjectOffset; /* -- NB. From start of moduleData */ 00103 ObjectDataInfo_t targetObjectInfo; 00104 00105 /* -- Requester userData */ 00106 void* loadUserData; 00107 00108 U32BIT userTimeout; /* -- Original timeout set on load */ 00109 /* TODO: May not need to store timeout in loadRequest */ 00110 00111 BOOLEAN clientRequest; /* -- True = this load was requested 00112 -- by an external client (ie. not 00113 -- an internal pre-fetch */ 00114 00115 U32BIT remainingPathOffset; 00116 MemHandle hRemainingPath; 00117 00118 BOOLEAN temporary; /* -- True = this is a temporary 00119 * -- request, do not store it */ 00120 00121 }; 00122 00123 00124 /*------------------------------ Exported Data -----------------------------*/ 00125 00126 00127 /*--------------------------- Exported Prototypes --------------------------*/ 00128 #ifdef DSM_NO_MEM_CONTEXT 00129 #define lmSetModuleCachingRules( x, a, b ) lmSetModuleCachingRules( a, b ) 00130 #endif 00131 00132 clDsmErr_t lmCarouselLoadCreate( pclDsmInstData_t idp, pObjectCarousel_t pOC, 00133 U32BIT timeout, MemHandle *phLoadRequest ); 00134 00135 clDsmErr_t lmUpdateCarouselBoot( pclDsmInstData_t idp, pObjectCarousel_t pOC, 00136 clDsmCarouselInfo_t *pCarouselInfo ); 00137 00138 00139 clDsmErr_t lmRequestObjectLoad( pclDsmInstData_t idp, 00140 pObjectCarousel_t pOC, U8BIT* path, U32BIT timeout, 00141 H_ObjUserData pUserData, U32BIT sizeOfUserData, 00142 pDsmObject_t pDsmObject, 00143 MemHandle *phLoadRequest ); 00144 00145 clDsmErr_t lmPrefetchObjectLoad( pclDsmInstData_t idp, 00146 pObjectCarousel_t pOC, U8BIT* path, U32BIT timeout, 00147 MemHandle *phLoadRequest ); 00148 00149 void lmLoadDestroy( pclDsmInstData_t idp, 00150 MemHandle *phLoadRequest ); 00151 00152 clDsmErr_t lmGetObjectLoadState( pclDsmInstData_t idp, 00153 /*I*/ pObjectCarousel_t pOC, U8BIT* path, 00154 /*O*/ BOOLEAN *pLoaded, MemHandle *phModule ); 00155 00156 clDsmErr_t lmUpdateCarouselSRGInfo( pclDsmInstData_t idp, 00157 pObjectCarousel_t pOC, pDeliveryParaTap_t pSrgTap, 00158 pObjectLocation_t pSrgLocn ); 00159 00160 clDsmErr_t lmUpdateDataCarousel( pclDsmInstData_t idp, 00161 pObjectCarousel_t pObjectCarousel, MemHandle *phDataCarousel, 00162 U32BIT transactionId, U8BIT* pDiiMsg, U16BIT diiMsgDataLen ); 00163 00164 clDsmErr_t lmUpdateModule( pclDsmInstData_t idp, 00165 pObjectCarousel_t pOC, MemHandle *phModule ); 00166 00167 void lmUnloadModule( pclDsmInstData_t idp, MemHandle *phModule ); 00168 00169 void lmUnloadDataCarousel( pclDsmInstData_t idp, MemHandle *phDC ); 00170 00171 void lmUnloadCarousel( pclDsmInstData_t idp, pObjectCarousel_t *ppOC ); 00172 00173 void lmStopModuleLoadRequest( pclDsmInstData_t idp, MemHandle *phLoadRequest ); 00174 00175 void lmSetObjectModuleLoaded( pclDsmInstData_t idp, MemHandle hModule ); 00176 00177 void lmSetObjectModuleUnloaded( pclDsmInstData_t idp, MemHandle *phModule ); 00178 00179 void lmAbortCarouselLoadRequest( pclDsmInstData_t idp, pObjectCarousel_t pOC ); 00180 00181 void lmAbortLoadRequestsOnModuleTimeout( pclDsmInstData_t idp, MemHandle *phModule); 00182 00183 clDsmErr_t lmLiteOptionsObjectHandle(pclDsmInstData_t idp, 00184 U8BIT *name, 00185 pLoadRequest_t pLoadRequest ); 00186 00187 clDsmErr_t lmLiteOptionsObjectOnModuleUpdate(pclDsmInstData_t idp, 00188 U8BIT *name, 00189 pObjectCarousel_t pCurrOC , 00190 MemHandle hLoadedModule, 00191 pLoadRequest_t pLoadRequest ); 00192 00193 /*----------------------------------------------------------------------------*/ 00194 00195 #ifdef __cplusplus 00196 } 00197 #endif 00198 #endif /* _LOADMGR_H_ */