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/tests_psa_arch/test_app.c b/tests_psa_arch/test_app.c
index 80190bd..74f98ec 100644
--- a/tests_psa_arch/test_app.c
+++ b/tests_psa_arch/test_app.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -7,6 +7,7 @@
#include "test_app.h"
#include "tfm_log.h"
+#include "os_wrapper/thread.h"
/**
* \brief This symbol is the entry point provided by the PSA API compliance
@@ -29,6 +30,5 @@
LOG_MSG("\x04");
/* End of test */
- for (;;) {
- }
+ os_wrapper_thread_exit();
}