Lines Matching refs:apic
221 int apic, pin; member
286 void io_apic_eoi(unsigned int apic, unsigned int vector) in io_apic_eoi() argument
288 struct io_apic __iomem *io_apic = io_apic_base(apic); in io_apic_eoi()
292 unsigned int native_io_apic_read(unsigned int apic, unsigned int reg) in native_io_apic_read() argument
294 struct io_apic __iomem *io_apic = io_apic_base(apic); in native_io_apic_read()
299 void native_io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) in native_io_apic_write() argument
301 struct io_apic __iomem *io_apic = io_apic_base(apic); in native_io_apic_write()
313 void native_io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) in native_io_apic_modify() argument
315 struct io_apic __iomem *io_apic = io_apic_base(apic); in native_io_apic_modify()
327 static struct IO_APIC_route_entry __ioapic_read_entry(int apic, int pin) in __ioapic_read_entry() argument
331 eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); in __ioapic_read_entry()
332 eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); in __ioapic_read_entry()
337 static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) in ioapic_read_entry() argument
343 eu.entry = __ioapic_read_entry(apic, pin); in ioapic_read_entry()
355 static void __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) in __ioapic_write_entry() argument
360 io_apic_write(apic, 0x11 + 2*pin, eu.w2); in __ioapic_write_entry()
361 io_apic_write(apic, 0x10 + 2*pin, eu.w1); in __ioapic_write_entry()
364 static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) in ioapic_write_entry() argument
369 __ioapic_write_entry(apic, pin, e); in ioapic_write_entry()
378 static void ioapic_mask_entry(int apic, int pin) in ioapic_mask_entry() argument
384 io_apic_write(apic, 0x10 + 2*pin, eu.w1); in ioapic_mask_entry()
385 io_apic_write(apic, 0x11 + 2*pin, eu.w2); in ioapic_mask_entry()
394 static int __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) in __add_pin_to_irq_node() argument
400 if (entry->apic == apic && entry->pin == pin) in __add_pin_to_irq_node()
406 node, apic, pin); in __add_pin_to_irq_node()
409 entry->apic = apic; in __add_pin_to_irq_node()
416 static void __remove_pin_from_irq(struct irq_cfg *cfg, int apic, int pin) in __remove_pin_from_irq() argument
421 if (entry->apic == apic && entry->pin == pin) { in __remove_pin_from_irq()
428 static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) in add_pin_to_irq_node() argument
430 if (__add_pin_to_irq_node(cfg, node, apic, pin)) in add_pin_to_irq_node()
444 if (entry->apic == oldapic && entry->pin == oldpin) { in replace_pin_at_irq_node()
445 entry->apic = newapic; in replace_pin_at_irq_node()
463 reg = io_apic_read(entry->apic, 0x10 + pin * 2); in __io_apic_modify_irq()
466 io_apic_modify(entry->apic, 0x10 + pin * 2, reg); in __io_apic_modify_irq()
489 io_apic = io_apic_base(entry->apic); in io_apic_sync()
542 void native_eoi_ioapic_pin(int apic, int pin, int vector) in native_eoi_ioapic_pin() argument
544 if (mpc_ioapic_ver(apic) >= 0x20) { in native_eoi_ioapic_pin()
545 io_apic_eoi(apic, vector); in native_eoi_ioapic_pin()
549 entry = entry1 = __ioapic_read_entry(apic, pin); in native_eoi_ioapic_pin()
557 __ioapic_write_entry(apic, pin, entry1); in native_eoi_ioapic_pin()
562 __ioapic_write_entry(apic, pin, entry); in native_eoi_ioapic_pin()
573 x86_io_apic_ops.eoi_ioapic_pin(entry->apic, entry->pin, in eoi_ioapic_irq()
578 static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) in clear_IO_APIC_pin() argument
583 entry = ioapic_read_entry(apic, pin); in clear_IO_APIC_pin()
593 ioapic_write_entry(apic, pin, entry); in clear_IO_APIC_pin()
594 entry = ioapic_read_entry(apic, pin); in clear_IO_APIC_pin()
607 ioapic_write_entry(apic, pin, entry); in clear_IO_APIC_pin()
611 x86_io_apic_ops.eoi_ioapic_pin(apic, pin, entry.vector); in clear_IO_APIC_pin()
619 ioapic_mask_entry(apic, pin); in clear_IO_APIC_pin()
620 entry = ioapic_read_entry(apic, pin); in clear_IO_APIC_pin()
623 mpc_ioapic_id(apic), pin); in clear_IO_APIC_pin()
628 int apic, pin; in clear_IO_APIC() local
630 for_each_ioapic_pin(apic, pin) in clear_IO_APIC()
631 clear_IO_APIC_pin(apic, pin); in clear_IO_APIC()
677 int apic, pin; in save_ioapic_entries() local
680 for_each_ioapic(apic) { in save_ioapic_entries()
681 if (!ioapics[apic].saved_registers) { in save_ioapic_entries()
686 for_each_pin(apic, pin) in save_ioapic_entries()
687 ioapics[apic].saved_registers[pin] = in save_ioapic_entries()
688 ioapic_read_entry(apic, pin); in save_ioapic_entries()
699 int apic, pin; in mask_ioapic_entries() local
701 for_each_ioapic(apic) { in mask_ioapic_entries()
702 if (!ioapics[apic].saved_registers) in mask_ioapic_entries()
705 for_each_pin(apic, pin) { in mask_ioapic_entries()
708 entry = ioapics[apic].saved_registers[pin]; in mask_ioapic_entries()
711 ioapic_write_entry(apic, pin, entry); in mask_ioapic_entries()
722 int apic, pin; in restore_ioapic_entries() local
724 for_each_ioapic(apic) { in restore_ioapic_entries()
725 if (!ioapics[apic].saved_registers) in restore_ioapic_entries()
728 for_each_pin(apic, pin) in restore_ioapic_entries()
729 ioapic_write_entry(apic, pin, in restore_ioapic_entries()
730 ioapics[apic].saved_registers[pin]); in restore_ioapic_entries()
1173 int apic, idx, pin; in IO_APIC_irq_trigger() local
1175 for_each_ioapic_pin(apic, pin) { in IO_APIC_irq_trigger()
1176 idx = find_irq_entry(apic, pin, mp_INT); in IO_APIC_irq_trigger()
1177 if ((idx != -1) && (irq == pin_2_irq(idx, apic, pin, 0))) in IO_APIC_irq_trigger()
1222 entry->delivery_mode = apic->irq_delivery_mode; in native_setup_ioapic_entry()
1223 entry->dest_mode = apic->irq_dest_mode; in native_setup_ioapic_entry()
1249 if (assign_irq_vector(irq, cfg, apic->target_cpus())) in setup_ioapic_irq()
1252 if (apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus(), in setup_ioapic_irq()
1316 if (unlikely(apic->cpu_mask_to_apicid_and(apic->target_cpus(), in setup_timer_IRQ0_pin()
1317 apic->target_cpus(), &dest))) in setup_timer_IRQ0_pin()
1320 entry.dest_mode = apic->irq_dest_mode; in setup_timer_IRQ0_pin()
1323 entry.delivery_mode = apic->irq_delivery_mode; in setup_timer_IRQ0_pin()
1341 void native_io_apic_print_entries(unsigned int apic, unsigned int nr_entries) in native_io_apic_print_entries() argument
1350 entry = ioapic_read_entry(apic, i); in native_io_apic_print_entries()
1366 void intel_ir_io_apic_print_entries(unsigned int apic, in intel_ir_io_apic_print_entries() argument
1377 entry = ioapic_read_entry(apic, i); in intel_ir_io_apic_print_entries()
1495 pr_cont("-> %d:%d", entry->apic, entry->pin); in print_IO_APICs()
1503 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; member
1508 int apic, pin; in enable_IO_APIC() local
1516 for_each_ioapic_pin(apic, pin) { in enable_IO_APIC()
1518 struct IO_APIC_route_entry entry = ioapic_read_entry(apic, pin); in enable_IO_APIC()
1524 ioapic_i8259.apic = apic; in enable_IO_APIC()
1541 ioapic_i8259.apic = i8259_apic; in enable_IO_APIC()
1544 if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) && in enable_IO_APIC()
1580 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry); in native_disable_io_apic()
1624 apic->ioapic_phys_id_map(&phys_cpu_present_map, &phys_id_present_map); in setup_ioapic_ids_from_mpc_nocheck()
1650 if (apic->check_apicid_used(&phys_id_present_map, in setup_ioapic_ids_from_mpc_nocheck()
1665 apic->apicid_to_cpu_present(mpc_ioapic_id(ioapic_idx), in setup_ioapic_ids_from_mpc_nocheck()
1824 int apic, pin; in __target_IO_APIC_irq() local
1831 apic = entry->apic; in __target_IO_APIC_irq()
1834 io_apic_write(apic, 0x11 + pin*2, dest); in __target_IO_APIC_irq()
1835 reg = io_apic_read(apic, 0x10 + pin*2); in __target_IO_APIC_irq()
1838 io_apic_modify(apic, 0x10 + pin*2, reg); in __target_IO_APIC_irq()
1879 reg = io_apic_read(entry->apic, 0x10 + pin*2); in io_apic_level_ack_pending()
2096 int apic, pin, i; in unlock_ExtINT_logic() local
2105 apic = find_isa_irq_apic(8, mp_INT); in unlock_ExtINT_logic()
2106 if (apic == -1) { in unlock_ExtINT_logic()
2111 entry0 = ioapic_read_entry(apic, pin); in unlock_ExtINT_logic()
2112 clear_IO_APIC_pin(apic, pin); in unlock_ExtINT_logic()
2124 ioapic_write_entry(apic, pin, entry1); in unlock_ExtINT_logic()
2141 clear_IO_APIC_pin(apic, pin); in unlock_ExtINT_logic()
2143 ioapic_write_entry(apic, pin, entry0); in unlock_ExtINT_logic()
2177 assign_irq_vector(0, cfg, apic->target_cpus()); in check_timer()
2194 apic2 = ioapic_i8259.apic; in check_timer()
2512 apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map); in io_apic_get_unique_id()
2528 if (apic->check_apicid_used(&apic_id_map, apic_id)) { in io_apic_get_unique_id()
2531 if (!apic->check_apicid_used(&apic_id_map, i)) in io_apic_get_unique_id()
2544 apic->apicid_to_cpu_present(apic_id, &tmp); in io_apic_get_unique_id()
2693 mask = apic->target_cpus(); in setup_ioapic_dest()