irq-partition-percpu.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2016 ARM Limited, All Rights Reserved.
  3. * Author: Marc Zyngier <marc.zyngier@arm.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include <linux/fwnode.h>
  18. #include <linux/cpumask.h>
  19. #include <linux/irqdomain.h>
  20. struct partition_affinity {
  21. cpumask_t mask;
  22. void *partition_id;
  23. };
  24. struct partition_desc;
  25. #ifdef CONFIG_PARTITION_PERCPU
  26. int partition_translate_id(struct partition_desc *desc, void *partition_id);
  27. struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
  28. struct partition_affinity *parts,
  29. int nr_parts,
  30. int chained_irq,
  31. const struct irq_domain_ops *ops);
  32. struct irq_domain *partition_get_domain(struct partition_desc *dsc);
  33. #else
  34. static inline int partition_translate_id(struct partition_desc *desc,
  35. void *partition_id)
  36. {
  37. return -EINVAL;
  38. }
  39. static inline
  40. struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
  41. struct partition_affinity *parts,
  42. int nr_parts,
  43. int chained_irq,
  44. const struct irq_domain_ops *ops)
  45. {
  46. return NULL;
  47. }
  48. static inline
  49. struct irq_domain *partition_get_domain(struct partition_desc *dsc)
  50. {
  51. return NULL;
  52. }
  53. #endif