kernel: swap: Fix __swap signature
__swap function was returning -EAGAIN in some case, though its return value was declared as unsigned int. This commit changes this function to return int since it can return a negative value and its return was already been propagate as int. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
91b6123932
commit
8a9ba10c2c
3 changed files with 7 additions and 7 deletions
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue