arch/xtensa: Use ZSR assignments for stack flush markers
The kernel coherence cache flush code was using a scratch register to mark the top of the stack. Likewise a good candidate for ZSR use. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
3c7905b916
commit
642fc7ad54
2 changed files with 3 additions and 7 deletions
|
@ -248,11 +248,10 @@ xtensa_switch:
|
|||
call0 xtensa_save_high_regs
|
||||
|
||||
#ifdef CONFIG_KERNEL_COHERENCE
|
||||
/* Flush the stack. The top of stack was stored for us in
|
||||
* EXCSAVE3 (FIXME: shouldn't be hardcoded!) by
|
||||
/* Flush the stack. The top of stack was stored for us by
|
||||
* arch_cohere_stacks(). It can be NULL for a dummy thread.
|
||||
*/
|
||||
rsr.EXCSAVE3 a0
|
||||
rsr a0, ZSR_FLUSH
|
||||
beqz a0, noflush
|
||||
mov a3, a1
|
||||
flushloop:
|
||||
|
|
|
@ -137,12 +137,9 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread,
|
|||
z_xtensa_cache_flush((void *)osp, 1);
|
||||
z_xtensa_cache_inv((void *)ostack, osp - ostack);
|
||||
|
||||
/* FIXME: hardcoding EXCSAVE3 is bad, should be
|
||||
* configurable a-la XTENSA_KERNEL_CPU_PTR_SR.
|
||||
*/
|
||||
uint32_t end = ostack + osz;
|
||||
|
||||
__asm__ volatile("wsr.EXCSAVE3 %0" :: "r"(end));
|
||||
__asm__ volatile("wsr %0, " ZSR_FLUSH_STR :: "r"(end));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue