picvar.h revision 1.1.2.4 1 #ifndef _ARM_PIC_PICVAR_H_
2 #define _ARM_PIC_PICVAR_H_
3
4 int _splraise(int);
5 int _spllower(int);
6 void splx(int);
7 const char *
8 intr_typename(int);
9
10 struct pic_softc;
11 struct intrsource;
12
13 int pic_handle_intr(void *);
14 void pic_mark_pending(struct pic_softc *pic, int irq);
15 void pic_mark_pending_source(struct pic_softc *pic, struct intrsource *is);
16 void *pic_establish_intr(struct pic_softc *pic, int irq, int ipl, int type,
17 int (*func)(void *), void *arg);
18 int pic_alloc_irq(struct pic_softc *pic);
19 void pic_disestablish_source(struct intrsource *is);
20 void pic_do_pending_ints(register_t psw, int newipl);
21 void pic_dispatch(struct intrsource *is, void *frame);
22
23 void *intr_establish(int irq, int ipl, int type, int (*func)(void *),
24 void *arg);
25 void intr_disestablish(void *);
26
27 #ifdef _INTR_PRIVATE
28
29 #ifndef PIC_MAXPICS
30 #define PIC_MAXPICS 32
31 #endif
32 #ifndef PIC_MAXSOURCES
33 #define PIC_MAXSOURCES 64
34 #endif
35 #ifndef PIC_MAXMAXSOURCES
36 #define PIC_MAXMAXSOURCES 128
37 #endif
38
39 struct intrsource {
40 int (*is_func)(void *);
41 void *is_arg;
42 struct pic_softc *is_pic; /* owning PIC */
43 uint8_t is_type; /* IST_xxx */
44 uint8_t is_ipl; /* IPL_xxx */
45 uint8_t is_irq; /* local to pic */
46 uint8_t is_iplidx;
47 struct evcnt is_ev;
48 char is_source[16];
49 };
50
51 struct pic_softc {
52 const struct pic_ops *pic_ops;
53 struct intrsource **pic_sources;
54 uint32_t pic_pending_irqs[(PIC_MAXSOURCES + 31) / 32];
55 uint32_t pic_pending_ipls;
56 size_t pic_maxsources;
57 uint8_t pic_id;
58 int16_t pic_irqbase;
59 char pic_name[14];
60 };
61
62 struct pic_ops {
63 void (*pic_unblock_irqs)(struct pic_softc *, size_t, uint32_t);
64 void (*pic_block_irqs)(struct pic_softc *, size_t, uint32_t);
65 int (*pic_find_pending_irqs)(struct pic_softc *);
66
67 void (*pic_establish_irq)(struct pic_softc *, int, int, int);
68 void (*pic_source_name)(struct pic_softc *, int, char *, size_t);
69 };
70
71
72 void pic_add(struct pic_softc *, int);
73 void pic_do_pending_int(void);
74
75 extern struct pic_softc * pic_list[PIC_MAXPICS];
76 #endif /* _INTR_PRIVATE */
77
78 #endif /* _ARM_PIC_PICVAR_H_ */
79