msi_bitmap.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _POWERPC_SYSDEV_MSI_BITMAP_H
  2. #define _POWERPC_SYSDEV_MSI_BITMAP_H
  3. /*
  4. * Copyright 2008, Michael Ellerman, IBM Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; version 2 of the
  9. * License.
  10. *
  11. */
  12. #include <linux/of.h>
  13. #include <asm/irq.h>
  14. struct msi_bitmap {
  15. struct device_node *of_node;
  16. unsigned long *bitmap;
  17. spinlock_t lock;
  18. unsigned int irq_count;
  19. bool bitmap_from_slab;
  20. };
  21. int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
  22. void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
  23. unsigned int num);
  24. void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
  25. int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
  26. int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
  27. struct device_node *of_node);
  28. void msi_bitmap_free(struct msi_bitmap *bmp);
  29. #endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */