diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2007-04-30 12:24:05 -0400 |
---|---|---|
committer | James Bottomley <jejb@hobholes.localdomain> | 2007-04-30 12:24:05 -0400 |
commit | 0293ca814b74e20e77cf719074ee15372204fc55 (patch) | |
tree | 913b53600667aae6511cef28740435001f9dfd56 /arch/i386/mach-voyager | |
parent | de46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff) |
[VOYAGER] add smp_call_function_single
This apparently has msr users now, so add it to the voyager HAL
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'arch/i386/mach-voyager')
-rw-r--r-- | arch/i386/mach-voyager/voyager_smp.c | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 74aeedf277f4..a126baeaa423 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c | |||
@@ -1082,20 +1082,11 @@ smp_call_function_interrupt(void) | |||
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | /* Call this function on all CPUs using the function_interrupt above | 1085 | static int |
1086 | <func> The function to run. This must be fast and non-blocking. | 1086 | __smp_call_function_mask (void (*func) (void *info), void *info, int retry, |
1087 | <info> An arbitrary pointer to pass to the function. | 1087 | int wait, __u32 mask) |
1088 | <retry> If true, keep retrying until ready. | ||
1089 | <wait> If true, wait until function has completed on other CPUs. | ||
1090 | [RETURNS] 0 on success, else a negative status code. Does not return until | ||
1091 | remote CPUs are nearly ready to execute <<func>> or are or have executed. | ||
1092 | */ | ||
1093 | int | ||
1094 | smp_call_function (void (*func) (void *info), void *info, int retry, | ||
1095 | int wait) | ||
1096 | { | 1088 | { |
1097 | struct call_data_struct data; | 1089 | struct call_data_struct data; |
1098 | __u32 mask = cpus_addr(cpu_online_map)[0]; | ||
1099 | 1090 | ||
1100 | mask &= ~(1<<smp_processor_id()); | 1091 | mask &= ~(1<<smp_processor_id()); |
1101 | 1092 | ||
@@ -1116,7 +1107,7 @@ smp_call_function (void (*func) (void *info), void *info, int retry, | |||
1116 | call_data = &data; | 1107 | call_data = &data; |
1117 | wmb(); | 1108 | wmb(); |
1118 | /* Send a message to all other CPUs and wait for them to respond */ | 1109 | /* Send a message to all other CPUs and wait for them to respond */ |
1119 | send_CPI_allbutself(VIC_CALL_FUNCTION_CPI); | 1110 | send_CPI(mask, VIC_CALL_FUNCTION_CPI); |
1120 | 1111 | ||
1121 | /* Wait for response */ | 1112 | /* Wait for response */ |
1122 | while (data.started) | 1113 | while (data.started) |
@@ -1130,8 +1121,48 @@ smp_call_function (void (*func) (void *info), void *info, int retry, | |||
1130 | 1121 | ||
1131 | return 0; | 1122 | return 0; |
1132 | } | 1123 | } |
1124 | |||
1125 | /* Call this function on all CPUs using the function_interrupt above | ||
1126 | <func> The function to run. This must be fast and non-blocking. | ||
1127 | <info> An arbitrary pointer to pass to the function. | ||
1128 | <retry> If true, keep retrying until ready. | ||
1129 | <wait> If true, wait until function has completed on other CPUs. | ||
1130 | [RETURNS] 0 on success, else a negative status code. Does not return until | ||
1131 | remote CPUs are nearly ready to execute <<func>> or are or have executed. | ||
1132 | */ | ||
1133 | int | ||
1134 | smp_call_function(void (*func) (void *info), void *info, int retry, | ||
1135 | int wait) | ||
1136 | { | ||
1137 | __u32 mask = cpus_addr(cpu_online_map)[0]; | ||
1138 | |||
1139 | return __smp_call_function_mask(func, info, retry, wait, mask); | ||
1140 | } | ||
1133 | EXPORT_SYMBOL(smp_call_function); | 1141 | EXPORT_SYMBOL(smp_call_function); |
1134 | 1142 | ||
1143 | /* | ||
1144 | * smp_call_function_single - Run a function on another CPU | ||
1145 | * @func: The function to run. This must be fast and non-blocking. | ||
1146 | * @info: An arbitrary pointer to pass to the function. | ||
1147 | * @nonatomic: Currently unused. | ||
1148 | * @wait: If true, wait until function has completed on other CPUs. | ||
1149 | * | ||
1150 | * Retrurns 0 on success, else a negative status code. | ||
1151 | * | ||
1152 | * Does not return until the remote CPU is nearly ready to execute <func> | ||
1153 | * or is or has executed. | ||
1154 | */ | ||
1155 | |||
1156 | int | ||
1157 | smp_call_function_single(int cpu, void (*func) (void *info), void *info, | ||
1158 | int nonatomic, int wait) | ||
1159 | { | ||
1160 | __u32 mask = 1 << cpu; | ||
1161 | |||
1162 | return __smp_call_function_mask(func, info, nonatomic, wait, mask); | ||
1163 | } | ||
1164 | EXPORT_SYMBOL(smp_call_function_single); | ||
1165 | |||
1135 | /* Sorry about the name. In an APIC based system, the APICs | 1166 | /* Sorry about the name. In an APIC based system, the APICs |
1136 | * themselves are programmed to send a timer interrupt. This is used | 1167 | * themselves are programmed to send a timer interrupt. This is used |
1137 | * by linux to reschedule the processor. Voyager doesn't have this, | 1168 | * by linux to reschedule the processor. Voyager doesn't have this, |