arch: riscv: pmp: Fix is_user_mode in RV64
Currently, is_user_mode is 8-byte in riscv64 and it breaks a 4-byte PMP region protecting it. Because is_user_mode is a single flag, we could just fix it's size to 4-byte in both riscv32 and riscv64. Signed-off-by: Jim Shu <cwshu09@gmail.com>
This commit is contained in:
parent
10e618ff33
commit
fd2c07682e
3 changed files with 3 additions and 3 deletions
|
@ -68,7 +68,7 @@ struct riscv_pmp_region {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
extern ulong_t is_user_mode;
|
extern uint32_t is_user_mode;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* Glogal variable used to know the current mode running.
|
* Glogal variable used to know the current mode running.
|
||||||
* Is not boolean because it must match the PMP granularity of the arch.
|
* Is not boolean because it must match the PMP granularity of the arch.
|
||||||
*/
|
*/
|
||||||
ulong_t is_user_mode;
|
uint32_t is_user_mode;
|
||||||
bool irq_flag;
|
bool irq_flag;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ static inline uintptr_t arch_syscall_invoke0(uintptr_t call_id)
|
||||||
static inline bool arch_is_user_context(void)
|
static inline bool arch_is_user_context(void)
|
||||||
{
|
{
|
||||||
/* Defined in arch/riscv/core/thread.c */
|
/* Defined in arch/riscv/core/thread.c */
|
||||||
extern ulong_t is_user_mode;
|
extern uint32_t is_user_mode;
|
||||||
return is_user_mode;
|
return is_user_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue