zephyr/subsys/testsuite
Peter Mitsis 87ca079e49 tests: z_test_1cpu_start() makes only CPU0 active
When z_test_1cpu_start() is called to ensure that only a single CPU
on an SMP system is available for use in a test, this commit will
ensure that that CPU is the primary CPU--CPU0. This is done because
some timer drivers only have the timer interrupt processed by one CPU.

A bit of a song and dance is performed to achieve this without enabling
the CPU mask/affinity pinning API. If the cpuhold thread is found to
be executing on CPU0, then a new copy of cpuhold thread is created. Once
the new copy is executing (incidentally guaranteed to be on another CPU)
then it informs the original copy and busy waits until it the original
copy is switched out of CPU0. At this point, we can create the next
cpuhold thread to occupy another CPU if needed.

During this song and dance, it is critical that the 'copy' not pend. If
it pends, we can not guarantee which CPU it will execute on when it
unpends. As the cpuhold threads have the highest priority, nothing is
going to cause them to execute on another CPU for as long as they do
not pend.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-03-26 18:07:41 -05:00
..
arch unittest: update unittest to hwmv2 2024-03-22 11:51:58 +01:00
boards/unit_testing/unit_testing unittest: update unittest to hwmv2 2024-03-22 11:51:58 +01:00
busy_sim random: Rename random header 2023-10-10 14:23:50 +03:00
coverage testsuite: coverage: allow access to gcov internals 2023-11-29 04:59:47 -08:00
include/zephyr arch: move arch_interface.h under zephyr/arch 2024-03-25 09:58:35 +00:00
soc/unit_testing/unit_testing unittest: update unittest to hwmv2 2024-03-22 11:51:58 +01:00
ztest tests: z_test_1cpu_start() makes only CPU0 active 2024-03-26 18:07:41 -05:00
CMakeLists.txt testsuite: coverage: allow access to gcov internals 2023-11-29 04:59:47 -08:00
Kconfig hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
Kconfig.defconfig testsuite: ztress: Use XOSHIRO generator when ztress is used 2022-09-08 05:43:17 -04:00