nios2: _Swap(): fix C calling issue

The code expected r10 to be preserved across the call to the
event logger, which wasn't reasonable given that it is caller-
saved.

Change-Id: I694357ea7ee9b410b93b5a0894e8c38c53127363
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-07-12 09:54:54 -07:00 committed by Inaky Perez-Gonzalez
commit 448334c2eb

View file

@ -63,6 +63,11 @@ SECTION_FUNC(exception.other, _Swap)
#if CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
call _sys_k_event_logger_context_switch
/* Restore caller-saved r10. We could have stuck its value
* onto the stack, but less instructions to just use immediates
*/
movhi r10, %hi(_nanokernel)
ori r10, r10, %lo(_nanokernel)
#endif
/* Find the next context to run. Choose _nanokernel.fiber