intr.h

00001 /*
00002  * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * RTAI/fusion is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * RTAI/fusion is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with RTAI/fusion; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  */
00019 
00020 #ifndef _RTAI_NUCLEUS_INTR_H
00021 #define _RTAI_NUCLEUS_INTR_H
00022 
00023 #include <nucleus/types.h>
00024 
00025 #define XN_ISR_HANDLED   0x0
00026 #define XN_ISR_CHAINED   0x1
00027 #define XN_ISR_ENABLE    0x2
00028 
00029 #if defined(__KERNEL__) || defined(__RTAI_UVM__) || defined(__RTAI_SIM__)
00030 
00031 struct xnintr;
00032 
00033 typedef struct xnintr {
00034 
00035     unsigned irq;       /* !< IRQ number. */
00036 
00037     xnisr_t isr;        /* !< Interrupt service routine. */
00038 
00039     unsigned long hits; /* !< Number of receipts (since attachment). */
00040 
00041     void *cookie;       /* !< User-defined cookie value. */
00042 
00043 } xnintr_t;
00044 
00045 extern xnintr_t nkclock;
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00051 void xnintr_clock_handler(void);
00052 
00053     /* Public interface. */
00054 
00055 int xnintr_init(xnintr_t *intr,
00056                 unsigned irq,
00057                 xnisr_t isr,
00058                 xnflags_t flags);
00059 
00060 int xnintr_destroy(xnintr_t *intr);
00061 
00062 int xnintr_attach(xnintr_t *intr,
00063                   void *cookie);
00064 
00065 int xnintr_detach(xnintr_t *intr);
00066 
00067 int xnintr_enable(xnintr_t *intr);
00068 
00069 int xnintr_disable(xnintr_t *intr);
00070     
00071 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr,
00072                                  xnarch_cpumask_t cpumask);
00073 
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 
00078 #endif /* __KERNEL__ || __RTAI_UVM__ || __RTAI_SIM__ */
00079 
00080 #endif /* !_RTAI_NUCLEUS_INTR_H */

Generated on Wed Jun 22 22:54:02 2005 for RTAI Fusion API by  doxygen 1.4.1