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