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     xniack_t iack;      /* !< Interrupt acknowledge routine. */
00040 
00041     unsigned long hits; /* !< Number of receipts (since attachment). */
00042 
00043     void *cookie;       /* !< User-defined cookie value. */
00044 
00045 } xnintr_t;
00046 
00047 extern xnintr_t nkclock;
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052 
00053 void xnintr_clock_handler(void);
00054 
00055     /* Public interface. */
00056 
00057 int xnintr_init(xnintr_t *intr,
00058                 unsigned irq,
00059                 xnisr_t isr,
00060                 xniack_t iack,
00061                 xnflags_t flags);
00062 
00063 int xnintr_destroy(xnintr_t *intr);
00064 
00065 int xnintr_attach(xnintr_t *intr,
00066                   void *cookie);
00067 
00068 int xnintr_detach(xnintr_t *intr);
00069 
00070 int xnintr_enable(xnintr_t *intr);
00071 
00072 int xnintr_disable(xnintr_t *intr);
00073     
00074 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr,
00075                                  xnarch_cpumask_t cpumask);
00076 
00077 #ifdef __cplusplus
00078 }
00079 #endif
00080 
00081 #endif /* __KERNEL__ || __RTAI_UVM__ || __RTAI_SIM__ */
00082 
00083 #endif /* !_RTAI_NUCLEUS_INTR_H */

Generated on Sat Sep 3 12:32:47 2005 for RTAI Fusion API by  doxygen 1.4.2