Ignore:
Timestamp:
Dec 5, 2017, 4:20:07 PM (4 years ago)
Author:
alain
Message:

Fix several bugs in the fork() syscall.

File:
1 edited

Legend:

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

    r407 r408  
    7474
    7575/*********************************************************************************************
    76  * This function handles pending signals for all registered threads, and calls the
    77  * sched_select() function to make a context switch for the core running the calling thread.
     76 * This function is the only method to make a context switch. It is called in cas of TICK,
     77 * or when when a thread explicitely requires a scheduling.
     78 * It handles the pending signals for all threads attached to the core running the calling
     79 * thread, and calls the sched_select() function to select a new thread.
     80 * The cause argument is only used for debug by the sched_display() function, and
     81 * indicates the scheduling cause.
     82 *********************************************************************************************
     83 * @ cause    : character string defining the scheduling cause.
    7884 ********************************************************************************************/
    79 void sched_yield();
     85void sched_yield( char * cause );
    8086
    8187/*********************************************************************************************
     
    101107/*********************************************************************************************
    102108 * This function does NOT modify the scheduler state.
    103  * It just select a thread in the list of attached threads, implementing the following policy:
    104  * 1) it scan the list of kernel threads, from the next thread after the last executed one,
    105  *    and returns the first runnable found (can be the current thread).
    106  * 2) if no kernel thread found, it scan the list of user thread, from the next thread after
    107  *    the last executed one, and returns the first runable found (can be the current thread).
    108  * 3) if no runable thread found, it returns the idle thread.
     109 * It just select a thread in the list of attached threads, implementing the following
     110 * three steps policy:
     111 * 1) It scan the list of kernel threads, from the next thread after the last executed one,
     112 *    and returns the first runnable found : not IDLE, not blocked, client queue not empty.
     113 *    It can be the current thread.
     114 * 2) If no kernel thread found, it scan the list of user thread, from the next thread after
     115 *    the last executed one, and returns the first runable found : not blocked.
     116 *    It can be the current thread.
     117 * 3) If no runable thread found, it returns the idle thread.
    109118 *********************************************************************************************
    110  * @ core    : local pointer on the core descriptor.
     119 * @ core    : local pointer on scheduler.
    111120 * @ returns pointer on selected thread descriptor
    112121 ********************************************************************************************/
    113 struct thread_s * sched_select( struct core_s * core );
     122struct thread_s * sched_select( struct scheduler_s * sched );
    114123
    115124/*********************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.