00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _XENO_NUCLEUS_INTR_H
00021 #define _XENO_NUCLEUS_INTR_H
00022
00023 #include <nucleus/types.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/stat.h>
00043
00044 typedef struct xnintr {
00045
00046 #if defined(CONFIG_XENO_OPT_SHIRQ_LEVEL) || defined(CONFIG_XENO_OPT_SHIRQ_EDGE)
00047 struct xnintr *next;
00048 #endif
00049
00050 unsigned unhandled;
00051
00052 xnisr_t isr;
00053
00054 void *cookie;
00055
00056 xnflags_t flags;
00057
00058 unsigned irq;
00059
00060 xniack_t iack;
00061
00062 const char *name;
00063
00064 struct {
00065 xnstat_counter_t hits;
00066 xnstat_runtime_t account;
00067 } stat[XNARCH_NR_CPUS];
00068
00069 } xnintr_t;
00070
00071 extern xnintr_t nkclock;
00072 #ifdef CONFIG_XENO_OPT_STATS
00073 extern int xnintr_count;
00074 extern int xnintr_list_rev;
00075 #endif
00076
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080
00081 int xnintr_mount(void);
00082
00083 void xnintr_clock_handler(void);
00084
00085 int xnintr_irq_proc(unsigned int irq, char *str);
00086
00087
00088
00089 int xnintr_init(xnintr_t *intr,
00090 const char *name,
00091 unsigned irq,
00092 xnisr_t isr,
00093 xniack_t iack,
00094 xnflags_t flags);
00095
00096 int xnintr_destroy(xnintr_t *intr);
00097
00098 int xnintr_attach(xnintr_t *intr,
00099 void *cookie);
00100
00101 int xnintr_detach(xnintr_t *intr);
00102
00103 int xnintr_enable(xnintr_t *intr);
00104
00105 int xnintr_disable(xnintr_t *intr);
00106
00107 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr,
00108 xnarch_cpumask_t cpumask);
00109
00110 int xnintr_query(int irq, int *cpu, xnintr_t **prev, int revision, char *name,
00111 unsigned long *hits, xnticks_t *runtime,
00112 xnticks_t *account_period);
00113
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117
00118 #endif
00119
00120 #endif