msi_bitmap.h 1008 B

1234567891011121314151617181920212223242526272829303132333435
  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. };
  20. int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
  21. void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
  22. unsigned int num);
  23. void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
  24. int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
  25. int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
  26. struct device_node *of_node);
  27. void msi_bitmap_free(struct msi_bitmap *bmp);
  28. #endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */