Ignore:
Timestamp:
Aug 2, 2018, 11:47:13 AM (6 years ago)
Author:
alain
Message:

This version modifies the exec syscall and fixes a large number of small bugs.
The version number has been updated (0.1)

File:
1 edited

Legend:

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

    r446 r457  
    2626#define _THREAD_H_
    2727
    28 #include <hal_types.h>
     28#include <hal_kernel_types.h>
    2929#include <shared_syscalls.h>
    3030#include <hal_special.h>
     
    161161    void              * entry_func;      /*! pointer on entry function                */
    162162    void              * entry_args;      /*! pointer on entry function arguments      */
     163    uint32_t            main_argc;       /*! main thread number of arguments          */
     164    char             ** main_argv;       /*! main thread array of strings arguments   */
    163165
    164166    uint32_t            flags;           /*! bit vector of flags                      */
     
    218220 * The CPU context is initialized from scratch.
    219221 * It is registered in the local process descriptor specified by the <pid> argument.
    220  * The THREAD_BLOCKED_GLOBAL bit is set => the thread must be activated to start.
     222 * The THREAD_BLOCKED_GLOBAL bit is set => the thread must be activated by the caller
     223 * to start at the next scheduling point.
    221224 ***************************************************************************************
    222225 * @ pid          : process identifier.
     
    258261
    259262/***************************************************************************************
     263 * This function is called by the process_make_exec() function to re-initialise the
     264 * thread descriptor of the calling thread (that will become the new process main
     265 * thread), and immediately jump to user code without returning to kentry!!!
     266 * It must be called by the main thread of the calling process.
     267 * - A new user stack vseg is created and initialised.
     268 * - The kernel stack (currently in use) is not modified. 
     269 * - The function calls the hal_cpu_context_exec() to re-initialize the CPU context
     270 *   an jump to user code. 
     271 ***************************************************************************************
     272 * @ entry_func : main thread entry point.
     273 * @ argc       : number of main thread arguments.
     274 * @ argv       : array of pointers on stringarguments.
     275 * @ returns 0 if success / returns ENOMEM if error.
     276 **************************************************************************************/
     277error_t thread_user_exec( void     * entry_func,
     278                          uint32_t   argc,
     279                          char    ** argv);
     280
     281/***************************************************************************************
    260282 * This function allocates memory for a kernel thread descriptor in the local cluster,
    261283 * and initializes it from arguments values.
     
    281303 * descriptor from arguments values.
    282304 * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.
     305 * It returns a kernel panic if failure.
    283306 ***************************************************************************************
    284307 * @ thread   : pointer on existing thread descriptor.
     
    287310 * @ args     : function arguments.
    288311 * @ core_lid : local core index.
    289  * @ returns 0 if success / returns EINVAL if error
    290  **************************************************************************************/
    291 error_t thread_idle_init( thread_t      * thread,
    292                           thread_type_t   type,
    293                           void          * func,
    294                           void          * args,
    295                           lid_t           core_lid );
     312 **************************************************************************************/
     313void thread_idle_init( thread_t      * thread,
     314                       thread_type_t   type,
     315                       void          * func,
     316                       void          * args,
     317                       lid_t           core_lid );
    296318
    297319/***************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.