irq.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _irq_h
  2. #define _irq_h
  3. #include "cpumask.h"
  4. #include "cpu.h"
  5. struct irq_s {
  6. unsigned int irq; /* IRQ's ID */
  7. char *type; /* IRQ type from /proc/interrupts like PCI-MSI-edge */
  8. char *desc; /* IRQ text description - device list */
  9. int refresh; /* Refresh flag. It !=0 if irq was found while populate */
  10. cpumask_t local_cpus; /* Local CPUs for this IRQs */
  11. cpumask_t affinity; /* Real current affinity form /proc/irq/.../smp_affinity */
  12. unsigned long long intr; /* Current number of interrupts */
  13. unsigned long long old_intr; /* Previous total number of interrupts. */
  14. cpu_t *cpu; /* Current IRQ affinity. Reference to correspondent CPU */
  15. int weight; /* Flag to don't move current IRQ anyway */
  16. int blacklisted; /* IRQ can be blacklisted when can't change affinity */
  17. };
  18. typedef struct irq_s irq_t;
  19. #define SYSFS_PCI_PATH "/sys/bus/pci/devices"
  20. #define PROC_INTERRUPTS "/proc/interrupts"
  21. #define PROC_IRQ "/proc/irq"
  22. /* Compare function for global IRQ list */
  23. int irq_list_compare(const void *first, const void *second);
  24. /* IRQ list functions */
  25. int scan_irqs(lub_list_t *irqs, lub_list_t *balance_irqs);
  26. int irq_list_free(lub_list_t *irqs);
  27. int irq_list_show(lub_list_t *irqs);
  28. irq_t * irq_list_search(lub_list_t *irqs, unsigned int num);
  29. int irq_get_affinity(irq_t *irq);
  30. #endif