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