2 * Internal header to deal with irq_desc->status which will be renamed
3 * to irq_desc->settings.
6 _IRQ_DEFAULT_INIT_FLAGS
= IRQ_DEFAULT_INIT_FLAGS
,
7 _IRQ_PER_CPU
= IRQ_PER_CPU
,
8 _IRQ_LEVEL
= IRQ_LEVEL
,
9 _IRQ_NOPROBE
= IRQ_NOPROBE
,
10 _IRQ_NOREQUEST
= IRQ_NOREQUEST
,
11 _IRQ_NOAUTOEN
= IRQ_NOAUTOEN
,
12 _IRQ_MOVE_PCNTXT
= IRQ_MOVE_PCNTXT
,
13 _IRQ_NO_BALANCING
= IRQ_NO_BALANCING
,
14 _IRQ_NESTED_THREAD
= IRQ_NESTED_THREAD
,
15 _IRQF_MODIFY_MASK
= IRQF_MODIFY_MASK
,
18 #define IRQ_INPROGRESS GOT_YOU_MORON
19 #define IRQ_REPLAY GOT_YOU_MORON
20 #define IRQ_WAITING GOT_YOU_MORON
21 #define IRQ_DISABLED GOT_YOU_MORON
22 #define IRQ_PENDING GOT_YOU_MORON
23 #define IRQ_MASKED GOT_YOU_MORON
24 #define IRQ_WAKEUP GOT_YOU_MORON
25 #define IRQ_MOVE_PENDING GOT_YOU_MORON
26 #define IRQ_PER_CPU GOT_YOU_MORON
27 #define IRQ_NO_BALANCING GOT_YOU_MORON
28 #define IRQ_AFFINITY_SET GOT_YOU_MORON
29 #define IRQ_LEVEL GOT_YOU_MORON
30 #define IRQ_NOPROBE GOT_YOU_MORON
31 #define IRQ_NOREQUEST GOT_YOU_MORON
32 #define IRQ_NOAUTOEN GOT_YOU_MORON
33 #define IRQ_NESTED_THREAD GOT_YOU_MORON
34 #undef IRQF_MODIFY_MASK
35 #define IRQF_MODIFY_MASK GOT_YOU_MORON
38 irq_settings_clr_and_set(struct irq_desc
*desc
, u32 clr
, u32 set
)
40 desc
->status
&= ~(clr
& _IRQF_MODIFY_MASK
);
41 desc
->status
|= (set
& _IRQF_MODIFY_MASK
);
44 static inline bool irq_settings_is_per_cpu(struct irq_desc
*desc
)
46 return desc
->status
& _IRQ_PER_CPU
;
49 static inline void irq_settings_set_per_cpu(struct irq_desc
*desc
)
51 desc
->status
|= _IRQ_PER_CPU
;
54 static inline void irq_settings_set_no_balancing(struct irq_desc
*desc
)
56 desc
->status
|= _IRQ_NO_BALANCING
;
59 static inline bool irq_settings_has_no_balance_set(struct irq_desc
*desc
)
61 return desc
->status
& _IRQ_NO_BALANCING
;
64 static inline u32
irq_settings_get_trigger_mask(struct irq_desc
*desc
)
66 return desc
->status
& IRQ_TYPE_SENSE_MASK
;
70 irq_settings_set_trigger_mask(struct irq_desc
*desc
, u32 mask
)
72 desc
->status
&= ~IRQ_TYPE_SENSE_MASK
;
73 desc
->status
|= mask
& IRQ_TYPE_SENSE_MASK
;
76 static inline bool irq_settings_is_level(struct irq_desc
*desc
)
78 return desc
->status
& _IRQ_LEVEL
;
81 static inline void irq_settings_clr_level(struct irq_desc
*desc
)
83 desc
->status
&= ~_IRQ_LEVEL
;
86 static inline void irq_settings_set_level(struct irq_desc
*desc
)
88 desc
->status
|= _IRQ_LEVEL
;
91 static inline bool irq_settings_can_request(struct irq_desc
*desc
)
93 return !(desc
->status
& _IRQ_NOREQUEST
);
96 static inline void irq_settings_clr_norequest(struct irq_desc
*desc
)
98 desc
->status
&= ~_IRQ_NOREQUEST
;
101 static inline void irq_settings_set_norequest(struct irq_desc
*desc
)
103 desc
->status
|= _IRQ_NOREQUEST
;
106 static inline bool irq_settings_can_probe(struct irq_desc
*desc
)
108 return !(desc
->status
& _IRQ_NOPROBE
);
111 static inline void irq_settings_clr_noprobe(struct irq_desc
*desc
)
113 desc
->status
&= ~_IRQ_NOPROBE
;
116 static inline void irq_settings_set_noprobe(struct irq_desc
*desc
)
118 desc
->status
|= _IRQ_NOPROBE
;
121 static inline bool irq_settings_can_move_pcntxt(struct irq_desc
*desc
)
123 return desc
->status
& _IRQ_MOVE_PCNTXT
;
126 static inline bool irq_settings_can_autoenable(struct irq_desc
*desc
)
128 return !(desc
->status
& _IRQ_NOAUTOEN
);
131 static inline bool irq_settings_is_nested_thread(struct irq_desc
*desc
)
133 return desc
->status
& _IRQ_NESTED_THREAD
;
136 /* Nothing should touch desc->status from now on */
138 #define status USE_THE_PROPER_WRAPPERS_YOU_MORON