Ignore:
Timestamp:
Jan 29, 2018, 5:40:34 PM (4 years ago)
Author:
alain
Message:

Introduce sys_fg() , sys_display() , sys_wait() syscalls.

File:
1 edited

Legend:

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

    r409 r421  
    7878 * [3] This blocking function suspend execution of the calling thread until completion
    7979 * of another target thread identified by the <trdid> argument.
     80 * The target thread must be joinable (running in ATTACHED mode), and must be different
     81 * from the calling thread.
    8082 * If the <exit_value> argument is not NULL, the value passed to pthread_exit() by the
    8183 * target thread is stored in the location referenced by exit_value.
     
    426428 * remote access to traverse the list of process copies stored in the owner cluster,
    427429 * and the RPC_SIGNAL_RISE to signal the remote threads.
     430 * This function does nothing for (sig_id == 0). This can be used to check process pid.
     431 * TODO : This first implementation supports only SIGKILL / SIGSTOP / SIGCONT values.
    428432 ******************************************************************************************
    429433 * @ pid      : target process identifier.
     
    491495
    492496/******************************************************************************************
    493  * [39] This non-standard function is used to activate / desactivate the trace for a thread
     497 * [39] This blocking function wait a change of a child process state. A change can be:
     498 * - a termination of child following a child exit.
     499 * - a termination of child following a SIGKILL signal.
     500 * - a blocking of child following a SIGSTOP signal.
     501 * It returns the PID of the involved child process, after storing in the memory slot
     502 * pointed by the <status> argument relevant information on the child state change.
     503 * The following macros can be used to extract information from status:
     504 * - WIFEXITED(status)   : is true if the child process terminated with an exit().
     505 * - WIFSIGNALED(status) : is true if the child process terminated by a signal.
     506 * - WIFSTOPPED(status)  : is true if the child process is stopped by a signal.
     507 * - WEXITSTATUS(status) : returns the low-order 8 bits of the exit() argument.
     508 * A status of 0 indicates a normal termination.
     509 * If a parent process terminates without waiting for all child processes to terminate,
     510 * the remaining child processes are attached to the init process.
     511 ******************************************************************************************
     512 * @ status : pointer on the child PID status.
     513 * @ return child PID if success / return -1 if failure.
     514 *****************************************************************************************/
     515int sys_wait( uint32_t * status );
     516
     517/******************************************************************************************
     518 * [40] This function returns the hardware platform parameters.
     519 ******************************************************************************************
     520 * @ x_size   : [out] number of clusters in a row.
     521 * @ y_size   : [out] number of clusters in a column.
     522 * @ y_width  : [out] number of bits in Y field for CXY.
     523 * @ ncores   : [out] number of cores per cluster.
     524 * @ return 0 if success / return -1 if illegal arguments
     525 *****************************************************************************************/
     526int sys_get_config( uint32_t * x_size,
     527                    uint32_t * y_size,
     528                    uint32_t * y_width,
     529                    uint32_t * ncores );
     530
     531/******************************************************************************************
     532 * [41] This function returns the calling core cluster and local index.
     533 ******************************************************************************************
     534 * @ cxy      : [out] cluster identifier (fixed format)
     535 * @ lid      : [out] core local index in cluster.
     536 * @ return 0 if success / return -1 if illegal arguments
     537 *****************************************************************************************/
     538int sys_get_core( uint32_t * cxy,
     539                  uint32_t * lid );
     540
     541/******************************************************************************************
     542 * [42] This function returns in a 64 bits user buffer the calling core cycles count.
     543 * It uses both the hardware register and the core descriptor cycles count to take
     544 * into account a possible harware register overflow  in 32 bits architectures.
     545 ******************************************************************************************
     546 * cycle    : [out] address of buffer in user space.
     547 * @ return 0 if success / return -1 if illegal arguments
     548 *****************************************************************************************/
     549int sys_get_cycle( uint64_t * cycle );
     550
     551/******************************************************************************************
     552 * [43] This debug function displays on the kernel terminal TXT0 an user defined string,
     553 * or the current state of a kernel structure, identified by the <type> argument.
     554 * The <arg0> and <arg1> arguments depends on the structure type. It can be:
     555 * - VMM     : VSL and GPT for a process identified by <pid>.
     556 * - SCHED   : all threads allocated to a scheduler identified by <cxy> & <lid>.
     557 * - PROCESS : all processes registered in a cluster identified by <cxy>. 
     558 * - VFS     : all files registered in the VFS cache.
     559 * - CHDEV   : all registered channel devices.
     560 ******************************************************************************************
     561 * type     : [in] STRING / VMM / SCHED / PROCESS / VSEG / VFS
     562 * arg0      : [in] type dependant argument.
     563 * arg1      : [in] type dependant argument.
     564 * @ return 0 if success / return -1 if illegal arguments
     565 *****************************************************************************************/
     566int sys_display( reg_t  type,
     567                 reg_t  arg0,
     568                 reg_t  arg1 );
     569
     570/******************************************************************************************
     571 * [45] This function block the calling thread on the THREAD_BLOCKED_GLOBAL condition,
     572 * and deschedule.
     573 ******************************************************************************************
     574 * @ return 0 if success / returns -1 if failure.
     575 *****************************************************************************************/
     576int sys_thread_sleep();
     577
     578/******************************************************************************************
     579 * [46] This function unblock the thread identified by its <trdid> from the
     580 * THREAD_BLOCKED_GLOBAL condition.
     581 ******************************************************************************************
     582 * @ trdid  : target thread identifier.
     583 * @ return 0 if success / return -1 if failure.
     584 *****************************************************************************************/
     585int sys_thread_wakeup();
     586
     587/******************************************************************************************
     588 * [47] This non-standard function is used to activate / desactivate the trace for a thread
    494589 * identified by the <trdid> and <pid> arguments.
    495590 * It can be called by any other thread in the same process.
     
    505600
    506601/******************************************************************************************
    507  * [40] This function returns the hardware platform parameters.
    508  ******************************************************************************************
    509  * @ x_size   : [out] number of clusters in a row.
    510  * @ y_size   : [out] number of clusters in a column.
    511  * @ ncores   : [out] number of cores per cluster.
    512  * @ return 0 if success / return -1 if illegal arguments
    513  *****************************************************************************************/
    514 int sys_get_config( uint32_t * x_size,
    515                     uint32_t * y_size,
    516                     uint32_t * ncores );
    517 
    518 /******************************************************************************************
    519  * [41] This function returns the calling core cluster and local index.
    520  ******************************************************************************************
    521  * @ cxy      : [out] cluster identifier (fixed format)
    522  * @ lid      : [out] core local index in cluster.
    523  * @ return 0 if success / return -1 if illegal arguments
    524  *****************************************************************************************/
    525 int sys_get_core( uint32_t * cxy,
    526                   uint32_t * lid );
    527 
    528 /******************************************************************************************
    529  * [42] This function returns in a 64 bits user buffer the calling core cycles count.
    530  * It uses both the hardware register and the core descriptor cycles count to take
    531  * into account a possible harware register overflow  in 32 bits architectures.
    532  ******************************************************************************************
    533  * cycle    : [out] address of buffer in user space.
    534  * @ return 0 if success / return -1 if illegal arguments
    535  *****************************************************************************************/
    536 int sys_get_cycle( uint64_t * cycle );
    537 
    538 /******************************************************************************************
    539  * [43] This debug function displays on the kernel terminal the current state of a
    540  * scheduler identified by the <cxy> and <lid> arguments.
    541  ******************************************************************************************
    542  * cxy      : [in] target cluster identifier.
    543  * lid      : [in] target core local index.
    544  * @ return 0 if success / return -1 if illegal arguments
    545  *****************************************************************************************/
    546 int sys_get_sched( uint32_t  cxy,
    547                    uint32_t  lid );
    548 
    549 /******************************************************************************************
    550  * [44] This debug function requires the kernel to display on the kernel terminal a message
    551  * containing the thread / process / core identifiers, and the cause of panic,
    552  * as defined by the <string> argument.
    553  ******************************************************************************************
    554  * string   : [in] message to be displayed.
    555  * @ return always 0.
    556  *****************************************************************************************/
    557 int sys_panic( char * string );
    558 
    559 /******************************************************************************************
    560  * [45] This function block the calling thread on the THREAD_BLOCKED_GLOBAL condition,
    561  * and deschedule.
    562  ******************************************************************************************
    563  * @ return 0 if success / returns -1 if failure.
    564  *****************************************************************************************/
    565 int sys_thread_sleep();
    566 
    567 /******************************************************************************************
    568  * [46] This function unblock the thread identified by its <trdid> from the
    569  * THREAD_BLOCKED_GLOBAL condition.
    570  ******************************************************************************************
    571  * @ trdid  : target thread identifier.
    572  * @ return 0 if success / return -1 if failure.
    573  *****************************************************************************************/
    574 int sys_thread_wakeup();
     602 * [48] This function gives the process identified by the <pid> argument
     603 * the exclusive ownership of its TXT_TX terminal (put it in foreground).
     604 ******************************************************************************************
     605 * @ pid    : process identifier.
     606 * @ return 0 if success / return -1 if failure.
     607 *****************************************************************************************/
     608int sys_fg( pid_t   pid );
    575609
    576610
Note: See TracChangeset for help on using the changeset viewer.