00001 /* 00002 * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>. 00003 * 00004 * Xenomai is free software; you can redistribute it and/or modify it 00005 * under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * Xenomai 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 Xenomai; if not, write to the Free Software Foundation, 00016 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 * As a special exception, the RTAI project gives permission 00019 * for additional uses of the text contained in its release of 00020 * Xenomai. 00021 * 00022 * The exception is that, if you link the Xenomai libraries with other 00023 * files to produce an executable, this does not by itself cause the 00024 * resulting executable to be covered by the GNU General Public License. 00025 * Your use of that executable is in no way restricted on account of 00026 * linking the Xenomai libraries code into it. 00027 * 00028 * This exception does not however invalidate any other reasons why 00029 * the executable file might be covered by the GNU General Public 00030 * License. 00031 * 00032 * This exception applies only to the code released by the 00033 * RTAI project under the name Xenomai. If you copy code from other 00034 * RTAI project releases into a copy of Xenomai, as the General Public 00035 * License permits, the exception does not apply to the code that you 00036 * add in this way. To avoid misleading anyone as to the status of 00037 * such modified files, you must delete this exception notice from 00038 * them. 00039 * 00040 * If you write modifications of your own for Xenomai, it is your 00041 * choice whether to permit this exception to apply to your 00042 * modifications. If you do not wish that, delete this exception 00043 * notice. 00044 */ 00045 00046 #ifndef _RTAI_NUCLEUS_INTR_H 00047 #define _RTAI_NUCLEUS_INTR_H 00048 00049 #include <nucleus/types.h> 00050 00051 #define XN_ISR_HANDLED 0x0 00052 #define XN_ISR_CHAINED 0x1 00053 #define XN_ISR_ENABLE 0x2 00054 00055 struct xnintr; 00056 00057 typedef int (*xnisr_t)(struct xnintr *intr); 00058 00059 typedef struct xnintr { 00060 00061 xnflags_t status; 00063 unsigned irq; /* !< IRQ number. */ 00064 00065 xnisr_t isr; /* !< Interrupt service routine. */ 00066 00067 void *cookie; /* !< User-defined cookie value. */ 00068 00069 } xnintr_t; 00070 00071 extern xnintr_t nkclock; 00072 00073 #ifdef __cplusplus 00074 extern "C" { 00075 #endif 00076 00077 void xnintr_clock_handler(void); 00078 00079 /* Public interface. */ 00080 00081 int xnintr_init(xnintr_t *intr, 00082 unsigned irq, 00083 xnisr_t isr, 00084 xnflags_t flags); 00085 00086 int xnintr_destroy(xnintr_t *intr); 00087 00088 int xnintr_attach(xnintr_t *intr, 00089 void *cookie); 00090 00091 int xnintr_detach(xnintr_t *intr); 00092 00093 int xnintr_enable(xnintr_t *intr); 00094 00095 int xnintr_disable(xnintr_t *intr); 00096 00097 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr, 00098 xnarch_cpumask_t cpumask); 00099 00100 #ifdef __cplusplus 00101 } 00102 #endif 00103 00104 #endif /* !_RTAI_NUCLEUS_INTR_H */