Xenomai API  2.6.5
intr.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */
16 
17 
18 #ifndef _POSIX_INTR_H
19 #define _POSIX_INTR_H
20 
21 #include <nucleus/synch.h>
22 #include <nucleus/intr.h>
23 
24 #if defined(__KERNEL__) || defined(__XENO_SIM__)
25 
26 #define PTHREAD_IDESC(xintr) ((struct pse51_interrupt *)(xintr)->cookie)
27 
28 struct pse51_interrupt {
29 
30  unsigned magic; /* !< Magic code - must be first */
31 
32  xnintr_t intr_base; /* !< Base interrupt object. */
33 
34  xnholder_t link; /* !< Link in pse51_intrq */
35 
36 #define link2intr(ln) container_of(ln, struct pse51_interrupt, link)
37 
38 #ifdef CONFIG_XENO_OPT_PERVASIVE
39 
40  int mode; /* !< Interrupt control mode. */
41 
42  int pending; /* !< Pending hits to process. */
43 
44  xnsynch_t synch_base; /* !< Base synchronization object. */
45 
46 #endif /* CONFIG_XENO_OPT_PERVASIVE */
47  pse51_kqueues_t *owningq;
48 };
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 void pse51_intrq_cleanup(pse51_kqueues_t *q);
55 
56 void pse51_intr_pkg_init(void);
57 
58 void pse51_intr_pkg_cleanup(void);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* __KERNEL__ || __XENO_SIM__ */
65 
66 #endif /* !_POSIX_INTR_H */