This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / i386 / kernel / smp.c
index 131ed47..5c4f178 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <asm/mtrr.h>
 #include <asm/tlbflush.h>
-#include <asm/desc.h>
 #include <mach_apic.h>
 
 /*
@@ -139,15 +138,12 @@ void __send_IPI_shortcut(unsigned int shortcut, int vector)
         */
        apic_wait_icr_idle();
 
-       if (vector == CRASH_DUMP_VECTOR)
-               cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
-
        /*
         * No need to touch the target chip field
         */
        cfg = __prepare_ICR(shortcut, vector);
 
-       if (vector == CRASH_DUMP_VECTOR) {
+       if (vector == DUMP_VECTOR) {
                /*
                 * Setup DUMP IPI to be delivered as an NMI
                 */
@@ -232,7 +228,7 @@ inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
                         */
                        cfg = __prepare_ICR(0, vector);
                
-                       if (vector == CRASH_DUMP_VECTOR) {
+                       if (vector == DUMP_VECTOR) {
                                /*
                                 * Setup DUMP IPI to be delivered as an NMI
                                 */
@@ -326,13 +322,11 @@ static inline void leave_mm (unsigned long cpu)
  * 2) Leave the mm if we are in the lazy tlb mode.
  */
 
-fastcall void smp_invalidate_interrupt(struct pt_regs *regs)
+asmlinkage void smp_invalidate_interrupt (void)
 {
        unsigned long cpu;
 
        cpu = get_cpu();
-       if (current->active_mm)
-               load_user_cs_desc(cpu, current->active_mm);
 
        if (!cpu_isset(cpu, flush_cpumask))
                goto out;
@@ -489,7 +483,7 @@ void flush_tlb_all(void)
 
 void dump_send_ipi(void)
 {
-       send_IPI_allbutself(CRASH_DUMP_VECTOR);
+       send_IPI_allbutself(DUMP_VECTOR);
 }
 
 /*
@@ -502,11 +496,6 @@ void smp_send_reschedule(int cpu)
        send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
 }
 
-void crash_dump_send_ipi(void)
-{
-       send_IPI_allbutself(CRASH_DUMP_VECTOR);
-}
-
 /*
  * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
@@ -535,10 +524,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
  * <func> The function to run. This must be fast and non-blocking.
  * <info> An arbitrary pointer to pass to the function.
  * <nonatomic> currently unused.
- * <wait> If 1, wait (atomically) until function has completed on other CPUs.
- *        If 0, wait for the IPI to be received by other CPUs, but do not wait 
- *        for the completion of the function on each CPU.  
- *        If -1, do not wait for other CPUs to receive IPI.
+ * <wait> If true, wait (atomically) until function has completed on other CPUs.
  * [RETURNS] 0 on success, else a negative status code. Does not return until
  * remote CPUs are nearly ready to execute <<func>> or are or have executed.
  *
@@ -546,50 +532,36 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
  * hardware interrupt handler or from a bottom half handler.
  */
 {
-       static struct call_data_struct dumpdata;
-       struct call_data_struct normaldata;
-       struct call_data_struct *data;
+       struct call_data_struct data;
        int cpus = num_online_cpus()-1;
 
        if (!cpus)
                return 0;
 
        /* Can deadlock when called with interrupts disabled */
-       /* Only if we are waiting for other CPU to ack */
-       WARN_ON(irqs_disabled() && wait >= 0);
+       WARN_ON(irqs_disabled());
+
+       data.func = func;
+       data.info = info;
+       atomic_set(&data.started, 0);
+       data.wait = wait;
+       if (wait)
+               atomic_set(&data.finished, 0);
 
        spin_lock(&call_lock);
-       if (wait == -1) {
-               /* if another cpu beat us, they win! */
-               if (dumpdata.func) {
-                       spin_unlock(&call_lock);
-                       return 0;
-               }
-               data = &dumpdata;
-       } else
-               data = &normaldata;
-
-       data->func = func;
-       data->info = info;
-       atomic_set(&data->started, 0);
-       data->wait = wait > 0 ? wait : 0;
-       if (wait > 0)
-               atomic_set(&data->finished, 0);
-
-       call_data = data;
+       call_data = &data;
        mb();
        
        /* Send a message to all other CPUs and wait for them to respond */
        send_IPI_allbutself(CALL_FUNCTION_VECTOR);
 
        /* Wait for response */
-       if (wait >= 0)
-               while (atomic_read(&data->started) != cpus)
-                       cpu_relax();
+       while (atomic_read(&data.started) != cpus)
+               barrier();
 
-       if (wait > 0)
-               while (atomic_read(&data->finished) != cpus)
-                       cpu_relax();
+       if (wait)
+               while (atomic_read(&data.finished) != cpus)
+                       barrier();
        spin_unlock(&call_lock);
 
        return 0;
@@ -628,12 +600,12 @@ EXPORT_SYMBOL(smp_send_stop);
  * all the work is done automatically when
  * we return from the interrupt.
  */
-fastcall void smp_reschedule_interrupt(struct pt_regs *regs)
+asmlinkage void smp_reschedule_interrupt(void)
 {
        ack_APIC_irq();
 }
 
-fastcall void smp_call_function_interrupt(struct pt_regs *regs)
+asmlinkage void smp_call_function_interrupt(void)
 {
        void (*func) (void *info) = call_data->func;
        void *info = call_data->info;