Lines Matching defs:irq
10 #include <linux/irq.h>
115 static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node,
124 desc->irq_data.irq = irq;
194 static void irq_insert_desc(unsigned int irq, struct irq_desc *desc)
196 MA_STATE(mas, &sparse_irqs, irq, irq);
200 static void delete_irq_desc(unsigned int irq)
202 MA_STATE(mas, &sparse_irqs, irq, irq);
210 static int init_desc(struct irq_desc *desc, int irq, int node,
228 desc_set_defaults(irq, desc, node, affinity, owner);
380 ATTRIBUTE_GROUPS(irq);
388 static void irq_sysfs_add(int irq, struct irq_desc *desc)
396 if (kobject_add(&desc->kobj, irq_kobj_base, "%d", irq))
397 pr_warn("Failed to add kobject for irq %d\n", irq);
418 int irq;
420 /* Prevent concurrent irq alloc/free */
423 irq_kobj_base = kobject_create_and_add("irq", kernel_kobj);
430 for_each_irq_desc(irq, desc)
431 irq_sysfs_add(irq, desc);
444 static void irq_sysfs_add(int irq, struct irq_desc *desc) {}
449 struct irq_desc *irq_to_desc(unsigned int irq)
451 return mtree_load(&sparse_irqs, irq);
467 static struct irq_desc *alloc_desc(int irq, int node, unsigned int flags,
478 ret = init_desc(desc, irq, node, flags, affinity, owner);
503 static void free_desc(unsigned int irq)
505 struct irq_desc *desc = irq_to_desc(irq);
508 unregister_irq_proc(irq, desc);
520 delete_irq_desc(irq);
650 struct irq_desc *irq_to_desc(unsigned int irq)
652 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
656 static void free_desc(unsigned int irq)
658 struct irq_desc *desc = irq_to_desc(irq);
662 desc_set_defaults(irq, desc, irq_desc_get_node(desc), NULL, NULL);
664 delete_irq_desc(irq);
687 void irq_mark_irq(unsigned int irq)
690 irq_insert_desc(irq, irq_desc + irq);
695 void irq_init_desc(unsigned int irq)
697 free_desc(irq);
719 * generic_handle_irq - Invoke the handler for a particular irq
720 * @irq: The irq number to handle
724 * This function must be called from an IRQ context with irq regs
727 int generic_handle_irq(unsigned int irq)
729 return handle_irq_desc(irq_to_desc(irq));
734 * generic_handle_irq_safe - Invoke the handler for a particular irq from any
736 * @irq: The irq number to handle
741 * will report an error if not invoked from IRQ context and the irq has been
744 int generic_handle_irq_safe(unsigned int irq)
750 ret = handle_irq_desc(irq_to_desc(irq));
758 * generic_handle_domain_irq - Invoke the handler for a HW irq belonging
761 * @hwirq: The HW irq number to convert to a logical one
765 * This function must be called from an IRQ context with irq regs
775 * generic_handle_irq_safe - Invoke the handler for a HW irq belonging
778 * @hwirq: The HW irq number to convert to a logical one
802 * @hwirq: The HW irq number to convert to a logical one
806 * This function must be called from an NMI context with irq regs
819 * irq_free_descs - free irq descriptors
839 * __irq_alloc_descs - allocate and initialize a range of irq descriptors
840 * @irq: Allocate for specific irq number if irq >= 0
841 * @from: Start the search from this irq number
843 * @node: Preferred node on which the irq descriptor should be allocated
846 * hints where the irq descriptors should be allocated and which
849 * Returns the first irq number or error code
852 __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
860 if (irq >= 0) {
861 if (from > irq)
863 from = irq;
877 if (irq >=0 && start != irq)
893 * irq_get_next_irq - get next allocated irq number
896 * Returns next irq number after offset or nr_irqs if none is found.
904 __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
907 struct irq_desc *desc = irq_to_desc(irq);
935 int irq_set_percpu_devid_partition(unsigned int irq,
938 struct irq_desc *desc = irq_to_desc(irq);
950 irq_set_percpu_devid_flags(irq);
954 int irq_set_percpu_devid(unsigned int irq)
956 return irq_set_percpu_devid_partition(irq, NULL);
959 int irq_get_percpu_devid_partition(unsigned int irq, struct cpumask *affinity)
961 struct irq_desc *desc = irq_to_desc(irq);
973 void kstat_incr_irq_this_cpu(unsigned int irq)
975 kstat_incr_irqs_this_cpu(irq_to_desc(irq));
980 * @irq: The interrupt number
984 * @irq. The caller must ensure that the interrupt is not removed
987 unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
989 struct irq_desc *desc = irq_to_desc(irq);
1009 static unsigned int kstat_irqs(unsigned int irq)
1011 struct irq_desc *desc = irq_to_desc(irq);
1023 unsigned int irq;
1025 for_each_irq_desc(irq, desc) {
1032 unsigned int kstat_get_irq_since_snapshot(unsigned int irq)
1034 struct irq_desc *desc = irq_to_desc(irq);
1045 * @irq: The interrupt number
1047 * Returns the sum of interrupt counts on all cpus since boot for @irq.
1053 unsigned int kstat_irqs_usr(unsigned int irq)
1058 sum = kstat_irqs(irq);
1064 void __irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
1067 struct irq_desc *desc = irq_to_desc(irq);