Lines Matching refs:irq

179 	int irq;  in __gsi_to_irq()  local
183 for (irq = 0; irq < NR_IRQS; irq++) { in __gsi_to_irq()
184 info = &iosapic_intr_info[irq]; in __gsi_to_irq()
187 return irq; in __gsi_to_irq()
196 int irq; in gsi_to_irq() local
199 irq = __gsi_to_irq(gsi); in gsi_to_irq()
201 return irq; in gsi_to_irq()
204 static struct iosapic_rte_info *find_rte(unsigned int irq, unsigned int gsi) in find_rte() argument
208 list_for_each_entry(rte, &iosapic_intr_info[irq].rtes, rte_list) in find_rte()
215 set_rte (unsigned int gsi, unsigned int irq, unsigned int dest, int mask) in set_rte() argument
222 ia64_vector vector = irq_to_vector(irq); in set_rte()
226 rte = find_rte(irq, gsi); in set_rte()
231 pol = iosapic_intr_info[irq].polarity; in set_rte()
232 trigger = iosapic_intr_info[irq].trigger; in set_rte()
233 dmode = iosapic_intr_info[irq].dmode; in set_rte()
238 set_irq_affinity_info(irq, (int)(dest & 0xffff), redir); in set_rte()
252 iosapic_intr_info[irq].low32 = low32; in set_rte()
253 iosapic_intr_info[irq].dest = dest; in set_rte()
270 int irq; in kexec_disable_iosapic() local
272 for (irq = 0; irq < NR_IRQS; irq++) { in kexec_disable_iosapic()
273 info = &iosapic_intr_info[irq]; in kexec_disable_iosapic()
274 vec = irq_to_vector(irq); in kexec_disable_iosapic()
289 unsigned int irq = data->irq; in mask_irq() local
294 if (!iosapic_intr_info[irq].count) in mask_irq()
298 low32 = iosapic_intr_info[irq].low32 |= IOSAPIC_MASK; in mask_irq()
299 list_for_each_entry(rte, &iosapic_intr_info[irq].rtes, rte_list) { in mask_irq()
308 unsigned int irq = data->irq; in unmask_irq() local
313 if (!iosapic_intr_info[irq].count) in unmask_irq()
316 low32 = iosapic_intr_info[irq].low32 &= ~IOSAPIC_MASK; in unmask_irq()
317 list_for_each_entry(rte, &iosapic_intr_info[irq].rtes, rte_list) { in unmask_irq()
329 unsigned int irq = data->irq; in iosapic_set_affinity() local
332 int redir = (irq & IA64_IRQ_REDIRECTED) ? 1 : 0; in iosapic_set_affinity()
336 irq &= (~IA64_IRQ_REDIRECTED); in iosapic_set_affinity()
342 if (irq_prepare_move(irq, cpu)) in iosapic_set_affinity()
347 if (!iosapic_intr_info[irq].count) in iosapic_set_affinity()
350 set_irq_affinity_info(irq, dest, redir); in iosapic_set_affinity()
355 low32 = iosapic_intr_info[irq].low32 & ~(7 << IOSAPIC_DELIVERY_SHIFT); in iosapic_set_affinity()
363 low32 |= irq_to_vector(irq); in iosapic_set_affinity()
365 iosapic_intr_info[irq].low32 = low32; in iosapic_set_affinity()
366 iosapic_intr_info[irq].dest = dest; in iosapic_set_affinity()
367 list_for_each_entry(rte, &iosapic_intr_info[irq].rtes, rte_list) { in iosapic_set_affinity()
392 unsigned int irq = data->irq; in iosapic_unmask_level_irq() local
393 ia64_vector vec = irq_to_vector(irq); in iosapic_unmask_level_irq()
397 irq_complete_move(irq); in iosapic_unmask_level_irq()
404 list_for_each_entry(rte, &iosapic_intr_info[irq].rtes, rte_list) in iosapic_unmask_level_irq()
449 irq_complete_move(data->irq); in iosapic_ack_edge_irq()
485 int i, irq = -ENOSPC, min_count = -1; in iosapic_find_sharable_irq() local
502 irq = i; in iosapic_find_sharable_irq()
507 return irq; in iosapic_find_sharable_irq()
515 iosapic_reassign_vector (int irq) in iosapic_reassign_vector() argument
519 if (iosapic_intr_info[irq].count) { in iosapic_reassign_vector()
524 irq_to_vector(irq), irq_to_vector(new_irq)); in iosapic_reassign_vector()
525 memcpy(&iosapic_intr_info[new_irq], &iosapic_intr_info[irq], in iosapic_reassign_vector()
528 list_move(iosapic_intr_info[irq].rtes.next, in iosapic_reassign_vector()
530 memset(&iosapic_intr_info[irq], 0, in iosapic_reassign_vector()
532 iosapic_intr_info[irq].low32 = IOSAPIC_MASK; in iosapic_reassign_vector()
533 INIT_LIST_HEAD(&iosapic_intr_info[irq].rtes); in iosapic_reassign_vector()
537 static inline int irq_is_shared (int irq) in irq_is_shared() argument
539 return (iosapic_intr_info[irq].count > 1); in irq_is_shared()
552 register_intr (unsigned int gsi, int irq, unsigned char delivery, in register_intr() argument
566 rte = find_rte(irq, gsi); in register_intr()
578 list_add_tail(&rte->rte_list, &iosapic_intr_info[irq].rtes); in register_intr()
579 iosapic_intr_info[irq].count++; in register_intr()
583 struct iosapic_intr_info *info = &iosapic_intr_info[irq]; in register_intr()
592 iosapic_intr_info[irq].count++; in register_intr()
596 iosapic_intr_info[irq].polarity = polarity; in register_intr()
597 iosapic_intr_info[irq].dmode = delivery; in register_intr()
598 iosapic_intr_info[irq].trigger = trigger; in register_intr()
602 chip = irq_get_chip(irq); in register_intr()
607 __func__, irq_to_vector(irq), in register_intr()
611 irq_set_chip_handler_name_locked(irq_get_irq_data(irq), chip, in register_intr()
618 get_target_cpu (unsigned int gsi, int irq) in get_target_cpu() argument
623 cpumask_t domain = irq_to_domain(irq); in get_target_cpu()
629 if (iosapic_intr_info[irq].count) in get_target_cpu()
630 return iosapic_intr_info[irq].dest; in get_target_cpu()
646 if (cpe_vector > 0 && irq_to_vector(irq) == IA64_CPEP_VECTOR) in get_target_cpu()
670 cpu_index = irq % num_cpus; in get_target_cpu()
715 int irq, mask = 1, err; in iosapic_register_intr() local
729 irq = __gsi_to_irq(gsi); in iosapic_register_intr()
730 if (irq > 0) { in iosapic_register_intr()
731 rte = find_rte(irq, gsi); in iosapic_register_intr()
732 if(iosapic_intr_info[irq].count == 0) { in iosapic_register_intr()
733 assign_irq_vector(irq); in iosapic_register_intr()
734 irq_init_desc(irq); in iosapic_register_intr()
740 irq = create_irq(); in iosapic_register_intr()
743 if (irq < 0) { in iosapic_register_intr()
744 irq = iosapic_find_sharable_irq(trigger, polarity); in iosapic_register_intr()
745 if (irq < 0) in iosapic_register_intr()
749 desc = irq_to_desc(irq); in iosapic_register_intr()
751 dest = get_target_cpu(gsi, irq); in iosapic_register_intr()
753 err = register_intr(gsi, irq, dmode, polarity, trigger); in iosapic_register_intr()
756 irq = err; in iosapic_register_intr()
764 low32 = iosapic_intr_info[irq].low32; in iosapic_register_intr()
765 if (irq_is_shared(irq) && !(low32 & IOSAPIC_MASK)) in iosapic_register_intr()
767 set_rte(gsi, irq, dest, mask); in iosapic_register_intr()
772 cpu_logical_id(dest), dest, irq_to_vector(irq)); in iosapic_register_intr()
777 return irq; in iosapic_register_intr()
784 int irq, index; in iosapic_unregister_intr() local
795 irq = gsi_to_irq(gsi); in iosapic_unregister_intr()
796 if (irq < 0) { in iosapic_unregister_intr()
804 if ((rte = find_rte(irq, gsi)) == NULL) { in iosapic_unregister_intr()
817 low32 = iosapic_intr_info[irq].low32 | IOSAPIC_MASK; in iosapic_unregister_intr()
820 iosapic_intr_info[irq].count--; in iosapic_unregister_intr()
825 trigger = iosapic_intr_info[irq].trigger; in iosapic_unregister_intr()
826 polarity = iosapic_intr_info[irq].polarity; in iosapic_unregister_intr()
827 dest = iosapic_intr_info[irq].dest; in iosapic_unregister_intr()
832 cpu_logical_id(dest), dest, irq_to_vector(irq)); in iosapic_unregister_intr()
834 if (iosapic_intr_info[irq].count == 0) { in iosapic_unregister_intr()
837 irq_data_update_affinity(irq_get_irq_data(irq), cpu_all_mask); in iosapic_unregister_intr()
840 iosapic_intr_info[irq].dest = 0; in iosapic_unregister_intr()
841 iosapic_intr_info[irq].dmode = 0; in iosapic_unregister_intr()
842 iosapic_intr_info[irq].polarity = 0; in iosapic_unregister_intr()
843 iosapic_intr_info[irq].trigger = 0; in iosapic_unregister_intr()
844 iosapic_intr_info[irq].low32 |= IOSAPIC_MASK; in iosapic_unregister_intr()
847 destroy_and_reserve_irq(irq); in iosapic_unregister_intr()
863 int irq, vector, mask = 0; in iosapic_register_platform_intr() local
868 irq = vector = iosapic_vector; in iosapic_register_platform_intr()
869 bind_irq_vector(irq, vector, CPU_MASK_ALL); in iosapic_register_platform_intr()
874 iosapic_reassign_vector(irq); in iosapic_register_platform_intr()
878 irq = create_irq(); in iosapic_register_platform_intr()
879 if (irq < 0) in iosapic_register_platform_intr()
881 vector = irq_to_vector(irq); in iosapic_register_platform_intr()
885 irq = vector = IA64_CPE_VECTOR; in iosapic_register_platform_intr()
886 BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); in iosapic_register_platform_intr()
896 register_intr(gsi, irq, delivery, polarity, trigger); in iosapic_register_platform_intr()
906 set_rte(gsi, irq, dest, mask); in iosapic_register_platform_intr()
916 int vector, irq; in iosapic_override_isa_irq() local
920 irq = vector = isa_irq_to_vector(isa_irq); in iosapic_override_isa_irq()
921 BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); in iosapic_override_isa_irq()
923 register_intr(gsi, irq, dmode, polarity, trigger); in iosapic_override_isa_irq()
930 set_rte(gsi, irq, dest, 1); in iosapic_override_isa_irq()
952 int irq; in iosapic_system_init() local
954 for (irq = 0; irq < NR_IRQS; ++irq) { in iosapic_system_init()
955 iosapic_intr_info[irq].low32 = IOSAPIC_MASK; in iosapic_system_init()
957 INIT_LIST_HEAD(&iosapic_intr_info[irq].rtes); in iosapic_system_init()
959 iosapic_intr_info[irq].count = 0; in iosapic_system_init()
1010 iosapic_delete_rte(unsigned int irq, unsigned int gsi) in iosapic_delete_rte() argument
1014 list_for_each_entry_safe(rte, temp, &iosapic_intr_info[irq].rtes, in iosapic_delete_rte()
1088 int i, irq, index, err = 0; in iosapic_remove() local
1107 irq = __gsi_to_irq(i); in iosapic_remove()
1108 if (irq < 0) in iosapic_remove()
1111 err = iosapic_delete_rte(irq, i); in iosapic_remove()