ARC: add TLS support for ARCv3
For ARCv3 the register is fixed to r30, so we don't need to configure it at compile-time. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
parent
0a5137f109
commit
93bf5f58e7
2 changed files with 12 additions and 4 deletions
|
@ -12,8 +12,11 @@ zephyr_cc_option(-fno-delete-null-pointer-checks)
|
||||||
|
|
||||||
zephyr_cc_option_ifdef(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS -munaligned-access)
|
zephyr_cc_option_ifdef(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS -munaligned-access)
|
||||||
|
|
||||||
# Instruct compiler to use register R26 as thread pointer
|
if(CONFIG_ISA_ARCV2)
|
||||||
# for thread local storage.
|
# Instruct compiler to use register R26 as thread pointer
|
||||||
zephyr_cc_option_ifdef(CONFIG_THREAD_LOCAL_STORAGE -mtp-regno=26)
|
# for thread local storage.
|
||||||
|
# For ARCv3 the register is fixed to r30, so we don't need to specify it
|
||||||
|
zephyr_cc_option_ifdef(CONFIG_THREAD_LOCAL_STORAGE -mtp-regno=26)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
|
|
|
@ -122,8 +122,13 @@ static inline void arch_setup_callee_saved_regs(struct k_thread *thread,
|
||||||
ARG_UNUSED(regs);
|
ARG_UNUSED(regs);
|
||||||
|
|
||||||
#ifdef CONFIG_THREAD_LOCAL_STORAGE
|
#ifdef CONFIG_THREAD_LOCAL_STORAGE
|
||||||
/* R26 is used for thread pointer */
|
#ifdef CONFIG_ISA_ARCV2
|
||||||
|
/* R26 is used for thread pointer for ARCv2 */
|
||||||
regs->r26 = thread->tls;
|
regs->r26 = thread->tls;
|
||||||
|
#else
|
||||||
|
/* R30 is used for thread pointer for ARCv3 */
|
||||||
|
regs->r30 = thread->tls;
|
||||||
|
#endif /* CONFIG_ISA_ARCV2 */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue