[PARISC] Move spinlock_t out of struct cpu_data
authorKyle McMartin <kyle@mako.i.cabal.ca>
Fri, 8 Dec 2006 04:52:27 +0000 (23:52 -0500)
committerKyle McMartin <kyle@ubuntu.com>
Fri, 8 Dec 2006 05:34:49 +0000 (00:34 -0500)
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
arch/parisc/kernel/smp.c
include/asm-parisc/processor.h

index 4a23a97b06cd7484a172bce26a2803149abdeabd..5b6bc6e8a42f11d96efd83d7b1782ec0635dbecc 100644 (file)
@@ -76,6 +76,7 @@ cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL;      /* Bitmap of Present CP
 EXPORT_SYMBOL(cpu_online_map);
 EXPORT_SYMBOL(cpu_possible_map);
 
+DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
 
 struct smp_call_struct {
        void (*func) (void *info);
@@ -167,10 +168,11 @@ ipi_interrupt(int irq, void *dev_id)
        mb();   /* Order interrupt and bit testing. */
 
        for (;;) {
-               spin_lock_irqsave(&(p->lock),flags);
+               spinlock_t *lock = &per_cpu(ipi_lock, this_cpu);
+               spin_lock_irqsave(lock, flags);
                ops = p->pending_ipi;
                p->pending_ipi = 0;
-               spin_unlock_irqrestore(&(p->lock),flags);
+               spin_unlock_irqrestore(lock, flags);
 
                mb(); /* Order bit clearing and data access. */
 
@@ -275,12 +277,13 @@ static inline void
 ipi_send(int cpu, enum ipi_message_type op)
 {
        struct cpuinfo_parisc *p = &cpu_data[cpu];
+       spinlock_t *lock = &per_cpu(ipi_lock, cpu);
        unsigned long flags;
 
-       spin_lock_irqsave(&(p->lock),flags);
+       spin_lock_irqsave(lock, flags);
        p->pending_ipi |= 1 << op;
        gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa);
-       spin_unlock_irqrestore(&(p->lock),flags);
+       spin_unlock_irqrestore(lock, flags);
 }
 
 
index fd7866dc8c83462b2d8a3274ac4118b5315de8d2..435afe5a149d31df50f85f44c3582cd535e167a6 100644 (file)
@@ -87,7 +87,6 @@ struct cpuinfo_parisc {
        unsigned long hpa;          /* Host Physical address */
        unsigned long txn_addr;     /* MMIO addr of EIR or id_eid */
 #ifdef CONFIG_SMP
-       spinlock_t lock;            /* synchronization for ipi's */
        unsigned long pending_ipi;  /* bitmap of type ipi_message_type */
        unsigned long ipi_count;    /* number ipi Interrupts */
 #endif