//------------------------------------------------------------------------------ tOplkError ctrlucal_readInitParam(tCtrlInitParam* pInitParam_p) { tOplkError ret = kErrorOk; tHostifReturn hifret; void* pInitBase; void* pSrc; // Check parameter validity ASSERT(pInitParam_p != NULL); hifret = hostif_getInitParam(instance_l.hifInstance, &pInitBase); if (hifret != kHostifSuccessful) { DEBUG_LVL_ERROR_TRACE("%s() Getting init base failed (0x%X)!\n", __func__, hifret); ret = kErrorNoResource; goto Exit; } pSrc = getDynBuff((UINT32)pInitBase); if (pSrc == NULL) return kErrorNoResource; OPLK_MEMCPY(pInitParam_p, pSrc, sizeof(tCtrlInitParam)); freeDynBuff(pSrc); Exit: return ret; }
//------------------------------------------------------------------------------ void ctrlucal_storeInitParam(tCtrlInitParam* pInitParam_p) { tHostifReturn hifret; UINT8* pInitBase; UINT8* pDst; hifret = hostif_getInitParam(instance_l.hifInstance, &pInitBase); if (hifret != kHostifSuccessful) { DEBUG_LVL_ERROR_TRACE("%s() Getting init base failed (0x%X)!\n", __func__, hifret); return; } pDst = getDynBuff((UINT32)pInitBase); if (pDst != NULL) OPLK_MEMCPY(pDst, pInitParam_p, sizeof(tCtrlInitParam)); freeDynBuff(pDst); }