commit
28c1529e2f
|
@ -117,7 +117,24 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupGuardCreator(VOID)
|
|||
return LOS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsCpupDaemonInit
|
||||
Description: initialization of CPUP Daemon
|
||||
Input : None
|
||||
Return : LOS_OK or Error Information
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 OsCpupDaemonInit()
|
||||
{
|
||||
#if (LOSCFG_BASE_CORE_SWTMR == 1)
|
||||
(VOID)OsCpupGuardCreator();
|
||||
g_irqCpupInitFlg = 1;
|
||||
#endif
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsCpupInit
|
||||
Description: initialization of CPUP
|
||||
|
@ -127,32 +144,25 @@ Return : LOS_OK or Error Information
|
|||
LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
|
||||
{
|
||||
UINT32 size;
|
||||
CHAR *cpupMem = NULL;
|
||||
|
||||
size = g_taskMaxNum * sizeof(OsCpupCB);
|
||||
g_cpup = (OsCpupCB *)LOS_MemAlloc(m_aucSysMem0, size);
|
||||
|
||||
if (g_cpup == NULL) {
|
||||
return LOS_ERRNO_CPUP_NO_MEMORY;
|
||||
}
|
||||
|
||||
// Ignore the return code when matching CSEC rule 6.6(3).
|
||||
(VOID)memset_s(g_cpup, size, 0, size);
|
||||
g_cpupInitFlg = 1;
|
||||
|
||||
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
|
||||
size = LOSCFG_PLATFORM_HWI_LIMIT * sizeof(OsIrqCpupCB);
|
||||
g_irqCpup = (OsIrqCpupCB *)LOS_MemAlloc(m_aucSysMem0, size);
|
||||
if (g_irqCpup == NULL) {
|
||||
size += LOSCFG_PLATFORM_HWI_LIMIT * sizeof(OsIrqCpupCB);
|
||||
#endif
|
||||
|
||||
cpupMem = LOS_MemAlloc(m_aucSysMem0, size);
|
||||
if (cpupMem == NULL) {
|
||||
return LOS_ERRNO_CPUP_NO_MEMORY;
|
||||
}
|
||||
(VOID)memset_s(cpupMem, size, 0, size);
|
||||
|
||||
(VOID)memset_s(g_irqCpup, size, 0, size);
|
||||
#if (LOSCFG_BASE_CORE_SWTMR == 1)
|
||||
(VOID)OsCpupGuardCreator();
|
||||
g_irqCpupInitFlg = 1;
|
||||
g_cpup = (OsCpupCB *)cpupMem;
|
||||
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
|
||||
g_irqCpup = (OsIrqCpupCB *)(cpupMem + g_taskMaxNum * sizeof(OsCpupCB));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
g_cpupInitFlg = 1;
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
|
|
@ -171,6 +171,7 @@ typedef struct {
|
|||
*/
|
||||
extern UINT32 OsCpupInit(VOID);
|
||||
|
||||
extern UINT32 OsCpupDaemonInit(VOID);
|
||||
/**
|
||||
* @ingroup los_cpup
|
||||
* @brief Start task to get cycles count in current task ending.
|
||||
|
|
|
@ -181,6 +181,14 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
|||
OsTaskMonInit();
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
ret = OsCpupInit();
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("OsCpupInit error\n");
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BASE_IPC_SEM == 1)
|
||||
ret = OsSemInit();
|
||||
if (ret != LOS_OK) {
|
||||
|
@ -211,12 +219,12 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
ret = OsCpupInit();
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("OsCpupInit error\n");
|
||||
return ret;
|
||||
}
|
||||
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
|
||||
ret = OsCpupDaemonInit();
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("OsCpupDaemonInit error\n");
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_FS_VFS == 1)
|
||||
|
|
Loading…
Reference in New Issue