Xenomai API  2.6.5
sig.h
1 /*
2  * Written by Gilles Chanteperdrix <[email protected]>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 
20 #ifndef _POSIX_SIG_H
21 #define _POSIX_SIG_H
22 
23 #include <posix/thread.h>
24 
25 #define SIGACTION_FLAGS (SA_ONESHOT|SA_NOMASK|SA_SIGINFO)
26 
27 typedef struct {
28  siginfo_t info;
29  xnpholder_t link;
30 
31 #define link2siginfo(iaddr) \
32  ((pse51_siginfo_t *)(((char *)iaddr) - offsetof(pse51_siginfo_t, link)))
33 
34 } pse51_siginfo_t;
35 
36 /* Must be called with nklock lock, irqs off returns non zero if rescheduling
37  needed. */
38 int pse51_sigqueue_inner(pthread_t thread, pse51_siginfo_t *si);
39 
40 void pse51_sigunqueue(pthread_t thread, pse51_siginfo_t *si);
41 
42 void pse51_signal_init_thread(pthread_t new, const pthread_t parent);
43 
44 void pse51_signal_cleanup_thread(pthread_t zombie);
45 
46 void pse51_signal_handle_request(pthread_t thread);
47 
48 void pse51_signal_pkg_init(void);
49 
50 void pse51_signal_pkg_cleanup(void);
51 
52 #endif /* !_POSIX_SIG_H */