aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-11-17 12:09:34 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-11-23 07:01:47 -0500
commit926ff9ad76e097011030feaee904395e06eea17a (patch)
tree759cafbd9a80ad87081f6ea5351b880e1bb34745
parentf3cf8bb0d6c3c11ddedf01f02f856f2ae8c33aa4 (diff)
asm-generic: Add msi.h
To support MSI irq domains we want a generic data structure for allocation, but we need the option to provide an architecture specific version of it. So instead of playing #ifdef games in linux/msi.h we add a generic header file and let architectures decide whether to include it or to provide their own implementation and provide the required typedef. I know that typedefs are not really nice, but in this case there are no forward declarations required and it's the simplest solution. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: linux-arm-kernel@lists.infradead.org Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Yijing Wang <wangyijing@huawei.com> Cc: Yingjoe Chen <yingjoe.chen@mediatek.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Alexander Gordeev <agordeev@redhat.com>
-rw-r--r--include/asm-generic/msi.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/asm-generic/msi.h b/include/asm-generic/msi.h
new file mode 100644
index 000000000000..61c58d8878ce
--- /dev/null
+++ b/include/asm-generic/msi.h
@@ -0,0 +1,32 @@
1#ifndef __ASM_GENERIC_MSI_H
2#define __ASM_GENERIC_MSI_H
3
4#include <linux/types.h>
5
6#ifndef NUM_MSI_ALLOC_SCRATCHPAD_REGS
7# define NUM_MSI_ALLOC_SCRATCHPAD_REGS 2
8#endif
9
10struct msi_desc;
11
12/**
13 * struct msi_alloc_info - Default structure for MSI interrupt allocation.
14 * @desc: Pointer to msi descriptor
15 * @hwirq: Associated hw interrupt number in the domain
16 * @scratchpad: Storage for implementation specific scratch data
17 *
18 * Architectures can provide their own implementation by not including
19 * asm-generic/msi.h into their arch specific header file.
20 */
21typedef struct msi_alloc_info {
22 struct msi_desc *desc;
23 irq_hw_number_t hwirq;
24 union {
25 unsigned long ul;
26 void *ptr;
27 } scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS];
28} msi_alloc_info_t;
29
30#define GENERIC_MSI_DOMAIN_OPS 1
31
32#endif