aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/processor.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-06-03 11:31:14 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2022-09-13 18:28:00 -0700
commite3ddb8bbe0f8cc994748c81e17acc58fda6f8abe (patch)
treec4a5c648f6622b6c655b3cbd02d7575e30898b58 /arch/xtensa/include/asm/processor.h
parentxtensa: clean up ELF_PLAT_INIT macro (diff)
downloadlinux-dev-e3ddb8bbe0f8cc994748c81e17acc58fda6f8abe.tar.xz
linux-dev-e3ddb8bbe0f8cc994748c81e17acc58fda6f8abe.zip
xtensa: add FDPIC and static PIE support for noMMU
Define ELFOSABI_XTENSA_FDPIC and use it as an OSABI tag in the ELF header to distinguish FDPIC ELF files from regular ELF files. Define ELF_FDPIC_PLAT_INIT and put executable map, interpreter map and executable dynamic section addresses into registers a4..a6. Update start_thread macro to preserve register values in the current register window. Add definitions for PTRACE_GETFDPIC, PTRACE_GETFDPIC_EXEC and PTRACE_GETFDPIC_INTERP. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r--arch/xtensa/include/asm/processor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index 76bc63127c66..b75ba16ec080 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -205,9 +205,12 @@ struct thread_struct {
#define start_thread(regs, new_pc, new_sp) \
do { \
unsigned long syscall = (regs)->syscall; \
+ unsigned long current_aregs[16]; \
+ memcpy(current_aregs, (regs)->areg, sizeof(current_aregs)); \
memset((regs), 0, sizeof(*(regs))); \
(regs)->pc = (new_pc); \
(regs)->ps = USER_PS_VALUE; \
+ memcpy((regs)->areg, current_aregs, sizeof(current_aregs)); \
(regs)->areg[1] = (new_sp); \
(regs)->areg[0] = 0; \
(regs)->wmask = 1; \