ztest: fix ztest_1cpu_user_unit_test()
The start/stop functions do a whole pile of supervisor- only stuff; resolve this by making them ztest-specific system calls. Fixes: #20927 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
9849c7d3e7
commit
c1863875b7
3 changed files with 25 additions and 4 deletions
|
@ -130,8 +130,8 @@ static inline void unit_test_noop(void)
|
|||
#define ztest_user_unit_test(fn) \
|
||||
ztest_user_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop)
|
||||
|
||||
extern void z_test_1cpu_start(void);
|
||||
extern void z_test_1cpu_stop(void);
|
||||
__syscall void z_test_1cpu_start(void);
|
||||
__syscall void z_test_1cpu_stop(void);
|
||||
|
||||
/**
|
||||
* @brief Define a SMP-unsafe test function
|
||||
|
@ -206,6 +206,9 @@ extern struct k_mem_domain ztest_mem_domain;
|
|||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifndef ZTEST_UNITTEST
|
||||
#include <syscalls/ztest_test.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ static void cpu_hold(void *arg1, void *arg2, void *arg3)
|
|||
arch_irq_unlock(key);
|
||||
}
|
||||
|
||||
void z_test_1cpu_start(void)
|
||||
void z_impl_z_test_1cpu_start(void)
|
||||
{
|
||||
cpuhold_active = 1;
|
||||
|
||||
|
@ -116,7 +116,7 @@ void z_test_1cpu_start(void)
|
|||
}
|
||||
}
|
||||
|
||||
void z_test_1cpu_stop(void)
|
||||
void z_impl_z_test_1cpu_stop(void)
|
||||
{
|
||||
cpuhold_active = 0;
|
||||
|
||||
|
@ -125,6 +125,19 @@ void z_test_1cpu_stop(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
void z_vrfy_z_test_1cpu_start(void)
|
||||
{
|
||||
z_impl_z_test_1cpu_start();
|
||||
}
|
||||
#include <syscalls/z_test_1cpu_start_mrsh.c>
|
||||
|
||||
void z_vrfy_z_test_1cpu_stop(void)
|
||||
{
|
||||
z_impl_z_test_1cpu_stop();
|
||||
}
|
||||
#include <syscalls/z_test_1cpu_stop_mrsh.c>
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
#endif
|
||||
|
||||
static void run_test_functions(struct unit_test *test)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue