diff --git a/arch/arm/core/swap.c b/arch/arm/core/swap.c index 204fe263cf5..f0de57d22f8 100644 --- a/arch/arm/core/swap.c +++ b/arch/arm/core/swap.c @@ -41,11 +41,11 @@ extern const int _k_neg_eagain; * On ARMv6-M, the intlock key is represented by the PRIMASK register, * as BASEPRI is not available. * - * @return may contain a return value setup by a call to + * @return -EAGAIN, or a return value set by a call to * _set_thread_return_value() * */ -unsigned int __swap(int key) +int __swap(int key) { #ifdef CONFIG_USERSPACE /* Save off current privilege mode */ diff --git a/arch/posix/core/swap.c b/arch/posix/core/swap.c index 6278764be9f..3240e7bbba5 100644 --- a/arch/posix/core/swap.c +++ b/arch/posix/core/swap.c @@ -34,7 +34,7 @@ * */ -unsigned int __swap(unsigned int key) +int __swap(unsigned int key) { /* * struct k_thread * _kernel.current is the currently runnig thread diff --git a/kernel/include/kswap.h b/kernel/include/kswap.h index a838498df87..01ac1f07533 100644 --- a/kernel/include/kswap.h +++ b/kernel/include/kswap.h @@ -40,7 +40,7 @@ void _smp_release_global_lock(struct k_thread *thread); * Needed for SMP, where the scheduler requires spinlocking that we * don't want to have to do in per-architecture assembly. */ -static inline unsigned int _Swap(unsigned int key) +static inline int _Swap(unsigned int key) { struct k_thread *new_thread, *old_thread; int ret = 0; @@ -90,11 +90,11 @@ static inline unsigned int _Swap(unsigned int key) #else /* !CONFIG_USE_SWITCH */ -extern unsigned int __swap(unsigned int key); +extern int __swap(unsigned int key); -static inline unsigned int _Swap(unsigned int key) +static inline int _Swap(unsigned int key) { - unsigned int ret; + int ret; _check_stack_sentinel(); _update_time_slice_before_swap();