1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _IA64_MSI_DEF_H
3 #define _IA64_MSI_DEF_H
4 
5 /*
6  * Shifts for APIC-based data
7  */
8 
9 #define     MSI_DATA_VECTOR_SHIFT	0
10 #define	    MSI_DATA_VECTOR(v)		(((u8)v) << MSI_DATA_VECTOR_SHIFT)
11 #define     MSI_DATA_VECTOR_MASK	0xffffff00
12 
13 #define     MSI_DATA_DELIVERY_MODE_SHIFT	8
14 #define     MSI_DATA_DELIVERY_FIXED	(0 << MSI_DATA_DELIVERY_MODE_SHIFT)
15 #define     MSI_DATA_DELIVERY_LOWPRI	(1 << MSI_DATA_DELIVERY_MODE_SHIFT)
16 
17 #define     MSI_DATA_LEVEL_SHIFT	14
18 #define     MSI_DATA_LEVEL_DEASSERT	(0 << MSI_DATA_LEVEL_SHIFT)
19 #define     MSI_DATA_LEVEL_ASSERT	(1 << MSI_DATA_LEVEL_SHIFT)
20 
21 #define     MSI_DATA_TRIGGER_SHIFT	15
22 #define     MSI_DATA_TRIGGER_EDGE	(0 << MSI_DATA_TRIGGER_SHIFT)
23 #define     MSI_DATA_TRIGGER_LEVEL	(1 << MSI_DATA_TRIGGER_SHIFT)
24 
25 /*
26  * Shift/mask fields for APIC-based bus address
27  */
28 
29 #define     MSI_ADDR_DEST_ID_SHIFT	4
30 #define     MSI_ADDR_HEADER		0xfee00000
31 
32 #define     MSI_ADDR_DEST_ID_MASK	0xfff0000f
33 #define     MSI_ADDR_DEST_ID_CPU(cpu)	((cpu) << MSI_ADDR_DEST_ID_SHIFT)
34 
35 #define     MSI_ADDR_DEST_MODE_SHIFT	2
36 #define     MSI_ADDR_DEST_MODE_PHYS	(0 << MSI_ADDR_DEST_MODE_SHIFT)
37 #define	    MSI_ADDR_DEST_MODE_LOGIC	(1 << MSI_ADDR_DEST_MODE_SHIFT)
38 
39 #define     MSI_ADDR_REDIRECTION_SHIFT	3
40 #define     MSI_ADDR_REDIRECTION_CPU	(0 << MSI_ADDR_REDIRECTION_SHIFT)
41 #define     MSI_ADDR_REDIRECTION_LOWPRI	(1 << MSI_ADDR_REDIRECTION_SHIFT)
42 
43 #endif/* _IA64_MSI_DEF_H */
44