Use wrappers to keep them away from the core code.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
*/
for_each_irq_desc_reverse(i, desc) {
raw_spin_lock_irq(&desc->lock);
- if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
+ if (!desc->action && irq_settings_can_probe(desc)) {
/*
* An old-style architecture might still have
* the handle_bad_irq handler there:
*/
for_each_irq_desc_reverse(i, desc) {
raw_spin_lock_irq(&desc->lock);
- if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
+ if (!desc->action && irq_settings_can_probe(desc)) {
desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
if (irq_startup(desc)) {
irq_compat_set_pending(desc);
desc->name = name;
if (handle != handle_bad_irq && is_chained) {
- desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
+ irq_settings_set_noprobe(desc);
+ irq_settings_set_norequest(desc);
irq_startup(desc);
}
raw_spin_unlock_irqrestore(&desc->lock, flags);
#ifdef CONFIG_GENERIC_PENDING_IRQ
static inline bool irq_can_move_pcntxt(struct irq_desc *desc)
{
- return desc->status & IRQ_MOVE_PCNTXT;
+ return irq_settings_can_move_pcntxt(desc);
}
static inline bool irq_move_pending(struct irq_desc *desc)
{
if (desc->istate & IRQS_SUSPENDED)
goto err_out;
/* Prevent probing on this irq: */
- desc->status |= IRQ_NOPROBE;
+ irq_settings_set_noprobe(desc);
irq_enable(desc);
check_irq_resend(desc, irq);
/* fall-through */
if (!desc)
return 0;
- if (desc->status & IRQ_NOREQUEST)
+ if (!irq_settings_can_request(desc))
return 0;
raw_spin_lock_irqsave(&desc->lock, flags);
* Check whether the interrupt nests into another interrupt
* thread.
*/
- nested = desc->status & IRQ_NESTED_THREAD;
+ nested = irq_settings_is_nested_thread(desc);
if (nested) {
if (!new->thread_fn)
return -EINVAL;
if (new->flags & IRQF_ONESHOT)
desc->istate |= IRQS_ONESHOT;
- if (!(desc->status & IRQ_NOAUTOEN))
+ if (irq_settings_can_autoenable(desc))
irq_startup(desc);
else
/* Undo nested disables: */
if (!desc)
return -EINVAL;
- if (desc->status & IRQ_NOREQUEST)
+ if (!irq_settings_can_request(desc))
return -EINVAL;
if (!handler) {
if (!desc)
return -EINVAL;
- if (desc->status & IRQ_NESTED_THREAD) {
+ if (irq_settings_is_nested_thread(desc)) {
ret = request_threaded_irq(irq, NULL, handler,
flags, name, dev_id);
return !ret ? IRQC_IS_NESTED : ret;
_IRQ_DEFAULT_INIT_FLAGS = IRQ_DEFAULT_INIT_FLAGS,
_IRQ_PER_CPU = IRQ_PER_CPU,
_IRQ_LEVEL = IRQ_LEVEL,
+ _IRQ_NOPROBE = IRQ_NOPROBE,
+ _IRQ_NOREQUEST = IRQ_NOREQUEST,
+ _IRQ_NOAUTOEN = IRQ_NOAUTOEN,
+ _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT,
_IRQ_NO_BALANCING = IRQ_NO_BALANCING,
+ _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD,
_IRQF_MODIFY_MASK = IRQF_MODIFY_MASK,
};
#define IRQ_AFFINITY_SET GOT_YOU_MORON
#undef IRQ_LEVEL
#define IRQ_LEVEL GOT_YOU_MORON
+#undef IRQ_NOPROBE
+#define IRQ_NOPROBE GOT_YOU_MORON
+#undef IRQ_NOREQUEST
+#define IRQ_NOREQUEST GOT_YOU_MORON
+#undef IRQ_NOAUTOEN
+#define IRQ_NOAUTOEN GOT_YOU_MORON
+#undef IRQ_NESTED_THREAD
+#define IRQ_NESTED_THREAD GOT_YOU_MORON
#undef IRQF_MODIFY_MASK
#define IRQF_MODIFY_MASK GOT_YOU_MORON
{
desc->status |= _IRQ_LEVEL;
}
+
+static inline bool irq_settings_can_request(struct irq_desc *desc)
+{
+ return !(desc->status & _IRQ_NOREQUEST);
+}
+
+static inline void irq_settings_clr_norequest(struct irq_desc *desc)
+{
+ desc->status &= ~_IRQ_NOREQUEST;
+}
+
+static inline void irq_settings_set_norequest(struct irq_desc *desc)
+{
+ desc->status |= _IRQ_NOREQUEST;
+}
+
+static inline bool irq_settings_can_probe(struct irq_desc *desc)
+{
+ return !(desc->status & _IRQ_NOPROBE);
+}
+
+static inline void irq_settings_clr_noprobe(struct irq_desc *desc)
+{
+ desc->status &= ~_IRQ_NOPROBE;
+}
+
+static inline void irq_settings_set_noprobe(struct irq_desc *desc)
+{
+ desc->status |= _IRQ_NOPROBE;
+}
+
+static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc)
+{
+ return desc->status & _IRQ_MOVE_PCNTXT;
+}
+
+static inline bool irq_settings_can_autoenable(struct irq_desc *desc)
+{
+ return !(desc->status & _IRQ_NOAUTOEN);
+}
+
+static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
+{
+ return desc->status & _IRQ_NESTED_THREAD;
+}
raw_spin_lock(&desc->lock);
/* PER_CPU and nested thread interrupts are never polled */
- if (irq_settings_is_per_cpu(desc) ||
- (desc->status & IRQ_NESTED_THREAD))
+ if (irq_settings_is_per_cpu(desc) || irq_settings_is_nested_thread(desc))
goto out;
/*