Lines Matching +full:flags +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0
45 * This contains the irq mask for both 8259A irq controllers,
50 * Not all IRQs can be routed through the IO-APIC, eg. on certain (older)
51 * boards the timer interrupt is not really connected to any IO-APIC pin,
54 * Any '1' bit in this mask means the IRQ is routed through the IO-APIC.
62 unsigned int mask = 1 << irq; in mask_8259A_irq() local
63 unsigned long flags; in mask_8259A_irq() local
65 raw_spin_lock_irqsave(&i8259A_lock, flags); in mask_8259A_irq()
66 cached_irq_mask |= mask; in mask_8259A_irq()
71 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in mask_8259A_irq()
76 mask_8259A_irq(data->irq); in disable_8259A_irq()
81 unsigned int mask = ~(1 << irq); in unmask_8259A_irq() local
82 unsigned long flags; in unmask_8259A_irq() local
84 raw_spin_lock_irqsave(&i8259A_lock, flags); in unmask_8259A_irq()
85 cached_irq_mask &= mask; in unmask_8259A_irq()
90 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in unmask_8259A_irq()
95 unmask_8259A_irq(data->irq); in enable_8259A_irq()
100 unsigned int mask = 1<<irq; in i8259A_irq_pending() local
101 unsigned long flags; in i8259A_irq_pending() local
104 raw_spin_lock_irqsave(&i8259A_lock, flags); in i8259A_irq_pending()
106 ret = inb(PIC_MASTER_CMD) & mask; in i8259A_irq_pending()
108 ret = inb(PIC_SLAVE_CMD) & (mask >> 8); in i8259A_irq_pending()
109 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in i8259A_irq_pending()
149 * much _has_ to be done exactly like this (mask it
155 unsigned int irq = data->irq; in mask_and_ack_8259A()
157 unsigned long flags; in mask_and_ack_8259A() local
159 raw_spin_lock_irqsave(&i8259A_lock, flags); in mask_and_ack_8259A()
162 * to overdo spurious IRQ handling - it's usually a sign in mask_and_ack_8259A()
167 * usually resulting from the 8259A-1|2 PICs) occur in mask_and_ack_8259A()
181 inb(PIC_SLAVE_IMR); /* DUMMY - (do we need this?) */ in mask_and_ack_8259A()
185 /* 'Specific EOI' to master-IRQ2 */ in mask_and_ack_8259A()
188 inb(PIC_MASTER_IMR); /* DUMMY - (do we need this?) */ in mask_and_ack_8259A()
192 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in mask_and_ack_8259A()
197 * this is the slow path - should happen rarely. in mask_and_ack_8259A()
202 * 8259A - not spurious, go handle it. in mask_and_ack_8259A()
228 .name = "XT-PIC",
268 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ in i8259A_shutdown()
269 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ in i8259A_shutdown()
280 unsigned long flags; in mask_8259A() local
282 raw_spin_lock_irqsave(&i8259A_lock, flags); in mask_8259A()
284 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ in mask_8259A()
285 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ in mask_8259A()
287 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in mask_8259A()
292 unsigned long flags; in unmask_8259A() local
294 raw_spin_lock_irqsave(&i8259A_lock, flags); in unmask_8259A()
296 outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */ in unmask_8259A()
297 outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */ in unmask_8259A()
299 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in unmask_8259A()
305 unsigned long flags; in probe_8259A() local
317 * there and let legacy_pic->init() initialize it for nothing. in probe_8259A()
327 * Check to see if we have a PIC. Mask all except the cascade and in probe_8259A()
331 raw_spin_lock_irqsave(&i8259A_lock, flags); in probe_8259A()
333 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ in probe_8259A()
341 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in probe_8259A()
347 unsigned long flags; in init_8259A() local
351 raw_spin_lock_irqsave(&i8259A_lock, flags); in init_8259A()
353 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ in init_8259A()
356 * outb_pic - this has to work on a wide range of PC hardware. in init_8259A()
358 outb_pic(0x11, PIC_MASTER_CMD); /* ICW1: select 8259A-1 init */ in init_8259A()
360 /* ICW2: 8259A-1 IR0-7 mapped to ISA_IRQ_VECTOR(0) */ in init_8259A()
363 /* 8259A-1 (the master) has a slave on IR2 */ in init_8259A()
371 outb_pic(0x11, PIC_SLAVE_CMD); /* ICW1: select 8259A-2 init */ in init_8259A()
373 /* ICW2: 8259A-2 IR0-7 mapped to ISA_IRQ_VECTOR(8) */ in init_8259A()
375 /* 8259A-2 is a slave on master's IR2 */ in init_8259A()
382 * In AEOI mode we just have to mask the interrupt in init_8259A()
391 outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */ in init_8259A()
392 outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */ in init_8259A()
394 raw_spin_unlock_irqrestore(&i8259A_lock, flags); in init_8259A()
399 * is to make x86 binary compatible among pc compatible and non-pc compatible
418 .mask = legacy_pic_uint_noop,
431 .mask = mask_8259A_irq,