Change script for apply upstream code
[platform/upstream/connectedhomeip.git] / third_party / openthread / repo / third_party / NordicSemiconductor / libraries / nrf_security / nrf_cc310_plat / src / nrf_cc310_platform_abort_zephyr.c
1
2 /**
3  * Copyright (c) 2019 Nordic Semiconductor ASA
4  *
5  * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
6  */
7 #include <kernel.h>
8 #include <power/reboot.h>
9 //#include <logging/log.h>
10 //LOG_MODULE_DECLARE(cc310_platform);
11
12 #include "nrf_cc310_platform_abort.h"
13
14
15 /** @brief Definition of abort function used for Zephyr
16  */
17 static void abort_function(char const * const reason)
18 {
19         //LOG_ERR("Reason: %s", reason);
20 #ifdef CONFIG_REBOOT
21         //LOG_ERR("Rebooting");
22         sys_reboot(SYS_REBOOT_WARM);
23 #else
24         //LOG_ERR("Halted");
25         while(1);
26 #endif
27 }
28
29
30 /** @brief Definition of abort API to set in nrf_cc310_platform
31  */
32 static const nrf_cc310_platform_abort_apis_t apis =
33 {
34         .abort_handle = NULL,
35         .abort_fn = abort_function,
36 };
37
38 /** @brief Function to initialize the nrf_cc310_platform abort APIs.
39  */
40 void nrf_cc310_platform_abort_init(void)
41 {
42         nrf_cc310_platform_set_abort(&apis);
43 }