From e559c86d770f4ec1cf1ea23cdc856024f57288e5 Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Fri, 9 Oct 2020 15:33:49 +0800 Subject: [PATCH] Workaround missing machine_resource_init in BSD initialization BSD compatibility is not optional for the kernel to build, however platform dependent portion of this configuration, machine_resource_init(), which is called by nexus_init() is implemented only in the platform specific library for HiSilicon chips (libhi35xx_bsp.a). Workaround lack of this library, so that the kernel can be built for other platforms as well, by excluding it from the compilation. This change should be removed as soon as the appropriate function is implemented for other platforms. Signed-off-by: Zbigniew Bodek Change-Id: I66f15b167b9769f17820f5f0edb7ae8b0ebc9246 --- kernel/common/los_config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/common/los_config.c b/kernel/common/los_config.c index 2de7b995..a9b78390 100644 --- a/kernel/common/los_config.c +++ b/kernel/common/los_config.c @@ -210,7 +210,17 @@ LITE_OS_SEC_TEXT_INIT STATIC VOID OsDriverHiEventInit(VOID) extern void configure (void); LITE_OS_SEC_TEXT_INIT STATIC INT32 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; } -- GitLab