patch-2.2.18 linux/arch/s390/kernel/smp.c

Next file: linux/arch/s390/kernel/traps.c
Previous file: linux/arch/s390/kernel/signal.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/arch/s390/kernel/smp.c linux/arch/s390/kernel/smp.c
@@ -108,7 +108,7 @@
         if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0) 
                 cpcmd(vmhalt_cmd, NULL, 0);
         signal_processor(smp_processor_id(), sigp_stop_and_store_status);
-        }
+}
 
 void machine_halt(void)
 {
@@ -125,7 +125,7 @@
         if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0)
                 cpcmd(vmpoff_cmd, NULL, 0);
         signal_processor(smp_processor_id(), sigp_stop_and_store_status);
-        }
+}
 
 void machine_power_off(void)
 {
@@ -248,6 +248,14 @@
 			__flush_tlb();
 			atomic_set(&ec->status, ec_done);
 		        return;
+                case ec_callback: {
+                        ec_callback_parms *cbp;
+                        cbp = (ec_callback_parms *) ec->parms;
+                        atomic_set(&ec->status,ec_executing);
+                        (cbp->callback)(cbp->data);
+                        atomic_set(&ec->status,ec_done);
+                        return;
+                }
                 default:
                 }
                 ec = ec->next;
@@ -463,6 +471,19 @@
         __ctl_clear_bit(cr, bit);
 }
 
+/*
+ * Execute a callback function on all cpus
+ */
+void smp_do_callback_all(void (*callback)(void *), void *data) {
+        ec_callback_parms parms;
+
+        if (atomic_read(&smp_commenced) != 0) {
+                parms.callback = callback;
+                parms.data = data;
+                smp_ext_call_sync_others(ec_callback, &parms);
+        }
+        (callback)(data);
+}
 
 /*
  * Lets check how many CPUs we have.
@@ -573,7 +594,7 @@
         sigp_ccode   ccode;
         int curr_cpu;
         int i;
-        
+
         /* request the 0x1202 external interrupt */
         if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0)
                 panic("Couldn't request external interrupt 0x1202");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)