blob: 90cd4da3a45204c5a0d245e3f283136a6104be2d [file] [log] [blame]
Kevin Peng33d03942021-06-08 11:28:41 +08001/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include "cmsis.h"
9#include "fih.h"
Kevin Pengaaf994d2021-07-20 17:38:18 +080010#include "psa/service.h"
Kevin Peng33d03942021-06-08 11:28:41 +080011
12void tfm_idle_thread(void)
13{
14 while (1) {
Kevin Pengaaf994d2021-07-20 17:38:18 +080015 /*
16 * There could be other Partitions becoming RUNABLE after wake up.
17 * This is a dummy psa_wait to let SPM check possible scheduling.
18 * It does not expect any signals.
19 */
20 if (psa_wait(PSA_WAIT_ANY, PSA_POLL) == 0) {
21 __WFI();
22 }
Kevin Peng33d03942021-06-08 11:28:41 +080023 }
24
25#ifdef TFM_FIH_PROFILE_ON
26 fih_delay();
27
28 while (1) {
Kevin Pengaaf994d2021-07-20 17:38:18 +080029 /*
30 * There could be other Partitions becoming RUNABLE after wake up.
31 * This is a dummy psa_wait to let SPM check possible scheduling.
32 * It does not expect any signals.
33 */
34 if (psa_wait(PSA_WAIT_ANY, PSA_POLL) == 0) {
35 __WFI();
36 }
Kevin Peng33d03942021-06-08 11:28:41 +080037 }
38#endif
39}