Skip to content
Permalink
Browse files

kernel: init: exclude some funcs from coverage

data copying and bss zero are called from arch code
before z_cstart(), and coverage data gathering doesn't
work properly at that point. Not all arches use this
code anyway, some do it in optimized assembly instead.

Weak main() is also excluded; it does nothing and every
test overrides it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information...
andrewboie authored and nashif committed Jun 11, 2019
1 parent d87a90e commit fe228a818455da8c4bde2a187436151a9f8d073f
Showing with 14 additions and 1 deletion.
  1. +14 −1 kernel/init.c
@@ -133,6 +133,13 @@ K_THREAD_STACK_DEFINE(_interrupt_stack3, CONFIG_ISR_STACK_SIZE);
extern void idle(void *unused1, void *unused2, void *unused3);


/* LCOV_EXCL_START
*
* This code is called so early in the boot process that code coverage
* doesn't work properly. In addition, not all arches call this code,
* some like x86 do this with optimized assembly
*/

/**
*
* @brief Clear BSS
@@ -215,7 +222,9 @@ void z_data_copy(void)
#endif /* CONFIG_STACK_CANARIES */
#endif /* CONFIG_USERSPACE */
}
#endif
#endif /* CONFIG_XIP */

/* LCOV_EXCL_STOP */

/**
*
@@ -284,12 +293,16 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
_main_thread->base.user_options &= ~K_ESSENTIAL;
}

/* LCOV_EXCL_START */

void __weak main(void)
{
/* NOP default main() if the application does not provide one. */
arch_nop();
}

/* LCOV_EXCL_STOP */

#if defined(CONFIG_MULTITHREADING)
static void init_idle_thread(struct k_thread *thr, k_thread_stack_t *stack)
{

0 comments on commit fe228a8

Please sign in to comment.
You can’t perform that action at this time.