bugfix: GetBootStageHookMgr auto create HookMgr

1) GetBootStageHookMgr中自动创建HookMgr,便于静态链接模块使用。

Signed-off-by: handyohos <zhangxiaotian@huawei.com>
Change-Id: I585f73d7ca8117da79599a8231dbd6b74e07345b
This commit is contained in:
handyohos 2022-06-27 22:53:07 +08:00
parent 1261fd89ca
commit 2ef9602319

View File

@ -254,6 +254,15 @@ static HOOK_MGR *bootStageHookMgr = NULL;
HOOK_MGR *GetBootStageHookMgr()
{
if (bootStageHookMgr != NULL) {
return bootStageHookMgr;
}
/*
* Create bootstage hook manager for booting only.
* When boot completed, this manager will be destroyed.
*/
bootStageHookMgr = HookMgrCreate(INIT_BOOTSTAGE_HOOK_NAME);
return bootStageHookMgr;
}
@ -359,12 +368,6 @@ void SystemConfig(void)
options.preHook = InitPreHook;
options.postHook = InitPostHook;
/*
* Create bootstage hook manager for booting only.
* When boot completed, this manager will be destroyed.
*/
bootStageHookMgr = HookMgrCreate(INIT_BOOTSTAGE_HOOK_NAME);
HookMgrExecute(GetBootStageHookMgr(), INIT_GLOBAL_INIT, (void *)&timingStat, (void *)&options);
InitServiceSpace();