Ignore:
Timestamp:
Nov 14, 2019, 11:50:09 AM (4 years ago)
Author:
alain
Message:

1) Improve the VMM MMAP allocator: implement the "buddy" algorithm
to allocate only aligned blocks.
2) fix a bug in the pthread_join() / pthread_exit() mmechanism.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/syscalls.h

    r642 r651  
    3737
    3838/******************************************************************************************
    39  * [0] This function terminates the execution of the calling user thread,
    40  * and makes the exit_value pointer available to any successful pthread_join() with the
     39 * [0] This function terminates the execution of the calling user thread, and makes
     40 * the <exit_status> pointer available to any successful pthread_join() with the
    4141 * terminating thread.
    42  * It actually set the THREAD_SIG_EXIT signal, set the THREAD_BLOCKED_GLOBAL bit in the
    43  * thread descriptor and deschedule.
    44  * The thread will be detached from its process, and the memory allocated to the thread
    45  * descriptor will be released later by the scheduler.
    46  ******************************************************************************************
    47  * @ exit_vallue  : pointer to be returned to joining thread if thread is attached.
     42 * - If the calling thread is the main thread, it calls the sys_exit() function to delete
     43 *   completely the user process. 
     44 * - if the calling thread is not the main thread, it registers the <exit_status> pointer
     45 *   in the thread descriptor, and calls the thread_delete() function, that will set the
     46 *   THREAD_SIG_EXIT signal, set the THREAD_BLOCKED_GLOBAL bit in thread descriptor, and
     47 *   deschedules. All memory allocated to the thread is released later by the scheduler.
     48 *   If the thread is in "detached" mode, the thread_delete() function implements
     49 *   the synchonisation with the joining thread.
     50 ******************************************************************************************
     51 * @ exit_status  : pointer to be returned to joining thread if thread is attached.
    4852 * @ return 0 if success / return -1 if all locks not released or illegal argument.
    4953 *****************************************************************************************/
    50 int sys_thread_exit( void * exit_value );
     54int sys_thread_exit( void * exit_status );
    5155
    5256/******************************************************************************************
     
    222226 ******************************************************************************************
    223227 * @ attr       : pointer on attributes structure.
    224  * @ return 0 if success / return -1 if failure.
     228 * @ returns 0 if success / returns -1 if failure.
    225229 *****************************************************************************************/
    226230int sys_mmap( mmap_attr_t * attr );
     
    234238 * @ buf      : buffer virtual address in user space.
    235239 * @ count    : number of bytes.
    236  * @ return number of bytes actually read if success / returns -1 if failure.
     240 * @ returns number of bytes actually read if success / returns -1 if failure.
    237241 *****************************************************************************************/
    238242int sys_read( uint32_t   file_id,
     
    251255 * @ buf      : buffer virtual address in user space.
    252256 * @ count    : number of bytes.
    253  * @ return number of bytes actually written if success / returns -1 if failure.
     257 * @ returns number of bytes actually written if success / returns -1 if failure.
    254258 *****************************************************************************************/
    255259int sys_write( uint32_t   file_id,
     
    258262
    259263/******************************************************************************************
    260  * [16] This function repositions the offset of the file descriptor identified by <file_id>,
    261  * according to the operation type defined by the <whence> argument.
     264 * [16] This function repositions the offset of the file descriptor identified by the
     265 * <file_id> argument, according to the operation type defined by the <whence> argument.
    262266 ******************************************************************************************
    263267 * @ file_id  : open file index in fd_array.
    264268 * @ offset   : used to compute new offset value.
    265269 * @ whence   : operation type (see below).
    266  * @ return 0 if success / returns -1 if failure.
     270 * @ returns new offset value if success / returns -1 if failure.
    267271 *****************************************************************************************/
    268272int sys_lseek( xptr_t    file_id,
     
    276280 ******************************************************************************************
    277281  file_id   : file descriptor index in fd_array.
    278  * @ return 0 if success / returns -1 if failure.
     282 * @ returns 0 if success / returns -1 if failure.
    279283 *****************************************************************************************/
    280284int sys_close( uint32_t file_id );
     
    289293 ******************************************************************************************
    290294 * @ pathname   : pathname (can be relative or absolute).
    291  * @ return 0 if success / returns -1 if failure.
     295 * @ returns 0 if success / returns -1 if failure.
    292296 *****************************************************************************************/
    293297int sys_unlink( char * pathname );
Note: See TracChangeset for help on using the changeset viewer.