aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-10-03 08:40:26 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:35 -0400
commit57468af3267bfb89391f9c607a9637e86e55d299 (patch)
tree3a52d3238fea2dd4cd887ff626e4b45d81c9b843 /arch
parentf8bb3af924211b0e6ee66dc0d3bcb4a66ba59af4 (diff)
Define and initialize kdb_lock using DEFINE_SPINLOCK.
Convert kgdb_cpulock into a raw_spinlock_t. SPIN_LOCK_UNLOCKED is deprecated and it's replacement DEFINE_SPINLOCK is not suitable for arrays of spinlocks. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kernel/gdb-stub.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index 3af94207f2bc..96d18c43dca0 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -176,8 +176,10 @@ int kgdb_enabled;
176/* 176/*
177 * spin locks for smp case 177 * spin locks for smp case
178 */ 178 */
179static spinlock_t kgdb_lock = SPIN_LOCK_UNLOCKED; 179static DEFINE_SPINLOCK(kgdb_lock);
180static spinlock_t kgdb_cpulock[NR_CPUS] = { [0 ... NR_CPUS-1] = SPIN_LOCK_UNLOCKED}; 180static raw_spinlock_t kgdb_cpulock[NR_CPUS] = {
181 [0 ... NR_CPUS-1] = __RAW_SPIN_LOCK_UNLOCKED;
182};
181 183
182/* 184/*
183 * BUFMAX defines the maximum number of characters in inbound/outbound buffers 185 * BUFMAX defines the maximum number of characters in inbound/outbound buffers
@@ -661,8 +663,8 @@ static void kgdb_wait(void *arg)
661 663
662 local_irq_save(flags); 664 local_irq_save(flags);
663 665
664 spin_lock(&kgdb_cpulock[cpu]); 666 __raw_spin_lock(&kgdb_cpulock[cpu]);
665 spin_unlock(&kgdb_cpulock[cpu]); 667 __raw_spin_unlock(&kgdb_cpulock[cpu]);
666 668
667 local_irq_restore(flags); 669 local_irq_restore(flags);
668} 670}
@@ -710,7 +712,7 @@ void handle_exception (struct gdb_regs *regs)
710 * acquire the CPU spinlocks 712 * acquire the CPU spinlocks
711 */ 713 */
712 for (i = num_online_cpus()-1; i >= 0; i--) 714 for (i = num_online_cpus()-1; i >= 0; i--)
713 if (spin_trylock(&kgdb_cpulock[i]) == 0) 715 if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0)
714 panic("kgdb: couldn't get cpulock %d\n", i); 716 panic("kgdb: couldn't get cpulock %d\n", i);
715 717
716 /* 718 /*
@@ -985,7 +987,7 @@ finish_kgdb:
985exit_kgdb_exception: 987exit_kgdb_exception:
986 /* release locks so other CPUs can go */ 988 /* release locks so other CPUs can go */
987 for (i = num_online_cpus()-1; i >= 0; i--) 989 for (i = num_online_cpus()-1; i >= 0; i--)
988 spin_unlock(&kgdb_cpulock[i]); 990 __raw_spin_unlock(&kgdb_cpulock[i]);
989 spin_unlock(&kgdb_lock); 991 spin_unlock(&kgdb_lock);
990 992
991 __flush_cache_all(); 993 __flush_cache_all();