1 /*
2  * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 /*
10 Note: This is a compatibility header. Call the interfaces in esp_cpu.h instead
11 */
12 
13 #include "soc/soc_caps.h"
14 #include "hal/soc_ll.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #if SOC_CPU_CORES_NUM > 1   // We only allow stalling/unstalling of other cores
21 /**
22  * Stall the specified CPU core.
23  *
24  * @note Has no effect if the core is already stalled - does not return an
25  * ESP_ERR_INVALID_STATE.
26  *
27  * @param core core to stall [0..SOC_CPU_CORES_NUM - 1]
28  */
29 #define soc_hal_stall_core(core)        soc_ll_stall_core(core)
30 
31 /**
32  * Unstall the specified CPU core.
33  *
34  * @note Has no effect if the core is already unstalled - does not return an
35  * ESP_ERR_INVALID_STATE.
36  *
37  * @param core core to unstall [0..SOC_CPU_CORES_NUM - 1]
38  */
39 #define soc_hal_unstall_core(core)      soc_ll_unstall_core(core)
40 #endif // SOC_CPU_CORES_NUM > 1
41 
42 /**
43  * Reset the specified core.
44  *
45  * @param core core to reset [0..SOC_CPU_CORES_NUM - 1]
46  */
47 #define soc_hal_reset_core(core)        soc_ll_reset_core((core))
48 
49 #ifdef __cplusplus
50 }
51 #endif
52