arch: arc: refactor the arc stack check support
* the original stack check codes have no consideration for userspace case. This will wrong cause possible stack check exception. * this commit refactors the arc stack check support to support the usperspace. * this commit fixes #7885. All the failed tests in #7885 are run again to verify this commit. The test results are ok Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
This commit is contained in:
parent
4a693c3c38
commit
b829bc78c1
10 changed files with 106 additions and 35 deletions
|
@ -242,6 +242,32 @@ extern "C" {
|
|||
|
||||
.endm
|
||||
|
||||
.macro _load_stack_check_regs
|
||||
#ifdef CONFIG_ARC_HAS_SECURE
|
||||
ld r3, [r2, _thread_offset_to_k_stack_base]
|
||||
sr r3, [_ARC_V2_S_KSTACK_BASE]
|
||||
ld r3, [r2, _thread_offset_to_k_stack_top]
|
||||
sr r3, [_ARC_V2_S_KSTACK_TOP]
|
||||
#ifdef CONFIG_USERSPACE
|
||||
ld r3, [r2, _thread_offset_to_u_stack_base]
|
||||
sr r3, [_ARC_V2_S_USTACK_BASE]
|
||||
ld r3, [r2, _thread_offset_to_u_stack_top]
|
||||
sr r3, [_ARC_V2_S_USTACK_TOP]
|
||||
#endif
|
||||
#else /* CONFIG_ARC_HAS_SECURE */
|
||||
ld r3, [r2, _thread_offset_to_k_stack_base]
|
||||
sr r3, [_ARC_V2_KSTACK_BASE]
|
||||
ld r3, [r2, _thread_offset_to_k_stack_top]
|
||||
sr r3, [_ARC_V2_KSTACK_TOP]
|
||||
#ifdef CONFIG_USERSPACE
|
||||
ld r3, [r2, _thread_offset_to_u_stack_base]
|
||||
sr r3, [_ARC_V2_USTACK_BASE]
|
||||
ld r3, [r2, _thread_offset_to_u_stack_top]
|
||||
sr r3, [_ARC_V2_USTACK_TOP]
|
||||
#endif
|
||||
#endif /* CONFIG_ARC_HAS_SECURE */
|
||||
.endm
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue