本文整理汇总了C++中os_memoryAlloc函数的典型用法代码示例。如果您正苦于以下问题:C++ os_memoryAlloc函数的具体用法?C++ os_memoryAlloc怎么用?C++ os_memoryAlloc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了os_memoryAlloc函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: txDataQ_Create
/**
* \fn txDataQ_Create
* \brief Create the module and its queues
*
* Create the Tx Data module and its queues.
*
* \note
* \param hOs - Handle to the Os Abstraction Layer
* \return Handle to the allocated Tx Data Queue module (NULL if failed)
* \sa
*/
TI_HANDLE txDataQ_Create(TI_HANDLE hOs)
{
TTxDataQ *pTxDataQ;
/* allocate TxDataQueue module */
pTxDataQ = os_memoryAlloc(hOs, (sizeof(TTxDataQ)));
if (!pTxDataQ) {
WLAN_OS_REPORT(("Error allocating the TxDataQueue Module\n"));
return NULL;
}
/* Reset TxDataQueue module */
os_memoryZero(hOs, pTxDataQ, (sizeof(TTxDataQ)));
return (TI_HANDLE) pTxDataQ;
}
开发者ID:blueskycoco,项目名称:wang-linux,代码行数:28,代码来源:txDataQueue.c
示例2: twIf_Create
/**
* \fn twIf_Create
* \brief Create the module
*
* Allocate and clear the module's object.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object, NULL if allocation failed
* \sa twIf_Destroy
*/
TI_HANDLE twIf_Create (TI_HANDLE hOs)
{
TI_HANDLE hTwIf;
TTwIfObj *pTwIf;
hTwIf = os_memoryAlloc (hOs, sizeof(TTwIfObj));
if (hTwIf == NULL)
return NULL;
pTwIf = (TTwIfObj *)hTwIf;
os_memoryZero (hOs, hTwIf, sizeof(TTwIfObj));
pTwIf->hOs = hOs;
return pTwIf;
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:28,代码来源:TwIf.c
示例3: admCtrl_create
/**
*
* admCtrl_create
*
* \b Description:
*
* Create the admission control context.
*
* \b ARGS:
*
* I - role - admission cotrol role (AP or Station) \n
* I - authSuite - authentication suite to work with \n
*
* \b RETURNS:
*
* TI_OK on success, TI_NOK on failure.
*
* \sa
*/
admCtrl_t* admCtrl_create(TI_HANDLE hOs)
{
admCtrl_t *pHandle;
/* allocate rsniation context memory */
pHandle = (admCtrl_t*)os_memoryAlloc(hOs, sizeof(admCtrl_t));
if (pHandle == NULL)
{
return NULL;
}
os_memoryZero(hOs, pHandle, sizeof(admCtrl_t));
pHandle->hOs = hOs;
return pHandle;
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:36,代码来源:admCtrl.c
示例4: fwDbg_Init
/*
* \brief Initialize the module
*
* \param hFwDebug - Handle to FW Debug
* \param hReport - Handle to report
* \param hTwif - Handle to TWIF
* \param hFwEvent - Handle to fwEvent
* \return none
*
* \par Description
*
*
* \sa
*/
void fwDbg_Init (TI_HANDLE hFwDebug,
TI_HANDLE hReport,
TI_HANDLE hTwif,
TI_HANDLE hFwEvent)
{
TFwDebug* pFwDebug = (TFwDebug*)hFwDebug;
pFwDebug->hReport = hReport;
pFwDebug->hTwif = hTwif;
pFwDebug->hFwEvent = hFwEvent;
/* Allocate DMA memory for read write transact */
pFwDebug->pDMABuf = (TI_UINT8*)os_memoryAlloc(pFwDebug->hOs,DMA_SIZE_BUF);
/* Init SDIO test variables */
pFwDebug->pSdioTestWriteBuf = NULL;
pFwDebug->pSdioTestReadBuf = NULL;
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:31,代码来源:fwDebug.c
示例5: mainSec_create
/**
*
* mainSec_create
*
* \b Description:
*
* Allocate memory for the main security context, and create all the rest of the needed contexts.
*
* \b ARGS:
*
* I - hOs - OS handle for OS operations.
*
* \b RETURNS:
*
* pointer to main security context. If failed, returns NULL.
*
* \sa
*/
mainSec_t* mainSec_create(TI_HANDLE hOs)
{
mainSec_t *pHandle;
TI_STATUS status;
/* allocate association context memory */
pHandle = (mainSec_t*)os_memoryAlloc(hOs, sizeof(mainSec_t));
if (pHandle == NULL)
{
return NULL;
}
os_memoryZero(hOs, pHandle, sizeof(mainSec_t));
/* allocate memory for association state machine */
status = fsm_Create(hOs, &pHandle->pMainSecSm, MAIN_SEC_MAX_NUM_STATES, MAIN_SEC_MAX_NUM_EVENTS);
if (status != TI_OK)
{
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
pHandle->pMainKeys = mainKeys_create(hOs);
if (pHandle->pMainKeys == NULL)
{
fsm_Unload(hOs, pHandle->pMainSecSm);
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
pHandle->pKeyParser = pHandle->pMainKeys->pKeyParser;
pHandle->hOs = hOs;
/* created only for external security mode */
pHandle->pExternalSec = externalSec_create(hOs);
if (pHandle->pExternalSec == NULL)
{
fsm_Unload(hOs, pHandle->pMainSecSm);
mainKeys_unload(pHandle->pMainKeys);
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
return pHandle;
}
开发者ID:bluewater-cn,项目名称:ti_wilink,代码行数:64,代码来源:mainSecSm.c
示例6: tmr_Create
/**
* \fn tmr_Create
* \brief Create the timer module
*
* Allocate and clear the timer module object.
*
* \note This is NOT a specific timer creation! (see tmr_CreateTimer)
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa tmr_Destroy
*/
TI_HANDLE tmr_Create (TI_HANDLE hOs)
{
TI_HANDLE hTimerModule;
/* allocate module object */
hTimerModule = os_memoryAlloc (hOs, sizeof(TTimerModule));
if (!hTimerModule)
{
WLAN_OS_REPORT (("tmr_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, hTimerModule, (sizeof(TTimerModule)));
return (hTimerModule);
}
开发者ID:nadlabak,项目名称:tiwlan,代码行数:28,代码来源:timer.c
示例7: cmdQueue_Create
/*
* \brief Create the TCmdQueue object
*
* \param hOs - OS module object handle
* \return Handle to the created object
*
* \par Description
* Calling this function creates a CmdQueue object
*
* \sa cmdQueue_Destroy
*/
TI_HANDLE cmdQueue_Create (TI_HANDLE hOs)
{
TCmdQueue *pCmdQueue;
pCmdQueue = os_memoryAlloc (hOs, sizeof(TCmdQueue));
if (pCmdQueue == NULL)
{
WLAN_OS_REPORT(("FATAL ERROR: cmdQueue_Create(): Error Creating aCmdQueue - Aborting\n"));
return NULL;
}
/* reset control module control block */
os_memoryZero (hOs, pCmdQueue, sizeof(TCmdQueue));
pCmdQueue->hOs = hOs;
return pCmdQueue;
}
开发者ID:aleho,项目名称:ti_wilink,代码行数:28,代码来源:CmdQueue.c
示例8: StaCap_Create
/**
* \fn staCap_Create
* \brief Create the staCap module.
*
* Allocate and clear the staCap module object.
*
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa staCap_Destroy
*/
TI_HANDLE StaCap_Create (TI_HANDLE hOs)
{
TI_HANDLE hStaCap;
/* allocate module object */
hStaCap = os_memoryAlloc (hOs, sizeof(TStaCap));
if (!hStaCap)
{
WLAN_OS_REPORT (("StaCap_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, hStaCap, (sizeof(TStaCap)));
return (hStaCap);
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:27,代码来源:StaCap.c
示例9: RxQueue_Create
/**
* \fn RxQueue_Create()
* \brief Create the RxQueue module.
*
* Allocate and clear the RxQueue module object.
*
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa RxQueue_Destroy
*/
TI_HANDLE RxQueue_Create (TI_HANDLE hOs)
{
TRxQueue *pRxQueue;
/* allocate module object */
pRxQueue = os_memoryAlloc (hOs, sizeof(TRxQueue));
if (!pRxQueue) {
WLAN_OS_REPORT (("RxQueue_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, pRxQueue, (sizeof(TRxQueue)));
pRxQueue->hOs = hOs;
return (pRxQueue);
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:28,代码来源:RxQueue.c
示例10: pwrState_Create
TI_HANDLE pwrState_Create (TI_HANDLE hOs)
{
TPwrState *pPwrState = NULL;
pPwrState = (TPwrState*) os_memoryAlloc (hOs, sizeof(TPwrState));
if ( NULL == pPwrState )
{
WLAN_OS_REPORT(("%s: Memory Allocation Error!\n", __func__));
return NULL;
}
os_memoryZero (hOs, pPwrState, sizeof(TPwrState));
pPwrState->hOs = hOs;
return pPwrState;
}
开发者ID:chambejp,项目名称:hardware,代码行数:18,代码来源:pwrState.c
示例11: resident
/****************************************************************************************
* os_memoryAlloc()
****************************************************************************************
DESCRIPTION: Allocates resident (nonpaged) system-space memory.
ARGUMENTS: OsContext - our adapter context.
Size - Specifies the size, in bytes, to be allocated.
RETURN: Pointer to the allocated memory.
NULL if there is insufficient memory available.
NOTES: With the call to vmalloc it is assumed that this function will
never be called in an interrupt context. vmalloc has the potential to
sleep the caller while waiting for memory to become available.
*****************************************************************************************/
void* mem_Alloc (TI_HANDLE hMem, TI_UINT32 size)
{
TMemMng *pMemMng = (TMemMng *)hMem;
TMemBlock *pMemBlock;
TI_UINT32 total = size + sizeof(TMemBlock) + sizeof(TI_UINT32);
pMemBlock = (TMemBlock *) os_memoryAlloc (pMemMng->hOs, total);
pMemBlock->size = size;
pMemBlock->signature = MEM_BLOCK_START;
*(TI_UINT32 *)((TI_UINT8 *)pMemBlock + total - sizeof(TI_UINT32)) = MEM_BLOCK_END;
pMemMng->uCurAllocated += total;
if (pMemMng->uMaxAllocated < pMemMng->uCurAllocated) {
pMemMng->uMaxAllocated = pMemMng->uCurAllocated;
}
return (void*)((TI_UINT8 *)pMemBlock + sizeof(TMemBlock));
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:34,代码来源:mem.c
示例12: busDrv_Create
/**
* \fn busDrv_Create
* \brief Create the module
*
* Create and clear the bus driver's object, and the SDIO-adapter.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object, NULL if allocation failed
* \sa busDrv_Destroy
*/
TI_HANDLE busDrv_Create (TI_HANDLE hOs)
{
TI_HANDLE hBusDrv;
TBusDrvObj *pBusDrv;
hBusDrv = os_memoryAlloc(hOs, sizeof(TBusDrvObj));
if (hBusDrv == NULL)
{
return NULL;
}
pBusDrv = (TBusDrvObj *)hBusDrv;
os_memoryZero(hOs, hBusDrv, sizeof(TBusDrvObj));
pBusDrv->hOs = hOs;
return pBusDrv;
}
开发者ID:CyanogenDefy,项目名称:android_system_wlan_ti,代码行数:30,代码来源:SdioBusDrv.c
示例13: mlme_start
/**
* mlme_Start - Start event for the MLME SM
*
* \b Description:
* Start event for the MLME SM
*
* \b ARGS:
* I - hMlme - MLME SM context \n
* II - connectionType - roaming or initial? with FT (802.11r) or not?
* \b RETURNS:
* TI_OK if successful, TI_NOK otherwise.
*
* \sa mlme_Stop, mlme_Recv
*/
TI_STATUS mlme_start(TI_HANDLE hMlme, TI_UINT8 connectionType)
{
EConnType econnectionType = (EConnType)connectionType;
mlme_t *pMlme = (mlme_t*)hMlme;
paramInfo_t *pParam;
if (pMlme == NULL)
{
return TI_NOK;
}
pParam = (paramInfo_t *)os_memoryAlloc(pMlme->hOs, sizeof(paramInfo_t));
if (pParam == NULL)
{
return TI_NOK;
}
pMlme->assocInfo.disAssoc = TI_FALSE;
pParam->paramType = RSN_EXT_AUTHENTICATION_MODE;
rsn_getParam(pMlme->hRsn, pParam);
switch (econnectionType)
{
case CONN_TYPE_FIRST_CONN:
case CONN_TYPE_ROAM:
if (AUTH_LEGACY_SHARED_KEY == pParam->content.rsnExtAuthneticationMode)
{
pMlme->authInfo.authType = AUTH_LEGACY_SHARED_KEY;
}
else
{
pMlme->authInfo.authType = AUTH_LEGACY_OPEN_SYSTEM;
}
break;
default:
pMlme->authInfo.authType = AUTH_LEGACY_OPEN_SYSTEM;
break;
}
mlme_smEvent(pMlme->hMlmeSm, MLME_SM_EVENT_START, pMlme);
return TI_OK;
}
开发者ID:nadlabak,项目名称:tiwlan,代码行数:57,代码来源:mlme.c
示例14: connInfra_ScrWaitDisconn_to_disconnect
static TI_STATUS connInfra_ScrWaitDisconn_to_disconnect(void *pData)
{
TI_STATUS status;
paramInfo_t *pParam;
conn_t *pConn = (conn_t *)pData;
status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
if (status != TI_OK)
return status;
pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
if (!pParam)
{
return TI_NOK;
}
pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
pParam->content.rxDataPortStatus = CLOSE;
status = rxData_setParam(pConn->hRxData, pParam);
if (status == TI_OK)
{
/* Update TxMgmtQueue SM to close Tx path for all except Mgmt packets. */
txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_MGMT);
pParam->paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam);
status = mlme_stop( pConn->hMlme, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP );
if (status == TI_OK)
{
/* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
supported rates, and stopModules clears all rates. */
stopModules(pConn, TI_TRUE);
/* send disconnect command to firmware */
prepare_send_disconnect(pData);
}
}
os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
return status;
}
开发者ID:chambejp,项目名称:hardware,代码行数:42,代码来源:connInfra.c
示例15: txnQ_Create
TI_HANDLE txnQ_Create (TI_HANDLE hOs)
{
TI_HANDLE hTxnQ;
TTxnQObj *pTxnQ;
TI_UINT32 i;
hTxnQ = os_memoryAlloc(hOs, sizeof(TTxnQObj));
if (hTxnQ == NULL)
return NULL;
pTxnQ = (TTxnQObj *)hTxnQ;
os_memoryZero(hOs, hTxnQ, sizeof(TTxnQObj));
pTxnQ->hOs = hOs;
pTxnQ->pCurrTxn = NULL;
pTxnQ->uMinFuncId = MAX_FUNCTIONS; /* Start at maximum and save minimal value in txnQ_Open */
pTxnQ->uMaxFuncId = 0; /* Start at minimum and save maximal value in txnQ_Open */
#ifdef TI_DBG
pTxnQ->pAggregQueue = NULL;
#endif
for (i = 0; i < MAX_FUNCTIONS; i++)
{
pTxnQ->aFuncInfo[i].eState = FUNC_STATE_NONE;
pTxnQ->aFuncInfo[i].uNumPrios = 0;
pTxnQ->aFuncInfo[i].pSingleStep = NULL;
pTxnQ->aFuncInfo[i].fTxnQueueDoneCb = NULL;
pTxnQ->aFuncInfo[i].hCbHandle = NULL;
}
/* Create the Bus-Driver module */
pTxnQ->hBusDrv = busDrv_Create (hOs);
if (pTxnQ->hBusDrv == NULL)
{
WLAN_OS_REPORT(("%s: Error - failed to create BusDrv\n", __FUNCTION__));
txnQ_Destroy (hTxnQ);
return NULL;
}
return pTxnQ;
}
开发者ID:aleho,项目名称:ti_wilink,代码行数:42,代码来源:TxnQueue.c
示例16: EvHandler_Create
TI_HANDLE EvHandler_Create (TI_HANDLE hOs)
{
TEvHandlerObj *pEvHandler;
PRINT(DBG_INIT_LOUD, (" EvHandlerInit\n"));
pEvHandler = os_memoryAlloc(hOs,sizeof(TEvHandlerObj));
os_memoryZero(hOs,pEvHandler,sizeof(TEvHandlerObj));
#ifdef EV_HANDLER_DEBUG
ghEvHandler= pEvHandler;
PRINTF(DBG_INIT_VERY_LOUD, ("EvHandlerInit: ghEvHandler set to %08X\n", ghEvHandler));
#endif
pEvHandler->hOs = hOs;
pEvHandler->LastUMEventType = 0xFFFFFFFF;
IPCKernelInit(hOs, NULL);
return (TI_HANDLE) pEvHandler;
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:20,代码来源:EvHandler.c
示例17: cmdDispatch_Create
/**
* \fn cmdDispatch_Create
* \brief Create the module
*
* Create the Command-Dispatcher module
*
* \note
* \param hOs - Handle to the Os Abstraction Layer
* \return Handle to the allocated module (NULL if failed)
* \sa
*/
TI_HANDLE cmdDispatch_Create (TI_HANDLE hOs)
{
TCmdDispatchObj *pCmdDispatch;
/* allocate CmdDispatcher module */
pCmdDispatch = os_memoryAlloc (hOs, (sizeof(TCmdDispatchObj)));
if (!pCmdDispatch)
{
WLAN_OS_REPORT(("Error allocating the CmdDispatcher Module\n"));
return NULL;
}
/* Reset CmdDispatcher module */
os_memoryZero (hOs, pCmdDispatch, (sizeof(TCmdDispatchObj)));
pCmdDispatch->hOs = hOs;
return (TI_HANDLE)pCmdDispatch;
}
开发者ID:nadlabak,项目名称:tiwlan,代码行数:31,代码来源:CmdDispatcher.c
示例18: MacServices_create
TI_HANDLE MacServices_create( TI_HANDLE hOS)
{
MacServices_t *pMacServices = (MacServices_t*)os_memoryAlloc( hOS, sizeof(MacServices_t) );
if ( NULL == pMacServices )
{
WLAN_OS_REPORT( ("ERROR: Failed to create Mac SRV module") );
return NULL;
}
/* nullify all handles, so that only handles in existence will be released */
pMacServices->hScanSRV = NULL;
pMacServices->hPowerSrv = NULL;
/* create the scanSRV handle */
pMacServices->hScanSRV = MacServices_scanSRV_create(hOS);
if ( NULL == pMacServices->hScanSRV )
{
MacServices_destroy( pMacServices );
return NULL;
}
/* create the measurment handle */
pMacServices->hMeasurementSRV = MacServices_measurementSRV_create( hOS );
if ( NULL == pMacServices->hMeasurementSRV )
{
MacServices_destroy(pMacServices);
return NULL;
}
pMacServices->hPowerSrv = powerSrv_create(hOS);
if (NULL == pMacServices->hPowerSrv )
{
MacServices_destroy(pMacServices);
return NULL;
}
/* store OS handle */
pMacServices->hOS = hOS;
return pMacServices;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:41,代码来源:MacServices.c
示例19: cmdHndlr_Create
/**
* \fn cmdHndlr_Create
* \brief Create the module
*
* Create the module object
*
* \note
* \param hOs - Handle to the Os Abstraction Layer
* \return Handle to the allocated module (NULL if failed)
* \sa
*/
TI_HANDLE cmdHndlr_Create (TI_HANDLE hOs, TI_HANDLE hEvHandler)
{
TCmdHndlrObj *pCmdHndlr = (TCmdHndlrObj *) os_memoryAlloc (hOs, sizeof(TCmdHndlrObj));
if (pCmdHndlr == NULL) {
return NULL;
}
os_memoryZero (hOs, (void *)pCmdHndlr, sizeof(TCmdHndlrObj));
pCmdHndlr->hOs = hOs;
pCmdHndlr->hCmdInterpret = cmdInterpret_Create (hOs);
if (pCmdHndlr->hCmdInterpret == NULL) {
cmdHndlr_Destroy ((TI_HANDLE) pCmdHndlr, (TI_HANDLE) hEvHandler);
return NULL;
}
return (TI_HANDLE) pCmdHndlr;
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:32,代码来源:CmdHndlr.c
示例20: busDrv_Create
/**
* \fn busDrv_Create
* \brief Create the module
*
* Allocate and clear the module's object.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object, NULL if allocation failed
* \sa busDrv_Destroy
*/
TI_HANDLE busDrv_Create (TI_HANDLE hOs)
{
TI_HANDLE hBusDrv;
TBusDrvObj *pBusDrv;
hBusDrv = os_memoryAlloc(hOs, sizeof(TBusDrvObj));
if (hBusDrv == NULL)
return NULL;
pBusDrv = (TBusDrvObj *)hBusDrv;
os_memoryZero(hOs, hBusDrv, sizeof(TBusDrvObj));
pBusDrv->hOs = hOs;
// addapt to WSPI
pBusDrv->hWspi= WSPI_Open(hOs);
return pBusDrv;
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:32,代码来源:WspiBusDrv.c
注:本文中的os_memoryAlloc函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论