00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _XENO_NUCLEUS_INTR_H
00023 #define _XENO_NUCLEUS_INTR_H
00024
00025
00026 #define XN_ISR_NONE 0x1
00027 #define XN_ISR_HANDLED 0x2
00028
00029 #define XN_ISR_PROPAGATE 0x100
00030 #define XN_ISR_NOENABLE 0x200
00031 #define XN_ISR_BITMASK (~0xff)
00032
00033
00034 #define XN_ISR_SHARED 0x1
00035 #define XN_ISR_EDGE 0x2
00036
00037
00038 #define XN_ISR_ATTACHED 0x10000
00039
00040 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00041
00042 #include <nucleus/types.h>
00043 #include <nucleus/stat.h>
00044
00045 struct xnsched;
00046
00047 typedef struct xnintr {
00048
00049 #ifdef CONFIG_XENO_OPT_SHIRQ
00050 struct xnintr *next;
00051 #endif
00052
00053 unsigned unhandled;
00054
00055 xnisr_t isr;
00056
00057 void *cookie;
00058
00059 xnflags_t flags;
00060
00061 unsigned irq;
00062
00063 xniack_t iack;
00064
00065 const char *name;
00066
00067 struct {
00068 xnstat_counter_t hits;
00069 xnstat_exectime_t account;
00070 } stat[XNARCH_NR_CPUS];
00071
00072 } xnintr_t;
00073
00074 extern xnintr_t nkclock;
00075 #ifdef CONFIG_XENO_OPT_STATS
00076 extern int xnintr_count;
00077 extern int xnintr_list_rev;
00078 #endif
00079
00080 #ifdef __cplusplus
00081 extern "C" {
00082 #endif
00083
00084 int xnintr_mount(void);
00085
00086 void xnintr_host_tick(struct xnsched *sched);
00087
00088 void xnintr_clock_handler(void);
00089
00090 int xnintr_irq_proc(unsigned int irq, char *str);
00091
00092
00093
00094 int xnintr_init(xnintr_t *intr,
00095 const char *name,
00096 unsigned irq,
00097 xnisr_t isr,
00098 xniack_t iack,
00099 xnflags_t flags);
00100
00101 int xnintr_destroy(xnintr_t *intr);
00102
00103 int xnintr_attach(xnintr_t *intr,
00104 void *cookie);
00105
00106 int xnintr_detach(xnintr_t *intr);
00107
00108 int xnintr_enable(xnintr_t *intr);
00109
00110 int xnintr_disable(xnintr_t *intr);
00111
00112 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr,
00113 xnarch_cpumask_t cpumask);
00114
00115 int xnintr_query(int irq, int *cpu, xnintr_t **prev, int revision, char *name,
00116 unsigned long *hits, xnticks_t *exectime,
00117 xnticks_t *account_period);
00118
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122
00123 #endif
00124
00125 #endif