14 #include <linux/kernel.h>
17 #include <asm/i8259.h>
20 static volatile void __iomem *pci_intack;
22 static unsigned char cached_8259[2] = { 0xff, 0xff };
23 #define cached_A1 (cached_8259[0])
24 #define cached_21 (cached_8259[1])
43 irq =
readb(pci_intack);
57 irq = (
inb(0xA0) & 7) + 8;
73 }
else if (irq == 0xff)
81 static void i8259_mask_and_ack_irq(
struct irq_data *
d)
101 static void i8259_set_irq_mask(
int irq_nr)
107 static void i8259_mask_irq(
struct irq_data *d)
118 i8259_set_irq_mask(d->
irq);
122 static void i8259_unmask_irq(
struct irq_data *d)
133 i8259_set_irq_mask(d->
irq);
137 static struct irq_chip i8259_pic = {
139 .irq_mask = i8259_mask_irq,
140 .irq_disable = i8259_mask_irq,
141 .irq_unmask = i8259_unmask_irq,
142 .irq_mask_ack = i8259_mask_and_ack_irq,
145 static struct resource pic1_iores = {
146 .name =
"8259 (master)",
152 static struct resource pic2_iores = {
153 .name =
"8259 (slave)",
159 static struct resource pic_edgectrl_iores = {
160 .name =
"8259 edge control",
171 static int i8259_host_map(
struct irq_domain *
h,
unsigned int virq,
174 pr_debug(
"i8259_host_map(%d, 0x%lx)\n", virq, hw);
189 const u32 *intspec,
unsigned int intsize,
192 static unsigned char map_isa_senses[4] = {
199 *out_hwirq = intspec[0];
200 if (intsize > 1 && intspec[1] < 4)
201 *out_flags = map_isa_senses[intspec[1]];
209 .match = i8259_host_match,
210 .map = i8259_host_map,
211 .xlate = i8259_host_xlate,
266 i8259_host = irq_domain_add_legacy_isa(node, &i8259_host_ops,
NULL);
267 if (i8259_host ==
NULL) {
281 if (intack_addr != 0)
282 pci_intack =
ioremap(intack_addr, 1);