提交 83b1c651 编写于 作者: O openharmony_ci 提交者: Gitee

!12 内核启动重构,新增启动框架

Merge pull request !12 from Zhaotianyu/0510init_framework
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
__FBSDID("$FreeBSD: releng/11.4/sys/arm/arm/autoconf.c 331722 2018-03-29 02:50:57Z eadler $"); __FBSDID("$FreeBSD: releng/11.4/sys/arm/arm/autoconf.c 331722 2018-03-29 02:50:57Z eadler $");
#include <sys/bus.h> #include <sys/bus.h>
#include "linux/module.h"
#include "los_config.h"
#include "los_init.h"
extern int nexus_init(void); extern int nexus_init(void);
device_t nexus; device_t nexus;
...@@ -63,3 +66,22 @@ configure(void) ...@@ -63,3 +66,22 @@ configure(void)
nexus = device_add_child(root_bus, "nexus", 0); nexus = device_add_child(root_bus, "nexus", 0);
nexus_init(); nexus_init();
} }
UINT32 OsBsdInit(VOID)
{
/*
* WORKAROUND: Inside configure(), nexus_init() function calls
* HiSi-specific, library procedure - machine_resource_init().
* The latter one is defined in libhi35xx_bsp.a which is only
* available for Hi3516 and Hi3518.
* Temporarily ifdef configure until this routine is implemented
* by other platforms.
*/
#if defined(LOSCFG_PLATFORM_HI3516DV300) || defined(LOSCFG_PLATFORM_HI3518EV300)
configure();
#endif
mi_startup(SI_SUB_ARCH_INIT);
return LOS_OK;
}
LOS_MODULE_INIT(OsBsdInit, LOS_INIT_LEVEL_PLATFORM);
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
*/ */
#include "linux/workqueue.h" #include "linux/workqueue.h"
#include "los_swtmr_pri.h"
#include "los_event.h"
#include "unistd.h" #include "unistd.h"
#include "los_event.h"
#include "los_init.h"
#include "los_swtmr_pri.h"
#define DELAY_TIME 10000 #define DELAY_TIME 10000
...@@ -607,3 +607,11 @@ void linux_destroy_workqueue(struct workqueue_struct *wq) ...@@ -607,3 +607,11 @@ void linux_destroy_workqueue(struct workqueue_struct *wq)
LOS_SpinUnlockRestore(&g_workqueueSpin, intSave); LOS_SpinUnlockRestore(&g_workqueueSpin, intSave);
} }
UINT32 OsSysWorkQueueInit(VOID)
{
g_pstSystemWq = create_workqueue("system_wq");
return LOS_OK;
}
LOS_MODULE_INIT(OsSysWorkQueueInit, LOS_INIT_LEVEL_KMOD_EXTENDED);
...@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD: releng/11.4/sys/dev/random/yarrow.c 298923 2016-05-02 14:35: ...@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD: releng/11.4/sys/dev/random/yarrow.c 298923 2016-05-02 14:35:
#include <sys/mutex.h> #include <sys/mutex.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <crypto/rijndael/rijndael-api-fst.h> #include <crypto/rijndael/rijndael-api-fst.h>
#include <crypto/sha2/sha256.h> #include <crypto/sha2/sha256.h>
...@@ -52,6 +51,8 @@ __FBSDID("$FreeBSD: releng/11.4/sys/dev/random/yarrow.c 298923 2016-05-02 14:35: ...@@ -52,6 +51,8 @@ __FBSDID("$FreeBSD: releng/11.4/sys/dev/random/yarrow.c 298923 2016-05-02 14:35:
#include <string.h> #include <string.h>
#include <sys/mutex.h> #include <sys/mutex.h>
#include "los_init.h"
#include "unit_test.h" #include "unit_test.h"
#include <crypto/rijndael/rijndael-api-fst.h> #include <crypto/rijndael/rijndael-api-fst.h>
...@@ -483,3 +484,12 @@ run_harvester_iterate(void *arg __unused) ...@@ -483,3 +484,12 @@ run_harvester_iterate(void *arg __unused)
(void)memset_s(buf, sizeof(buf), 0, sizeof(buf)); (void)memset_s(buf, sizeof(buf), 0, sizeof(buf));
#endif #endif
} }
#if defined(LOSCFG_HW_RANDOM_ENABLE) || defined(LOSCFG_DRIVERS_RANDOM)
UINT32 OsDriverRandomInit(VOID)
{
random_alg_context.ra_init_alg(NULL);
run_harvester_iterate(NULL);
return LOS_OK;
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册