xtensa: remove z_arch_get_next_switch_handle

Fold z_arch_get_next_switch_handle() into return_to(). This is
not exactly an arch interface, and is simple enough to be
moved into return_to().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2023-12-08 12:33:14 -08:00 committed by Carles Cufí
commit b2f20d65b3

View file

@ -141,22 +141,14 @@ static ALWAYS_INLINE void usage_stop(void)
#endif
}
#ifdef CONFIG_MULTITHREADING
void *z_arch_get_next_switch_handle(struct k_thread *interrupted)
{
return _current_cpu->nested <= 1 ?
z_get_next_switch_handle(interrupted) : interrupted;
}
#else
void *z_arch_get_next_switch_handle(struct k_thread *interrupted)
{
return interrupted;
}
#endif /* CONFIG_MULTITHREADING */
static inline void *return_to(void *interrupted)
{
return z_arch_get_next_switch_handle(interrupted);
#ifdef CONFIG_MULTITHREADING
return _current_cpu->nested <= 1 ?
z_get_next_switch_handle(interrupted) : interrupted;
#else
return interrupted;
#endif /* CONFIG_MULTITHREADING */
}
/* The wrapper code lives here instead of in the python script that