msi_bitmap.h 867 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _POWERPC_SYSDEV_MSI_BITMAP_H
  3. #define _POWERPC_SYSDEV_MSI_BITMAP_H
  4. /*
  5. * Copyright 2008, Michael Ellerman, IBM Corporation.
  6. */
  7. #include <linux/of.h>
  8. #include <asm/irq.h>
  9. struct msi_bitmap {
  10. struct device_node *of_node;
  11. unsigned long *bitmap;
  12. spinlock_t lock;
  13. unsigned int irq_count;
  14. bool bitmap_from_slab;
  15. };
  16. int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
  17. void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
  18. unsigned int num);
  19. void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
  20. int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
  21. int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
  22. struct device_node *of_node);
  23. void msi_bitmap_free(struct msi_bitmap *bmp);
  24. #endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */