Ignore:
Timestamp:
Nov 19, 2020, 11:44:34 PM (3 years ago)
Author:
alain
Message:

1) Introduce up to 4 command lines arguments in the KSH "load" command.
These arguments are transfered to the user process through the
argc/argv mechanism, using the user space "args" vseg.

2) Introduce the named and anonymous "pipes", for inter-process communication
through the pipe() and mkfifo() syscalls.

3) Introduce the "chat" application to validate the two above mechanisms.

4) Improve printk() and assert() fonctions in printk.c.

File:
1 edited

Legend:

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

    r662 r669  
    3737#include <core.h>
    3838#include <chdev.h>
     39#include <alarm.h>
    3940#include <cluster.h>
    4041#include <process.h>
     
    9596#define THREAD_BLOCKED_LOCK      0x1000  /*! ANY : wait queuelock or rwlock           */
    9697#define THREAD_BLOCKED_CLIENT    0x2000  /*! DEV : wait clients queue non empty       */
     98#define THREAD_BLOCKED_ALARM     0x4000  /*! ANY : wait a timer based alarm           */
    9799
    98100/***************************************************************************************
     
    160162        vseg_t            * user_stack_vseg; /*! local pointer on user stack vseg         */
    161163
    162     void              * entry_func;      /*! pointer on entry function                */
    163     void              * entry_args;      /*! pointer on entry function arguments      */
    164     uint32_t            main_argc;       /*! main thread number of arguments          */
    165     char             ** main_argv;       /*! main thread array of strings arguments   */
     164    void              * entry_func;      /*! pointer on thread entry function         */
     165    void              * entry_args;      /*! pthread     : pointer on arguments       */
    166166
    167167    uint32_t            flags;           /*! bit vector of flags                      */
     
    177177
    178178    chdev_t           * chdev;           /*! chdev pointer (for a DEV thread only)    */
     179
     180    alarm_t             alarm;           /*! embedded timer based alarm               */
    179181
    180182    reg_t               save_sr;         /*! used by sched_yield() function           */
     
    269271/***************************************************************************************
    270272 * This function is called by the process_make_exec() function to re-initialise the
    271  * calling thread descriptor, that will become the new process main thread.
    272  * It must be called by the main thread of the calling process.
     273 * calling thread descriptor, that will become the new process main thread, from
     274 * the process descriptor, and from the <args_nr> & <args_base> arguments.
    273275 * - The calling thread TRDID is not modified.
    274276 * - The kernel stack (currently in use) is not modified. 
    275  * - A new user stack vseg is created and initialised.
    276  * - The function calls the hal_cpu_context_exec() to re-initialize the CPU context
    277  *   and the uzone registered in kernel stack, an jump to user code. 
    278  ***************************************************************************************
    279  * @ entry_func : main thread entry point.
    280  * @ argc       : number of main thread arguments.
    281  * @ argv       : array of pointers on stringarguments.
    282  * @ returns 0 if success / returns ENOMEM if error.
    283  **************************************************************************************/
    284 error_t thread_user_exec( void     * entry_func,
    285                           uint32_t   argc,
    286                           char    ** argv);
     277 * - It calls the hal_cpu_context_init() to re-initialize the thread CPU context.
     278 * - It calls the hal_do_cpu_restore() to force execution of the new user code.
     279 ***************************************************************************************
     280 * @ argc   : actual number of main thread arguments.
     281 * @ argv   : user space pointer on array of pointers on arguments.
     282 **************************************************************************************/
     283void thread_user_exec( uint32_t  argc,
     284                       intptr_t  argv );
    287285
    288286/***************************************************************************************
     
    397395 * @ is_forced   : the deletion does not depends on the attached mode.
    398396 **************************************************************************************/
    399 void thread_delete( xptr_t  thread_xp,
    400                     bool_t  is_forced );
     397void thread_delete_request( xptr_t  thread_xp,
     398                            bool_t  is_forced );
    401399
    402400/***************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.