source: trunk/kernel/kern/signal.h @ 517

Last change on this file since 517 was 457, checked in by alain, 6 years ago

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

File size: 4.6 KB
Line 
1/*
2 * signal.h - signal-management related operations
3 *
4 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
5 *         Mohamed Lamine Karaoui (2015)
6 *         Alain Greiner    (2016,2017)
7 *
8 * Copyright (c) UPMC Sorbonne Universites
9 *
10 * This file is part of ALMOS-MKH.
11 *
12 * ALMOS-MKH is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2.0 of the License.
15 *
16 * ALMOS-MKH is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef _SIGNAL_H_
27#define _SIGNAL_H_
28
29#include <hal_kernel_types.h>
30
31
32/****  Forward declarations  ****/
33
34struct process_s;
35struct thread_s;
36
37typedef uint32_t         sigval_t;
38typedef uint32_t         sigset_t;
39
40/*******************************************************************************************
41 * This structure ... TODO
42 ******************************************************************************************/
43
44typedef struct siginfo_s
45{
46        int      si_signo;    /*! Signal number */
47        int      si_errno;    /*! An errno value */
48        int      si_code;     /*! Signal code */
49        pid_t    si_pid;      /*! Sending process ID */
50        uid_t    si_uid;      /*! Real user ID of sending process */
51        int      si_status;   /*! Exit value or signal */
52        cycle_t  si_utime;    /*! User time consumed */
53        cycle_t  si_stime;    /*! System time consumed */
54        sigval_t si_value;    /*! Signal value */
55        int      si_int;      /*! POSIX.1b signal */
56        void    *si_ptr;      /*! POSIX.1b signal */
57        void    *si_addr;     /*! Memory location which caused fault */
58        int      si_band;     /*! Band event */
59        int      si_fd;       /*! File descriptor */
60}
61siginfo_t;
62
63/*******************************************************************************************
64 * This structure ... TODO
65 ******************************************************************************************/
66
67typedef void (sa_handler_t) ( uint32_t sig );
68
69typedef struct sigaction_s
70{
71        sigset_t sa_mask;
72        uint32_t sa_flags;
73        union
74        { 
75                sa_handler_t *sa_handler;
76                void (*sa_sigaction)(int, siginfo_t *, void *);
77        };
78}
79sigaction_t;
80
81/*******************************************************************************************
82 * This structure ... TODO
83 ******************************************************************************************/
84
85typedef struct sig_mgr_s
86{
87        sa_handler_t        * sigactions[SIG_NR];
88    struct thread_s     * handler;
89}
90sig_mgr_t;
91
92/*******************************************************************************************
93 * This function ... TODO
94 ******************************************************************************************/
95int sys_sigreturn_setup( void * sigreturn_func );
96
97
98/*******************************************************************************************
99 * This function ... TODO
100 ******************************************************************************************/
101void signal_manager_init( struct process_s * process );
102
103/*******************************************************************************************
104 * This function register the signal <sig> in the bit-vector of all threads of a given
105 * process identified by its <pid>, in a given cluster.
106 * It must be executed by a thread running in the same cluster as the target threads
107 * (can be a local thread or a RPC thread).
108 *******************************************************************************************
109 * @ process   : local pointer on local target process.
110 * @ sig_id    : signal type.
111 ******************************************************************************************/
112void signal_rise( struct process_s * process, 
113                  uint32_t           sig_id );
114
115/*******************************************************************************************
116 * This function TODO
117 ******************************************************************************************/
118void signal_notify( struct thread_s * this);
119
120/*******************************************************************************************
121 * This function do nothing in this implementation.
122 ******************************************************************************************/
123#define signal_manager_destroy(task)
124
125#endif  /*! _SIGNAL_H_ */
Note: See TracBrowser for help on using the repository browser.