19#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_THREAD_H_
20#define ZEPHYR_INCLUDE_ARCH_RISCV_THREAD_H_
25#if !defined(RV_FP_TYPE) && defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
26#ifdef CONFIG_CPU_HAS_FPU_DOUBLE_PRECISION
27#define RV_FP_TYPE uint64_t
29#define RV_FP_TYPE uint32_t
33#ifdef CONFIG_RISCV_PMP
35#define RISCV_PMP_CFG_NUM (CONFIG_PMP_SLOT >> 3)
37#define RISCV_PMP_CFG_NUM (CONFIG_PMP_SLOT >> 2)
41#ifdef CONFIG_PMP_STACK_GUARD
49#define PMP_REGION_NUM_FOR_STACK_GUARD 6
50#define PMP_CFG_CSR_NUM_FOR_STACK_GUARD 2
53#ifdef CONFIG_PMP_POWER_OF_TWO_ALIGNMENT
54#ifdef CONFIG_USERSPACE
55#ifdef CONFIG_PMP_STACK_GUARD
62#define PMP_REGION_NUM_FOR_U_THREAD 4
69#define PMP_REGION_NUM_FOR_U_THREAD 3
71#define PMP_MAX_DYNAMIC_REGION (CONFIG_PMP_SLOT - PMP_REGION_NUM_FOR_U_THREAD)
76#ifdef CONFIG_USERSPACE
77#ifdef CONFIG_PMP_STACK_GUARD
84#define PMP_REGION_NUM_FOR_U_THREAD 6
91#define PMP_REGION_NUM_FOR_U_THREAD 5
93#define PMP_MAX_DYNAMIC_REGION ((CONFIG_PMP_SLOT - \
94 PMP_REGION_NUM_FOR_U_THREAD) >> 1)
102struct _callee_saved {
118#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
134typedef struct _callee_saved _callee_saved_t;
139#ifdef CONFIG_PMP_STACK_GUARD
140 ulong_t s_pmpcfg[PMP_CFG_CSR_NUM_FOR_STACK_GUARD];
141 ulong_t s_pmpaddr[PMP_REGION_NUM_FOR_STACK_GUARD];
144#ifdef CONFIG_USERSPACE
148 ulong_t u_pmpcfg[RISCV_PMP_CFG_NUM];
149 ulong_t u_pmpaddr[CONFIG_PMP_SLOT];
153typedef struct _thread_arch _thread_arch_t;
#define RV_FP_TYPE
Definition: thread.h:29
unsigned long ulong_t
Definition: types.h:18
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60