blob: c601311801bd2cb499998da35ed425544b1166af [file] [log] [blame]
Ken Liu91d44da2018-09-20 22:42:31 +08001/*
Summer Qin5fdcf632020-06-22 16:49:24 +08002 * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
Ken Liu91d44da2018-09-20 22:42:31 +08003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7#include <inttypes.h>
Summer Qin5fdcf632020-06-22 16:49:24 +08008#include "utilities.h"
Edison Ai93dabfd2019-12-03 13:44:45 +08009#include "tfm_spm_hal.h"
Ken Liu91d44da2018-09-20 22:42:31 +080010
Edison Ai9059ea02019-11-28 13:46:14 +080011void tfm_core_panic(void)
Ken Liu91d44da2018-09-20 22:42:31 +080012{
Edison Ai93dabfd2019-12-03 13:44:45 +080013 /*
14 * FixMe: In the first stage, the SPM will restart the entire system when a
15 * programmer error is detected in either the SPE or NSPE.
16 * In the next stage, the specified error codes are also sent to any NSPE
17 * management firmware. The NSPE management firmware can then decide to pass
18 * those error codes back to the calling task or to use its own
19 * functionality for terminating an execution context.
20 */
21 tfm_spm_hal_system_reset();
Ken Liu91d44da2018-09-20 22:42:31 +080022}
Summer Qin5fdcf632020-06-22 16:49:24 +080023
24bool tfm_is_one_bit_set(uint32_t n)
25{
26 return ((n && !(n & (n-1))) ? true : false);
27}