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 typedef struct xnintr {
00046
00047 #ifdef CONFIG_XENO_OPT_SHIRQ
00048 struct xnintr *next;
00049 #endif
00050
00051 unsigned unhandled;
00052
00053 xnisr_t isr;
00054
00055 void *cookie;
00056
00057 xnflags_t flags;
00058
00059 unsigned irq;
00060
00061 xniack_t iack;
00062
00063 const char *name;
00064
00065 struct {
00066 xnstat_counter_t hits;
00067 xnstat_exectime_t account;
00068 } stat[XNARCH_NR_CPUS];
00069
00070 } xnintr_t;
00071
00072 extern xnintr_t nkclock;
00073 #ifdef CONFIG_XENO_OPT_STATS
00074 extern int xnintr_count;
00075 extern int xnintr_list_rev;
00076 #endif
00077
00078 #ifdef __cplusplus
00079 extern "C" {
00080 #endif
00081
00082 int xnintr_mount(void);
00083
00084 void xnintr_clock_handler(void);
00085
00086 int xnintr_irq_proc(unsigned int irq, char *str);
00087
00088
00089
00090 int xnintr_init(xnintr_t *intr,
00091 const char *name,
00092 unsigned irq,
00093 xnisr_t isr,
00094 xniack_t iack,
00095 xnflags_t flags);
00096
00097 int xnintr_destroy(xnintr_t *intr);
00098
00099 int xnintr_attach(xnintr_t *intr,
00100 void *cookie);
00101
00102 int xnintr_detach(xnintr_t *intr);
00103
00104 int xnintr_enable(xnintr_t *intr);
00105
00106 int xnintr_disable(xnintr_t *intr);
00107
00108 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr,
00109 xnarch_cpumask_t cpumask);
00110
00111 int xnintr_query(int irq, int *cpu, xnintr_t **prev, int revision, char *name,
00112 unsigned long *hits, xnticks_t *exectime,
00113 xnticks_t *account_period);
00114
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118
00119 #endif
00120
00121 #endif