Commit c0e50d41 authored by Chris Zankel's avatar Chris Zankel

xtensa: fix fast_syscall_spill_registers

The original implementation could clobber registers under certain conditions.

The Xtensa processor architecture uses windowed registers and the original
implementation was using a4 as a temporary register, which under certain
conditions could be register a0 of the oldest window frame, and didn't always
restore the content correctly.

By moving the _spill_registers routine inside the fast system call, it frees
up one more register (the return address is not required anymore) for the
spill routine.
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 6b5a1f74
...@@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector) ...@@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector)
/* Check for overflow/underflow exception, jump if overflow. */ /* Check for overflow/underflow exception, jump if overflow. */
_bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow
/* /*
* Restart window underflow exception. * Restart window underflow exception.
......
...@@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw); ...@@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl); EXPORT_SYMBOL(insl);
extern long common_exception_return; extern long common_exception_return;
extern long _spill_registers;
EXPORT_SYMBOL(common_exception_return); EXPORT_SYMBOL(common_exception_return);
EXPORT_SYMBOL(_spill_registers);
#ifdef CONFIG_FUNCTION_TRACER #ifdef CONFIG_FUNCTION_TRACER
EXPORT_SYMBOL(_mcount); EXPORT_SYMBOL(_mcount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment