Test: Allow CPU to enter low-power mode after tests
Changes the test thread functions to exit at the end instead of busy
looping. Changes the CMSIS idle thread to call WFE instead of busy
waiting. In combination, this allows the CPU to enter the idle thread
and then go into low power state once the tests finish.
As well as reducing power on real HW, this significantly improves FVP
performance where multiple CPUs are being simulated, since time is not
wasted simulating an idle CPU.
Change-Id: I405013b31deb211aba3e965a83550abef47bb8fd
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/app_broker/os_config_cmsis_rtx.c b/app_broker/os_config_cmsis_rtx.c
new file mode 100644
index 0000000..440cd14
--- /dev/null
+++ b/app_broker/os_config_cmsis_rtx.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2023, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include "cmsis_compiler.h"
+#include "rtx_os.h"
+
+/* This is an example OS configuration implementation for CMSIS-RTX */
+
+/* OS Idle Thread implemented to put the CPU into low-power state until an event
+ * occurs. The regular SysTick will still wake the CPU.
+ */
+__NO_RETURN void osRtxIdleThread(void *argument)
+{
+ (void)argument;
+
+ for (;;) {
+ __WFE();
+ }
+}