Lines Matching refs:pin
42 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; member
66 static int apic_pin_2_gsi_irq(int apic, int pin);
72 unsigned int pin; in share_vector_maps() local
80 for (pin = 0; pin < nr_ioapic_entries[dst]; ++pin) { in share_vector_maps()
81 int irq = apic_pin_2_gsi_irq(dst, pin); in share_vector_maps()
102 int apic, pin; member
113 static void add_pin_to_irq(unsigned int irq, int apic, int pin) in add_pin_to_irq() argument
118 BUG_ON((entry->apic == apic) && (entry->pin == pin)); in add_pin_to_irq()
122 BUG_ON((entry->apic == apic) && (entry->pin == pin)); in add_pin_to_irq()
124 if (entry->pin != -1) { in add_pin_to_irq()
133 entry->pin = pin; in add_pin_to_irq()
137 static void remove_pin_from_irq(unsigned int irq, int apic, int pin) in remove_pin_from_irq() argument
142 if ((entry->apic == apic) && (entry->pin == pin)) in remove_pin_from_irq()
147 entry->pin = entry->apic = -1; in remove_pin_from_irq()
160 entry->pin = entry->apic = -1; in remove_pin_from_irq()
178 if (entry->apic == oldapic && entry->pin == oldpin) { in replace_pin_at_irq()
180 entry->pin = newpin; in replace_pin_at_irq()
193 if (entry->pin == -1) in io_apic_get_used_vector_map()
232 unsigned int apic, unsigned int pin, bool raw) in __ioapic_read_entry() argument
237 eu.w1 = (*read)(apic, 0x10 + 2 * pin); in __ioapic_read_entry()
238 eu.w2 = (*read)(apic, 0x11 + 2 * pin); in __ioapic_read_entry()
243 unsigned int apic, unsigned int pin, bool raw) in ioapic_read_entry() argument
249 entry = __ioapic_read_entry(apic, pin, raw); in ioapic_read_entry()
255 unsigned int apic, unsigned int pin, bool raw, in __ioapic_write_entry() argument
262 (*write)(apic, 0x11 + 2*pin, eu.w2); in __ioapic_write_entry()
263 (*write)(apic, 0x10 + 2*pin, eu.w1); in __ioapic_write_entry()
267 unsigned int apic, unsigned int pin, bool raw, in ioapic_write_entry() argument
272 __ioapic_write_entry(apic, pin, raw, e); in ioapic_write_entry()
281 static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin) in __io_apic_eoi() argument
288 vector = __ioapic_read_entry(apic, pin, TRUE).vector; in __io_apic_eoi()
299 entry = __ioapic_read_entry(apic, pin, TRUE); in __io_apic_eoi()
306 __ioapic_write_entry(apic, pin, TRUE, entry); in __io_apic_eoi()
312 __ioapic_write_entry(apic, pin, TRUE, entry); in __io_apic_eoi()
314 __ioapic_write_entry(apic, pin, TRUE, entry); in __io_apic_eoi()
320 __ioapic_write_entry(apic, pin, TRUE, entry); in __io_apic_eoi()
330 int apic, pin; in save_IO_APIC_setup() local
342 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) in save_IO_APIC_setup()
343 ioapic_entries[apic][pin] = __ioapic_read_entry(apic, pin, 1); in save_IO_APIC_setup()
354 int apic, pin; in mask_IO_APIC_setup() local
366 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) { in mask_IO_APIC_setup()
369 entry = ioapic_entries[apic][pin]; in mask_IO_APIC_setup()
373 ioapic_write_entry(apic, pin, 1, entry); in mask_IO_APIC_setup()
384 int apic, pin; in restore_IO_APIC_setup() local
396 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) in restore_IO_APIC_setup()
397 ioapic_write_entry(apic, pin, 1, ioapic_entries[apic][pin]); in restore_IO_APIC_setup()
416 unsigned int pin, reg; in __modify_IO_APIC_irq() local
419 pin = entry->pin; in __modify_IO_APIC_irq()
420 if (pin == -1) in __modify_IO_APIC_irq()
422 reg = io_apic_read(entry->apic, 0x10 + pin*2); in __modify_IO_APIC_irq()
425 io_apic_modify(entry->apic, 0x10 + pin*2, reg); in __modify_IO_APIC_irq()
477 unsigned int pin, vector = desc->arch.vector; in __eoi_IO_APIC_irq() local
480 pin = entry->pin; in __eoi_IO_APIC_irq()
481 if (pin == -1) in __eoi_IO_APIC_irq()
483 __io_apic_eoi(entry->apic, vector, pin); in __eoi_IO_APIC_irq()
498 static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) in clear_IO_APIC_pin() argument
503 entry = __ioapic_read_entry(apic, pin, FALSE); in clear_IO_APIC_pin()
513 __ioapic_write_entry(apic, pin, FALSE, entry); in clear_IO_APIC_pin()
515 entry = __ioapic_read_entry(apic, pin, TRUE); in clear_IO_APIC_pin()
521 __ioapic_write_entry(apic, pin, TRUE, entry); in clear_IO_APIC_pin()
523 __io_apic_eoi(apic, entry.vector, pin); in clear_IO_APIC_pin()
531 __ioapic_write_entry(apic, pin, TRUE, entry); in clear_IO_APIC_pin()
533 entry = __ioapic_read_entry(apic, pin, TRUE); in clear_IO_APIC_pin()
536 IO_APIC_ID(apic), pin); in clear_IO_APIC_pin()
541 int apic, pin; in clear_IO_APIC() local
544 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) in clear_IO_APIC()
545 clear_IO_APIC_pin(apic, pin); in clear_IO_APIC()
554 int pin, irq; in set_ioapic_affinity_irq() local
567 pin = entry->pin; in set_ioapic_affinity_irq()
568 if (pin == -1) in set_ioapic_affinity_irq()
571 io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest); in set_ioapic_affinity_irq()
572 data = io_apic_read(entry->apic, 0x10 + pin*2); in set_ioapic_affinity_irq()
575 io_apic_modify(entry->apic, 0x10 + pin*2, data); in set_ioapic_affinity_irq()
589 static int find_irq_entry(int apic, int pin, int type) in find_irq_entry() argument
597 mp_irqs[i].mpc_dstirq == pin) in find_irq_entry()
659 static int pin_2_irq(int idx, int apic, int pin);
668 int pin, ioapic, irq, irq_entry; in setup_ioapic_dest() local
674 for (pin = 0; pin < nr_ioapic_entries[ioapic]; pin++) { in setup_ioapic_dest()
677 irq_entry = find_irq_entry(ioapic, pin, mp_INT); in setup_ioapic_dest()
680 irq = pin_2_irq(irq_entry, ioapic, pin); in setup_ioapic_dest()
893 static int pin_2_irq(int idx, int apic, int pin) in pin_2_irq() argument
901 if (mp_irqs[idx].mpc_dstirq != pin) in pin_2_irq()
922 irq += pin; in pin_2_irq()
938 int apic, idx, pin; in IO_APIC_irq_trigger() local
941 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) { in IO_APIC_irq_trigger()
942 idx = find_irq_entry(apic,pin,mp_INT); in IO_APIC_irq_trigger()
943 if ((idx != -1) && (irq == pin_2_irq(idx,apic,pin))) in IO_APIC_irq_trigger()
979 int apic, pin, idx, irq, first_notcon = 1, vector; in setup_IO_APIC_irqs() local
985 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) { in setup_IO_APIC_irqs()
997 idx = find_irq_entry(apic,pin,mp_INT); in setup_IO_APIC_irqs()
1003 pin); in setup_IO_APIC_irqs()
1007 mp_ioapics[apic].mpc_apicid, pin); in setup_IO_APIC_irqs()
1019 irq = pin_2_irq(idx, apic, pin); in setup_IO_APIC_irqs()
1027 add_pin_to_irq(irq, apic, pin); in setup_IO_APIC_irqs()
1043 __ioapic_write_entry(apic, pin, 0, entry); in setup_IO_APIC_irqs()
1056 static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, int vector) in setup_ExtINT_IRQ0_pin() argument
1088 ioapic_write_entry(apic, pin, 0, entry); in setup_ExtINT_IRQ0_pin()
1228 if (entry->pin < 0) in __print_IO_APIC()
1232 printk("-> %d:%d", entry->apic, entry->pin); in __print_IO_APIC()
1265 irq_2_pin[i].pin = -1; in enable_IO_APIC()
1284 int pin; in enable_IO_APIC() local
1286 for (pin = 0; pin < nr_ioapic_entries[apic]; pin++) { in enable_IO_APIC()
1287 struct IO_APIC_route_entry entry = ioapic_read_entry(apic, pin, 0); in enable_IO_APIC()
1294 ioapic_i8259.pin = pin; in enable_IO_APIC()
1308 if ((ioapic_i8259.pin == -1) && (i8259_pin >= 0)) { in enable_IO_APIC()
1310 ioapic_i8259.pin = i8259_pin; in enable_IO_APIC()
1314 if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) && in enable_IO_APIC()
1315 (i8259_pin >= 0) && (ioapic_i8259.pin >= 0)) in enable_IO_APIC()
1341 if (ioapic_i8259.pin != -1) { in disable_IO_APIC()
1358 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, 0, entry); in disable_IO_APIC()
1360 disconnect_bsp_APIC(ioapic_i8259.pin != -1); in disable_IO_APIC()
1612 int pin; in io_apic_level_ack_pending() local
1617 pin = entry->pin; in io_apic_level_ack_pending()
1618 if (pin == -1) in io_apic_level_ack_pending()
1620 reg = io_apic_read(entry->apic, 0x10 + pin*2); in io_apic_level_ack_pending()
1829 int apic, pin, i; in unlock_ExtINT_logic() local
1833 pin = find_isa_irq_pin(8, mp_INT); in unlock_ExtINT_logic()
1835 if ( pin == -1 || apic == -1 ) in unlock_ExtINT_logic()
1838 entry0 = ioapic_read_entry(apic, pin, 0); in unlock_ExtINT_logic()
1839 clear_IO_APIC_pin(apic, pin); in unlock_ExtINT_logic()
1851 ioapic_write_entry(apic, pin, 0, entry1); in unlock_ExtINT_logic()
1868 clear_IO_APIC_pin(apic, pin); in unlock_ExtINT_logic()
1870 ioapic_write_entry(apic, pin, 0, entry0); in unlock_ExtINT_logic()
1916 pin2 = ioapic_i8259.pin; in check_timer()
2198 int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low) in io_apic_set_pci_routing() argument
2230 add_pin_to_irq(irq, ioapic, pin); in io_apic_set_pci_routing()
2245 mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, in io_apic_set_pci_routing()
2254 __ioapic_write_entry(ioapic, pin, 0, entry); in io_apic_set_pci_routing()
2279 static int apic_pin_2_gsi_irq(int apic, int pin) in apic_pin_2_gsi_irq() argument
2286 idx = find_irq_entry(apic, pin, mp_INT); in apic_pin_2_gsi_irq()
2288 return idx >= 0 ? pin_2_irq(idx, apic, pin) in apic_pin_2_gsi_irq()
2289 : io_apic_gsi_base(apic) + pin; in apic_pin_2_gsi_irq()
2311 apic, pin, irq, *(u32 *)&rte, ##a )
2315 int apic, pin, irq, ret, pirq; in ioapic_guest_write() local
2327 pin = (reg - 0x10) >> 1; in ioapic_guest_write()
2343 printk(" APIC=%d/%d, lo-reg=%x\n", apic, pin, val); in ioapic_guest_write()
2354 irq = apic_pin_2_gsi_irq(apic, pin); in ioapic_guest_write()
2378 ret = io_apic_read(apic, 0x10 + 2 * pin); in ioapic_guest_write()
2393 add_pin_to_irq(irq, apic, pin); in ioapic_guest_write()
2400 remove_pin_from_irq(irq, apic, pin); in ioapic_guest_write()
2430 __ioapic_write_entry(apic, pin, 0, rte); in ioapic_guest_write()
2458 unsigned int irq, pin, printed = 0; in dump_ioapic_irq_info() local
2469 if ( entry->pin == -1 ) in dump_ioapic_irq_info()
2479 pin = entry->pin; in dump_ioapic_irq_info()
2481 printk(" Apic 0x%02x, Pin %2d: ", entry->apic, pin); in dump_ioapic_irq_info()
2483 rte = ioapic_read_entry(entry->apic, pin, 0); in dump_ioapic_irq_info()