diff --git a/core/lib/init.c b/core/lib/init.c index 6b3cccd3e4..e21f6bff84 100644 --- a/core/lib/init.c +++ b/core/lib/init.c @@ -74,6 +74,17 @@ static void *main_trampoline(void *arg) } #endif +#ifdef CPU_NATIVE + extern unsigned _native_retval; + if (!_native_retval) { + _native_retval = res; + } +#endif + + if (IS_ACTIVE(CONFIG_CORE_EXIT_WITH_MAIN)) { + pm_off(); + } + return NULL; }