Skip to content

Commit c658eac

Browse files
committed
[XTENSA] Add support for configurable registers and coprocessors
The Xtensa architecture allows to define custom instructions and registers. Registers that are bound to a coprocessor are only accessible if the corresponding enable bit is set, which allows to implement a 'lazy' context switch mechanism. Other registers needs to be saved and restore at the time of the context switch or during interrupt handling. This patch adds support for these additional states: - save and restore registers that are used by the compiler upon interrupt entry and exit. - context switch additional registers unbound to any coprocessor - 'lazy' context switch of registers bound to a coprocessor - ptrace interface to provide access to additional registers - update configuration files in include/asm-xtensa/variant-fsf Signed-off-by: Chris Zankel <[email protected]>
1 parent 71d28e6 commit c658eac

File tree

17 files changed

+1065
-874
lines changed

17 files changed

+1065
-874
lines changed

arch/xtensa/kernel/asm-offsets.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ int main(void)
6363
DEFINE(PT_SIZE, sizeof(struct pt_regs));
6464
DEFINE(PT_AREG_END, offsetof (struct pt_regs, areg[XCHAL_NUM_AREGS]));
6565
DEFINE(PT_USER_SIZE, offsetof(struct pt_regs, areg[XCHAL_NUM_AREGS]));
66+
DEFINE(PT_XTREGS_OPT, offsetof(struct pt_regs, xtregs_opt));
67+
DEFINE(XTREGS_OPT_SIZE, sizeof(xtregs_opt_t));
6668

6769
/* struct task_struct */
6870
DEFINE(TASK_PTRACE, offsetof (struct task_struct, ptrace));
@@ -76,7 +78,19 @@ int main(void)
7678
/* struct thread_info (offset from start_struct) */
7779
DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
7880
DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
79-
DEFINE(THREAD_CP_SAVE, offsetof (struct task_struct, thread.cp_save));
81+
DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable));
82+
#if XTENSA_HAVE_COPROCESSORS
83+
DEFINE(THREAD_XTREGS_CP0, offsetof (struct thread_info, xtregs_cp));
84+
DEFINE(THREAD_XTREGS_CP1, offsetof (struct thread_info, xtregs_cp));
85+
DEFINE(THREAD_XTREGS_CP2, offsetof (struct thread_info, xtregs_cp));
86+
DEFINE(THREAD_XTREGS_CP3, offsetof (struct thread_info, xtregs_cp));
87+
DEFINE(THREAD_XTREGS_CP4, offsetof (struct thread_info, xtregs_cp));
88+
DEFINE(THREAD_XTREGS_CP5, offsetof (struct thread_info, xtregs_cp));
89+
DEFINE(THREAD_XTREGS_CP6, offsetof (struct thread_info, xtregs_cp));
90+
DEFINE(THREAD_XTREGS_CP7, offsetof (struct thread_info, xtregs_cp));
91+
#endif
92+
DEFINE(THREAD_XTREGS_USER, offsetof (struct thread_info, xtregs_user));
93+
DEFINE(XTREGS_USER_SIZE, sizeof(xtregs_user_t));
8094
DEFINE(THREAD_CURRENT_DS, offsetof (struct task_struct, thread.current_ds));
8195

8296
/* struct mm_struct */

0 commit comments

Comments
 (0)