1 /* 2 * Copyright (c) 2021 Telink Semiconductor 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef SOC_RISCV_TELINK_B91_SOC_CONTEXT_H 8 #define SOC_RISCV_TELINK_B91_SOC_CONTEXT_H 9 10 #ifdef CONFIG_RISCV_SOC_CONTEXT_SAVE 11 12 /* Telink B91 specific registers. */ 13 #if defined(CONFIG_TELINK_B91_PFT_ARCH) && defined(__riscv_dsp) 14 #define SOC_ESF_MEMBERS \ 15 uint32_t mxstatus; \ 16 uint32_t ucode \ 17 18 #define SOC_ESF_INIT \ 19 0xdeadbaad, \ 20 0xdeadbaad 21 22 #define SOC_ESF_THREAD_INIT(soc_context) \ 23 (soc_context)->mxstatus = 0; \ 24 (soc_context)->ucode = 0 25 26 #elif defined(CONFIG_TELINK_B91_PFT_ARCH) 27 #define SOC_ESF_MEMBERS \ 28 uint32_t mxstatus 29 30 #define SOC_ESF_INIT \ 31 0xdeadbaad 32 33 #define SOC_ESF_THREAD_INIT(soc_context) \ 34 (soc_context)->mxstatus = 0 35 36 #elif defined(__riscv_dsp) 37 38 #define SOC_ESF_MEMBERS \ 39 uint32_t ucode 40 41 #define SOC_ESF_INIT \ 42 0xdeadbaad 43 44 #define SOC_ESF_THREAD_INIT(soc_context) \ 45 (soc_context)->ucode = 0 46 #endif 47 48 #endif /* CONFIG_RISCV_SOC_CONTEXT_SAVE */ 49 50 #endif /* SOC_RISCV_TELINK_B91_SOC_CONTEXT_H */ 51