]>
Commit | Line | Data |
---|---|---|
e6bea9c4 TG |
1 | /* |
2 | * Internal header to deal with irq_desc->status which will be renamed | |
3 | * to irq_desc->settings. | |
4 | */ | |
5 | enum { | |
6 | _IRQ_DEFAULT_INIT_FLAGS = IRQ_DEFAULT_INIT_FLAGS, | |
a005677b | 7 | _IRQ_PER_CPU = IRQ_PER_CPU, |
876dbd4c | 8 | _IRQ_LEVEL = IRQ_LEVEL, |
1ccb4e61 TG |
9 | _IRQ_NOPROBE = IRQ_NOPROBE, |
10 | _IRQ_NOREQUEST = IRQ_NOREQUEST, | |
7f1b1244 | 11 | _IRQ_NOTHREAD = IRQ_NOTHREAD, |
1ccb4e61 TG |
12 | _IRQ_NOAUTOEN = IRQ_NOAUTOEN, |
13 | _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT, | |
a005677b | 14 | _IRQ_NO_BALANCING = IRQ_NO_BALANCING, |
1ccb4e61 | 15 | _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, |
31d9d9b6 | 16 | _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID, |
b39898cd | 17 | _IRQ_IS_POLLED = IRQ_IS_POLLED, |
a005677b | 18 | _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, |
e6bea9c4 | 19 | }; |
009b4c3b | 20 | |
a005677b | 21 | #define IRQ_PER_CPU GOT_YOU_MORON |
a005677b | 22 | #define IRQ_NO_BALANCING GOT_YOU_MORON |
876dbd4c | 23 | #define IRQ_LEVEL GOT_YOU_MORON |
1ccb4e61 | 24 | #define IRQ_NOPROBE GOT_YOU_MORON |
1ccb4e61 | 25 | #define IRQ_NOREQUEST GOT_YOU_MORON |
7f1b1244 | 26 | #define IRQ_NOTHREAD GOT_YOU_MORON |
1ccb4e61 | 27 | #define IRQ_NOAUTOEN GOT_YOU_MORON |
1ccb4e61 | 28 | #define IRQ_NESTED_THREAD GOT_YOU_MORON |
31d9d9b6 | 29 | #define IRQ_PER_CPU_DEVID GOT_YOU_MORON |
b39898cd | 30 | #define IRQ_IS_POLLED GOT_YOU_MORON |
a005677b TG |
31 | #undef IRQF_MODIFY_MASK |
32 | #define IRQF_MODIFY_MASK GOT_YOU_MORON | |
33 | ||
34 | static inline void | |
35 | irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) | |
36 | { | |
0c6f8a8b TG |
37 | desc->status_use_accessors &= ~(clr & _IRQF_MODIFY_MASK); |
38 | desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); | |
a005677b TG |
39 | } |
40 | ||
41 | static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) | |
42 | { | |
0c6f8a8b | 43 | return desc->status_use_accessors & _IRQ_PER_CPU; |
a005677b TG |
44 | } |
45 | ||
31d9d9b6 MZ |
46 | static inline bool irq_settings_is_per_cpu_devid(struct irq_desc *desc) |
47 | { | |
48 | return desc->status_use_accessors & _IRQ_PER_CPU_DEVID; | |
49 | } | |
50 | ||
a005677b TG |
51 | static inline void irq_settings_set_per_cpu(struct irq_desc *desc) |
52 | { | |
0c6f8a8b | 53 | desc->status_use_accessors |= _IRQ_PER_CPU; |
a005677b TG |
54 | } |
55 | ||
56 | static inline void irq_settings_set_no_balancing(struct irq_desc *desc) | |
57 | { | |
0c6f8a8b | 58 | desc->status_use_accessors |= _IRQ_NO_BALANCING; |
a005677b TG |
59 | } |
60 | ||
61 | static inline bool irq_settings_has_no_balance_set(struct irq_desc *desc) | |
62 | { | |
0c6f8a8b | 63 | return desc->status_use_accessors & _IRQ_NO_BALANCING; |
a005677b | 64 | } |
876dbd4c TG |
65 | |
66 | static inline u32 irq_settings_get_trigger_mask(struct irq_desc *desc) | |
67 | { | |
0c6f8a8b | 68 | return desc->status_use_accessors & IRQ_TYPE_SENSE_MASK; |
876dbd4c TG |
69 | } |
70 | ||
71 | static inline void | |
72 | irq_settings_set_trigger_mask(struct irq_desc *desc, u32 mask) | |
73 | { | |
0c6f8a8b TG |
74 | desc->status_use_accessors &= ~IRQ_TYPE_SENSE_MASK; |
75 | desc->status_use_accessors |= mask & IRQ_TYPE_SENSE_MASK; | |
876dbd4c TG |
76 | } |
77 | ||
78 | static inline bool irq_settings_is_level(struct irq_desc *desc) | |
79 | { | |
0c6f8a8b | 80 | return desc->status_use_accessors & _IRQ_LEVEL; |
876dbd4c TG |
81 | } |
82 | ||
83 | static inline void irq_settings_clr_level(struct irq_desc *desc) | |
84 | { | |
0c6f8a8b | 85 | desc->status_use_accessors &= ~_IRQ_LEVEL; |
876dbd4c TG |
86 | } |
87 | ||
88 | static inline void irq_settings_set_level(struct irq_desc *desc) | |
89 | { | |
0c6f8a8b | 90 | desc->status_use_accessors |= _IRQ_LEVEL; |
876dbd4c | 91 | } |
1ccb4e61 TG |
92 | |
93 | static inline bool irq_settings_can_request(struct irq_desc *desc) | |
94 | { | |
0c6f8a8b | 95 | return !(desc->status_use_accessors & _IRQ_NOREQUEST); |
1ccb4e61 TG |
96 | } |
97 | ||
98 | static inline void irq_settings_clr_norequest(struct irq_desc *desc) | |
99 | { | |
0c6f8a8b | 100 | desc->status_use_accessors &= ~_IRQ_NOREQUEST; |
1ccb4e61 TG |
101 | } |
102 | ||
103 | static inline void irq_settings_set_norequest(struct irq_desc *desc) | |
104 | { | |
0c6f8a8b | 105 | desc->status_use_accessors |= _IRQ_NOREQUEST; |
1ccb4e61 TG |
106 | } |
107 | ||
7f1b1244 PM |
108 | static inline bool irq_settings_can_thread(struct irq_desc *desc) |
109 | { | |
110 | return !(desc->status_use_accessors & _IRQ_NOTHREAD); | |
111 | } | |
112 | ||
113 | static inline void irq_settings_clr_nothread(struct irq_desc *desc) | |
114 | { | |
115 | desc->status_use_accessors &= ~_IRQ_NOTHREAD; | |
116 | } | |
117 | ||
118 | static inline void irq_settings_set_nothread(struct irq_desc *desc) | |
119 | { | |
120 | desc->status_use_accessors |= _IRQ_NOTHREAD; | |
121 | } | |
122 | ||
1ccb4e61 TG |
123 | static inline bool irq_settings_can_probe(struct irq_desc *desc) |
124 | { | |
0c6f8a8b | 125 | return !(desc->status_use_accessors & _IRQ_NOPROBE); |
1ccb4e61 TG |
126 | } |
127 | ||
128 | static inline void irq_settings_clr_noprobe(struct irq_desc *desc) | |
129 | { | |
0c6f8a8b | 130 | desc->status_use_accessors &= ~_IRQ_NOPROBE; |
1ccb4e61 TG |
131 | } |
132 | ||
133 | static inline void irq_settings_set_noprobe(struct irq_desc *desc) | |
134 | { | |
0c6f8a8b | 135 | desc->status_use_accessors |= _IRQ_NOPROBE; |
1ccb4e61 TG |
136 | } |
137 | ||
138 | static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc) | |
139 | { | |
0c6f8a8b | 140 | return desc->status_use_accessors & _IRQ_MOVE_PCNTXT; |
1ccb4e61 TG |
141 | } |
142 | ||
143 | static inline bool irq_settings_can_autoenable(struct irq_desc *desc) | |
144 | { | |
0c6f8a8b | 145 | return !(desc->status_use_accessors & _IRQ_NOAUTOEN); |
1ccb4e61 TG |
146 | } |
147 | ||
148 | static inline bool irq_settings_is_nested_thread(struct irq_desc *desc) | |
149 | { | |
0c6f8a8b | 150 | return desc->status_use_accessors & _IRQ_NESTED_THREAD; |
1ccb4e61 | 151 | } |
b39898cd TG |
152 | |
153 | static inline bool irq_settings_is_polled(struct irq_desc *desc) | |
154 | { | |
155 | return desc->status_use_accessors & _IRQ_IS_POLLED; | |
156 | } |