From 0efce03d03c9a527b9b8546d89dedc945ca6bc45 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Nov 2022 09:09:57 -0700 Subject: [PATCH] arc: Set tp regno to 26 for Zephyr Zephyr needs a consistent thread pointer register which is respected by all code, not just the OS. Use register 26 to be compatible with existing Zephyr source. Signed-off-by: Keith Packard --- gcc/config/arc/elf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/elf.h b/gcc/config/arc/elf.h index 6646ca51c93a4..16b0af2ade304 100644 --- a/gcc/config/arc/elf.h +++ b/gcc/config/arc/elf.h @@ -55,9 +55,9 @@ along with GCC; see the file COPYING3. If not see # endif #endif -/* Bare-metal toolchains do not need a thread pointer register. */ +/* Zephyr toolchain use register 26 as a thread pointer register. */ #undef TARGET_ARC_TP_REGNO_DEFAULT -#define TARGET_ARC_TP_REGNO_DEFAULT -1 +#define TARGET_ARC_TP_REGNO_DEFAULT 26 /* Indexed loads are default. */ #undef TARGET_INDEXED_LOADS_DEFAULT