⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wincewmroam.c

📁 6410BSP3
💻 C
📖 第 1 页 / 共 2 页
字号:


/*****************************************************************************/
/*                                                                           */
/* NAME                                                                      */
/*      OAM_Malloc                                                           */
/* DESCRIPTION                                                               */
/*      This function allocates memory for Whimory                           */
/*                                                                           */
/* PARAMETERS                                                                */
/*      nSize       [IN]                                                     */
/*            Size to be allocated                                           */
/*                                                                           */
/* RETURN VALUES                                                             */
/*      Pointer of allocated memory                                          */
/*                                                                           */
/* NOTES                                                                     */
/*      This function is called by function that wants to use memory         */
/*                                                                           */
/*****************************************************************************/
VOID *
OAM_Malloc(UINT32 nSize)
{
#ifdef NO_MALLOC	// by dodan2 061216
	WMR_RTL_PRINT((TEXT("[FTL:ERR]  OAM_Malloc() : NO_MALLOC defined\r\n")));
	while(1);
#else
// hmseo-061017 start
    if (nSize < 64) nSize = 64;     /* I don't know.. Why this is needed */
    return (void *)malloc(nSize);
// hmseo-061017 end
#endif
}

/*****************************************************************************/
/*                                                                           */
/* NAME                                                                      */
/*  OAM_Free                                                                 */
/* DESCRIPTION                                                               */
/*      This function free memory that XSR allocated                         */
/*                                                                           */
/* PARAMETERS                                                                */
/*  pMem        Pointer to be free                                           */
/*                                                                           */
/* RETURN VALUES                                                             */
/*      none                                                                 */
/*                                                                           */
/* NOTES                                                                     */
/*      This function is called by function that wants to free memory        */
/*                                                                           */
/*                                                                           */
/*****************************************************************************/
VOID
OAM_Free(VOID  *pMem)
{
#ifdef NO_MALLOC	// by dodan2 061216
	WMR_RTL_PRINT((TEXT("[FTL:ERR]  OAM_Free() : NO_MALLOC defined\r\n")));
	while(1);
#else
	if (pMem != NULL) free(pMem);
#endif
}


/*****************************************************************************/
/*                                                                           */
/* NAME                                                                      */
/*  OAM_Memcpy                                                               */
/* DESCRIPTION                                                               */
/*      This function copies data from source to destination.                */
/*                                                                           */
/* PARAMETERS                                                                */
/*  pDst        Destination array Pointer to be copied                       */
/*  pSrc        Source data allocated Pointer                                */
/*  nLen        length to be copied                                          */
/*                                                                           */
/* RETURN VALUES                                                             */
/*      none                                                                 */
/*                                                                           */
/* NOTES                                                                     */
/*      This function is called by function that wants to copy source buffer */
/*  to destination buffer.                                                   */
/*                                                                           */
/*****************************************************************************/
VOID
OAM_Memcpy(VOID *pDst, VOID *pSrc, UINT32 nLen)
{
// hmseo-061017 start
	memcpy((void *) pDst,(void *) pSrc, nLen);
// hmseo-061017 end
}

/*****************************************************************************/
/*                                                                           */
/* NAME                                                                      */
/*  OAM_Memset                                                               */
/* DESCRIPTION                                                               */
/*      This function set data of specific buffer.                           */
/*                                                                           */
/* PARAMETERS                                                                */
/*  pSrc        Source data allocated Pointer                                */
/*  nV          Value to be setted                                           */
/*  nLen        length to be setted                                          */
/*                                                                           */
/* RETURN VALUES                                                             */
/*      none                                                                 */
/*                                                                           */
/* NOTES                                                                     */
/*      This function is called by function that wants to set source buffer  */
/*  own data.                                                                */
/*                                                                           */
/*****************************************************************************/
VOID
OAM_Memset(VOID *pDst, UINT8 nV, UINT32 nLen)
{
// hmseo-061017 start
	memset((void *) pDst, (int) nV, nLen);
// hmseo-061017 end
}

/*****************************************************************************/
/*                                                                           */
/* NAME                                                                      */
/*  OAM_Assert                                                               */
/* DESCRIPTION                                                               */
/*     assert check									 	                     */
/*                                                                           */
/* PARAMETERS                                                                */
/*  bVal    check boolean value									             */
/*  szFile  file name												         */
/*  nLine   line count											             */
/*                                                                           */
/* RETURN VALUES                                                             */
/*      none                                                                 */
/*                                                                           */
/* NOTES                                                                     */
/*      This function is used when system can not support debug              */
/*  print function                                                           */
/*                                                                           */
/*****************************************************************************/
#define RETAILMSG(cond, printf_exp)	((cond)?(NKDbgPrintfW printf_exp),1:0)

VOID
OAM_Assert(BOOL32 bVal, const UINT8 *szFile, UINT32 nLine)
{
	if(!bVal)
	{
		//WMR_RTL_PRINT((TEXT("[FTL:ERR]  OAM_Assert Error [%s:%d]!\r\n"), szFile, nLine));
		//WMR_RTL_PRINT((TEXT("\n <log P1=\"101\" P2=\"WMROAM\" P3=\"\" P4=\"OAM_Assert()\" P5=\"OAM_Assert Error [%x:%d]\" P6=\"\" P7=\"\" />\n"), szFile, nLine));
		RETAILMSG(TRUE, (_T("[FTL:ERR]  OAM_Assert Error [%s:%d]!\r\n"), szFile, nLine));
		RETAILMSG(TRUE, (_T("\n <log P1=\"101\" P2=\"WMROAM\" P3=\"\" P4=\"OAM_Assert()\" P5=\"OAM_Assert Error [%x:%d]\" P6=\"\" P7=\"\" />\n"), szFile, nLine));

		while(1);
	}

}

void
OAM_Init()
{
// hmseo-061017 start
//	UINT32 nIdx;

//	for (nIdx = 0; nIdx < WMR_LOCAL_MEM_SIZE; nIdx++)
//	{
//		aMemBuf[i]=0;
//	}

//	nMallocPtr = 0;
// hmseo-061017 end
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -