diff options
author | Milton Miller <miltonm@bga.com> | 2008-10-09 21:56:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-13 01:24:16 -0400 |
commit | d13f7208b211dd3613bdb04e2647081a5160d68f (patch) | |
tree | 10ee3124943a30157f5598deb5bb800cc2db15d8 /arch/powerpc/platforms/pseries/smp.c | |
parent | 78b5b626fa9048337530cc3ba4ceb9e4ee96a386 (diff) |
powerpc/xics: Consolidate ipi message encode and decode
xics supports only one ipi per cpu, and expects software to use some
queue to know why the interrupt was sent. In Linux, we use a an array
of bitmaps indexed by cpu to identify the message. Currently the bits
are set in smp.c and decoded in xics.c, with the data structure in a
header file. Consolidate the code in xics.c similar to mpic and other
interrupt controllers.
Also, while making the the array static, the message word doesn't need
to be volatile as set_bit and test_clear_bit take care of it for us, and
put it under ifdef smp.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/smp.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/smp.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 9d8f8c84ab89..e00f96baa381 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <asm/paca.h> | 37 | #include <asm/paca.h> |
38 | #include <asm/time.h> | 38 | #include <asm/time.h> |
39 | #include <asm/machdep.h> | 39 | #include <asm/machdep.h> |
40 | #include "xics.h" | ||
41 | #include <asm/cputable.h> | 40 | #include <asm/cputable.h> |
42 | #include <asm/firmware.h> | 41 | #include <asm/firmware.h> |
43 | #include <asm/system.h> | 42 | #include <asm/system.h> |
@@ -49,6 +48,7 @@ | |||
49 | 48 | ||
50 | #include "plpar_wrappers.h" | 49 | #include "plpar_wrappers.h" |
51 | #include "pseries.h" | 50 | #include "pseries.h" |
51 | #include "xics.h" | ||
52 | 52 | ||
53 | 53 | ||
54 | /* | 54 | /* |
@@ -105,36 +105,6 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | #ifdef CONFIG_XICS | 107 | #ifdef CONFIG_XICS |
108 | static inline void smp_xics_do_message(int cpu, int msg) | ||
109 | { | ||
110 | set_bit(msg, &xics_ipi_message[cpu].value); | ||
111 | mb(); | ||
112 | xics_cause_IPI(cpu); | ||
113 | } | ||
114 | |||
115 | static void smp_xics_message_pass(int target, int msg) | ||
116 | { | ||
117 | unsigned int i; | ||
118 | |||
119 | if (target < NR_CPUS) { | ||
120 | smp_xics_do_message(target, msg); | ||
121 | } else { | ||
122 | for_each_online_cpu(i) { | ||
123 | if (target == MSG_ALL_BUT_SELF | ||
124 | && i == smp_processor_id()) | ||
125 | continue; | ||
126 | smp_xics_do_message(i, msg); | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | |||
131 | static int __init smp_xics_probe(void) | ||
132 | { | ||
133 | xics_request_IPIs(); | ||
134 | |||
135 | return cpus_weight(cpu_possible_map); | ||
136 | } | ||
137 | |||
138 | static void __devinit smp_xics_setup_cpu(int cpu) | 108 | static void __devinit smp_xics_setup_cpu(int cpu) |
139 | { | 109 | { |
140 | if (cpu != boot_cpuid) | 110 | if (cpu != boot_cpuid) |