irq-partition-percpu.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2016 ARM Limited, All Rights Reserved.
  4. * Author: Marc Zyngier <[email protected]>
  5. */
  6. #ifndef __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
  7. #define __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
  8. #include <linux/fwnode.h>
  9. #include <linux/cpumask.h>
  10. #include <linux/irqdomain.h>
  11. struct partition_affinity {
  12. cpumask_t mask;
  13. void *partition_id;
  14. };
  15. struct partition_desc;
  16. #ifdef CONFIG_PARTITION_PERCPU
  17. int partition_translate_id(struct partition_desc *desc, void *partition_id);
  18. struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
  19. struct partition_affinity *parts,
  20. int nr_parts,
  21. int chained_irq,
  22. const struct irq_domain_ops *ops);
  23. struct irq_domain *partition_get_domain(struct partition_desc *dsc);
  24. #else
  25. static inline int partition_translate_id(struct partition_desc *desc,
  26. void *partition_id)
  27. {
  28. return -EINVAL;
  29. }
  30. static inline
  31. struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
  32. struct partition_affinity *parts,
  33. int nr_parts,
  34. int chained_irq,
  35. const struct irq_domain_ops *ops)
  36. {
  37. return NULL;
  38. }
  39. static inline
  40. struct irq_domain *partition_get_domain(struct partition_desc *dsc)
  41. {
  42. return NULL;
  43. }
  44. #endif
  45. #endif /* __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H */