Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 #ifndef _POWERPC_SYSDEV_MSI_BITMAP_H
0003 #define _POWERPC_SYSDEV_MSI_BITMAP_H
0004 
0005 /*
0006  * Copyright 2008, Michael Ellerman, IBM Corporation.
0007  */
0008 
0009 #include <linux/of.h>
0010 #include <asm/irq.h>
0011 
0012 struct msi_bitmap {
0013     struct device_node  *of_node;
0014     unsigned long       *bitmap;
0015     spinlock_t      lock;
0016     unsigned int        irq_count;
0017     bool            bitmap_from_slab;
0018 };
0019 
0020 int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
0021 void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
0022                 unsigned int num);
0023 void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
0024 
0025 int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
0026 
0027 int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
0028              struct device_node *of_node);
0029 void msi_bitmap_free(struct msi_bitmap *bmp);
0030 
0031 #endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */