diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-10-04 05:16:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:28 -0400 |
commit | 589e367f9b9117b3412da0d4e10ea6882db8da84 (patch) | |
tree | 3ad393830c94a146553b459468f0f3a72702b4d6 /include/asm-x86_64 | |
parent | 1ce03373a7f4b5fa8ca5be02ff35229800a6e12b (diff) |
[PATCH] genirq: x86_64 irq: Move msi message composition into io_apic.c
This removes the hardcoded assumption that irq == vector in the msi
composition code, and it allows the msi message composition to setup logical
mode, or lowest priorirty delivery mode as we do for other apic interrupts,
and with the same selection criteria.
Basically this moves the problem of what is in the msi message into the
architecture irq management code where it belongs. Not in a generic layer
that doesn't have enough information to compose msi messages properly.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rajesh Shah <rajesh.shah@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/msi.h | 7 | ||||
-rw-r--r-- | include/asm-x86_64/msidef.h | 47 |
2 files changed, 49 insertions, 5 deletions
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h index 3ad2346624b2..1876fda52ae3 100644 --- a/include/asm-x86_64/msi.h +++ b/include/asm-x86_64/msi.h | |||
@@ -10,14 +10,11 @@ | |||
10 | #include <asm/mach_apic.h> | 10 | #include <asm/mach_apic.h> |
11 | #include <asm/smp.h> | 11 | #include <asm/smp.h> |
12 | 12 | ||
13 | #define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1) | 13 | extern struct msi_ops arch_msi_ops; |
14 | #define MSI_TARGET_CPU_SHIFT 12 | ||
15 | |||
16 | extern struct msi_ops msi_apic_ops; | ||
17 | 14 | ||
18 | static inline int msi_arch_init(void) | 15 | static inline int msi_arch_init(void) |
19 | { | 16 | { |
20 | msi_register(&msi_apic_ops); | 17 | msi_register(&arch_msi_ops); |
21 | return 0; | 18 | return 0; |
22 | } | 19 | } |
23 | 20 | ||
diff --git a/include/asm-x86_64/msidef.h b/include/asm-x86_64/msidef.h new file mode 100644 index 000000000000..5b8acddb70fb --- /dev/null +++ b/include/asm-x86_64/msidef.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef ASM_MSIDEF_H | ||
2 | #define ASM_MSIDEF_H | ||
3 | |||
4 | /* | ||
5 | * Constants for Intel APIC based MSI messages. | ||
6 | */ | ||
7 | |||
8 | /* | ||
9 | * Shifts for MSI data | ||
10 | */ | ||
11 | |||
12 | #define MSI_DATA_VECTOR_SHIFT 0 | ||
13 | #define MSI_DATA_VECTOR_MASK 0x000000ff | ||
14 | #define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & MSI_DATA_VECTOR_MASK) | ||
15 | |||
16 | #define MSI_DATA_DELIVERY_MODE_SHIFT 8 | ||
17 | #define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT) | ||
18 | #define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT) | ||
19 | |||
20 | #define MSI_DATA_LEVEL_SHIFT 14 | ||
21 | #define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) | ||
22 | #define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) | ||
23 | |||
24 | #define MSI_DATA_TRIGGER_SHIFT 15 | ||
25 | #define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) | ||
26 | #define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) | ||
27 | |||
28 | /* | ||
29 | * Shift/mask fields for msi address | ||
30 | */ | ||
31 | |||
32 | #define MSI_ADDR_BASE_HI 0 | ||
33 | #define MSI_ADDR_BASE_LO 0xfee00000 | ||
34 | |||
35 | #define MSI_ADDR_DEST_MODE_SHIFT 2 | ||
36 | #define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT) | ||
37 | #define MSI_ADDR_DEST_MODE_LOGICAL (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) /* dedicated cpu */ | ||
41 | #define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) /* lowest priority */ | ||
42 | |||
43 | #define MSI_ADDR_DEST_ID_SHIFT 12 | ||
44 | #define MSI_ADDR_DEST_ID_MASK 0x00ffff0 | ||
45 | #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK) | ||
46 | |||
47 | #endif /* ASM_MSIDEF_H */ | ||