1 /* 2 * Copyright (c) 2019-2024, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #include "tfm_hal_device_header.h" 9 #include "tfm_hal_platform.h" 10 tfm_hal_system_reset(void)11void tfm_hal_system_reset(void) 12 { 13 NVIC_SystemReset(); 14 } 15 tfm_hal_system_halt(void)16void tfm_hal_system_halt(void) 17 { 18 /* 19 * Disable IRQs to stop all threads, not just the thread that 20 * halted the system. 21 */ 22 __disable_irq(); 23 24 /* 25 * Enter sleep to reduce power consumption and do it in a loop in 26 * case a signal wakes up the CPU. 27 */ 28 while (1) { 29 __WFE(); 30 } 31 } 32