Ignore:
Timestamp:
Jun 18, 2017, 10:06:41 PM (7 years ago)
Author:
alain
Message:

Introduce syscalls.

File:
1 edited

Legend:

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

    r16 r23  
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *         Mohamed Lamine Karaoui (2015)
    6  *         Alain Greiner    (2016)
     6 *         Alain Greiner    (2016,2017)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
     
    3333#define SIG_ERROR     -1L
    3434
    35 #define SIGHUP     1       /*! hangup */
    36 #define SIGINT     2       /*! interrupt */
    37 #define SIGQUIT    3       /*! quit */
    38 #define SIGILL     4       /*! illegal instruction (not reset when caught) */
    39 #define SIGTRAP    5       /*! trace trap (not reset when caught) */
    40 #define SIGIOT     6       /*! IOT instruction */
    41 #define SIGABRT    6       /*! used by abort, replace SIGIOT in the future */
    42 #define SIGEMT     7       /*! EMT instruction */
    43 #define SIGFPE     8       /*! floating point exception */
    44 #define SIGKILL    9       /*! kill (cannot be caught or ignored) */
    45 #define SIGBUS     10      /*! bus error */
    46 #define SIGSEGV    11      /*! segmentation violation */
    47 #define SIGSYS     12      /*! bad argument to system call */
    48 #define SIGPIPE    13      /*! write on a pipe with no one to read it */
    49 #define SIGALRM    14      /*! alarm clock */
    50 #define SIGTERM    15      /*! software termination signal from kill */
    51 #define SIGURG     16      /*! urgent condition on IO channel */
    52 #define SIGSTOP    17      /*! sendable stop signal not from tty */
    53 #define SIGTSTP    18      /*! stop signal from tty */
    54 #define SIGCONT    19      /*! continue a stopped process */
    55 #define SIGCHLD    20      /*! to parent on child stop or exit */
    56 #define SIGCLD     20      /*! System V name for SIGCHLD */
    57 #define SIGTTIN    21      /*! to readers pgrp upon background tty read */
    58 #define SIGTTOU    22      /*! like TTIN for output if (tp->t_local&LTOSTOP) */
    59 #define SIGIO      23      /*! input/output possible signal */
    60 #define SIGPOLL    SIGIO   /*! System V name for SIGIO */
    61 #define SIGXCPU    24      /*! exceeded CPU time limit */
    62 #define SIGXFSZ    25      /*! exceeded file size limit */
    63 #define SIGVTALRM  26      /*! virtual time alarm */
    64 #define SIGPROF    27      /*! profiling time alarm */
    65 #define SIGWINCH   28      /*! window changed */
    66 #define SIGLOST    29      /*! resource lost (eg, record-lock lost) */
    67 #define SIGUSR1    30      /*! user defined signal 1 */
    68 #define SIGUSR2    31      /*! user defined signal 2 */
    69 #define SIG_NR     32      /*! signal 0 implied */
     35#define SIGHUP     1       /*! hangup                                                     */
     36#define SIGINT     2       /*! interrupt                                                  */
     37#define SIGQUIT    3       /*! quit                                                       */
     38#define SIGILL     4       /*! illegal instruction (not reset when caught)                */
     39#define SIGTRAP    5       /*! trace trap (not reset when caught)                         */
     40#define SIGIOT     6       /*! IOT instruction                                            */
     41#define SIGABRT    6       /*! used by abort, replace SIGIOT in the future                */
     42#define SIGEMT     7       /*! EMT instruction                                            */
     43#define SIGFPE     8       /*! floating point exception                                   */
     44#define SIGKILL    9       /*! kill (cannot be caught or ignored)                         */
     45#define SIGBUS     10      /*! bus error                                                  */
     46#define SIGSEGV    11      /*! segmentation violation                                     */
     47#define SIGSYS     12      /*! bad argument to system call                                */
     48#define SIGPIPE    13      /*! write on a pipe with no one to read it                     */
     49#define SIGALRM    14      /*! alarm clock                                                */
     50#define SIGTERM    15      /*! software termination signal from kill                      */
     51#define SIGURG     16      /*! urgent condition on IO channel                             */
     52#define SIGSTOP    17      /*! sendable stop signal not from tty                          */
     53#define SIGTSTP    18      /*! stop signal from tty                                       */
     54#define SIGCONT    19      /*! continue a stopped process                                 */
     55#define SIGCHLD    20      /*! to parent on child stop or exit                            */
     56#define SIGCLD     20      /*! System V name for SIGCHLD                                  */
     57#define SIGTTIN    21      /*! to readers pgrp upon background tty read                   */
     58#define SIGTTOU    22      /*! like TTIN for output if (tp->t_local&LTOSTOP)              */
     59#define SIGIO      23      /*! input/output possible signal                               */
     60#define SIGPOLL    SIGIO   /*! System V name for SIGIO                                    */
     61#define SIGXCPU    24      /*! exceeded CPU time limit                                    */
     62#define SIGXFSZ    25      /*! exceeded file size limit                                   */
     63#define SIGVTALRM  26      /*! virtual time alarm                                         */
     64#define SIGPROF    27      /*! profiling time alarm                                       */
     65#define SIGWINCH   28      /*! window changed                                             */
     66#define SIGLOST    29      /*! resource lost (eg, record-lock lost)                       */
     67#define SIGUSR1    30      /*! user defined signal 1                                      */
     68#define SIGUSR2    31      /*! user defined signal 2                                      */
     69#define SIG_NR     32      /*! signal 0 implied                                           */
    7070
    7171#define SIG_DEFAULT_MASK         0xFFEEFFFF
     
    8181
    8282/*******************************************************************************************
    83  * This structure ...
     83 * This structure ... TODO
    8484 ******************************************************************************************/
    8585
     
    104104
    105105/*******************************************************************************************
    106  * This structure ...
     106 * This structure ... TODO
    107107 ******************************************************************************************/
    108108
     
    122122
    123123/*******************************************************************************************
    124  * This structure TODO
     124 * This structure ... TODO
    125125 ******************************************************************************************/
    126126
     
    132132sig_mgr_t;
    133133
    134 
    135134/*******************************************************************************************
    136  * This function TODO
    137  ******************************************************************************************/
    138 int sys_signal ( uint32_t       sig,
    139                  sa_handler_t * handler );
    140 
    141 /*******************************************************************************************
    142  * This function TODO
     135 * This function ... TODO
    143136 ******************************************************************************************/
    144137int sys_sigreturn_setup( void * sigreturn_func );
    145138
    146 /*******************************************************************************************
    147  * This function register the signal <sig> in the bit_vector of all threads of a given
    148  * process identified by its <pid>, in all clusters containing threads for this process.
    149  * It can be executed by any thread running in any cluster, as this function uses
    150  * remote access to traverse the list of process copies, and the RPC_RISE_SIGNAL
    151  * to deliver the signal to all involved clusters.
    152  * The list of process copies is rooted in the owner cluster.
    153  ******************************************************************************************/
    154 int sys_kill( pid_t    pid,
    155               uint32_t sig );
    156139
    157140/*******************************************************************************************
    158  * This function TODO
     141 * This function ... TODO
    159142 ******************************************************************************************/
    160 error_t signal_manager_init( struct process_s * process );
     143void signal_manager_init( struct process_s * process );
    161144
    162145/*******************************************************************************************
     
    165148 * It must be executed by a thread running in the same cluster as the target threads
    166149 * (can be a local thread or a RPC thread).
     150 *******************************************************************************************
     151 * @ process   : local pointer on local target process.
     152 * @ sig_id    : signal type.
    167153 ******************************************************************************************/
    168 error_t signal_rise( struct process_s * process,
    169                      uint32_t           sig );
     154void signal_rise( struct process_s * process,
     155                  uint32_t           sig_id );
    170156
    171157/*******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.