Ignore:
Timestamp:
Nov 20, 2020, 12:30:31 AM (3 years ago)
Author:
alain
Message:

Mainly cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/generic/hal_context.h

    r654 r679  
    22 * hal_context.h - Generic Thread Context Access API definition.
    33 *
    4  * Author  Alain Greiner    (2016,2017,2018,2019)
     4 * Author  Alain Greiner    (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    5050/****************************************************************************************
    5151 * This function initializes the CPU context of the thread identified by the <thread>
    52  * argument. All slots required to start a new thread must be initialized.
     52 * argument from the <thread> descriptor, depending on the thread type (user / kernel).
     53 * All slots required to start a new thread must be initialized in the thread context.
     54 * Moreover, for an user thread, the arguments to be passed to the entry function
     55 * depend on the <is_main> argument below:
     56 * - a main thread, created by sys_exec(), requires two arguments, defined by the two
     57 *   <argc> and <argv> arguments below.
     58 *   define the arguments
     59 * - a pthread, created by sys_thread_create() requires only one argument, defined by
     60 *   the "entry_args" field in the thread descriptor.
    5361 ****************************************************************************************
    5462 * @ thread  : pointer on the thread descriptor.
     63 * @ is_main : main thread when non zero.
     64 * @ argc    : actual number of arguments (for main).
     65 * @ argv    : user space pointer on array of pointers on strings arguments (for main).
    5566 ***************************************************************************************/
    56 void hal_cpu_context_init( struct thread_s * thread );
     67void hal_cpu_context_init( struct thread_s * thread,
     68                           bool_t            is_main,
     69                           uint32_t          argc,
     70                           intptr_t          argv );
    5771
    5872/****************************************************************************************
     
    7589 ***************************************************************************************/
    7690void hal_cpu_context_fork( xptr_t    thread_xp );
    77 
    78 /****************************************************************************************
    79  * This function is used to implement the exec() system call.
    80  * 1) It initialize the relevant slots of the the calling thread CPU context.
    81  * 2) It call the hal_do_cpu_restore() function to return to user mode and start
    82  *    execution of the new process.
    83  ****************************************************************************************
    84  * @ thread  : pointer on the thread descriptor.
    85  ***************************************************************************************/
    86 void hal_cpu_context_exec( struct thread_s * thread );
    8791
    8892/****************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.