Ignore:
Timestamp:
Jul 31, 2017, 1:59:52 PM (7 years ago)
Author:
alain
Message:

Several modifs in the generic scheduler and in the hal_context to
fix the context switch mechanism.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.h

    r279 r296  
    3636/*********************************************************************************************
    3737 * This structure define the scheduler associated to a given core.
    38  * WARNING : the idle thread is executed when there is no runable thread in the list
    39  * of attached threads, but is NOT part of the list of attached threads.
    4038 ********************************************************************************************/
    4139
     
    7876 * This function handles pending signals for all registered threads, and tries to make
    7977 * a context switch for the core running the calling thread.
    80  * - If there is a runable thread (other than the current thread or the idle thread),
    81  *   the calling thread is descheduled, but its state is not modified.
     78 * - If the <next> argument is not NULL, this next thread starts execution.
     79 * - If <next> is NULL, it calls the sched_select() function. If there is a runable thread
     80 *   (other than current thread or idle thread), this selected thread starts execution.
    8281 * - If there is no other runable thread, the calling thread continues execution.
    8382 * - If there is no runable thread, the idle thread is executed.
     83 *********************************************************************************************
     84 * @ next  : local pointer on next thread to run / call sched_select() if NULL.
    8485 ********************************************************************************************/
    85 void sched_yield();
    86 
    87 /*********************************************************************************************
    88  * This function handles pending signals for all registered threads, and make
    89  * a context switch to the thread defined by the <thread> argument.
    90  * If the selected thread is not attached to the same core as the calling thread,
    91  * or is blocked, it causes a kernel panic.
    92  *********************************************************************************************
    93  * @ new   : local pointer on the thread to run.
    94  ********************************************************************************************/
    95 void sched_switch_to( struct thread_s * new );
     86void sched_yield( struct thread_s * next );
    9687
    9788/*********************************************************************************************
     
    130121
    131122/*********************************************************************************************
    132  * This function scan the list of kernel threads to find an idle (blocked) RPC thread.
    133  *********************************************************************************************
    134  * @ core    : local pointer on the core descriptor.
    135  * @ returns pointer on RPC thread descriptor / returns NULL if no idle RPC thread.
     123 * This function display the internal state of the calling core scheduler.
    136124 ********************************************************************************************/
    137 struct thread_s * sched_get_rpc_thead( struct core_s * core );
    138 
     125void sched_display();
    139126
    140127
Note: See TracChangeset for help on using the changeset viewer.