]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/src/shutdown.c
Update RISCC-V-RV32-SiFive_HiFive1_FreedomStudio project to latest tools and metal...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_FreedomStudio / freedom-metal / src / shutdown.c
1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 #include <metal/machine.h>
5 #include <metal/shutdown.h>
6
7 extern __inline__ void __metal_shutdown_exit(const struct __metal_shutdown *sd, int code);
8
9 #if defined(__METAL_DT_SHUTDOWN_HANDLE)
10 void metal_shutdown(int code)
11 {
12     __metal_shutdown_exit(__METAL_DT_SHUTDOWN_HANDLE, code);
13 }
14 #else
15 #pragma message("There is no defined shutdown mechanism, metal_shutdown() will spin.")
16 void metal_shutdown(int code)
17 {
18     while (1) {
19       __asm__ volatile ("nop");
20     }
21 }
22 #endif