diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-14 15:35:00 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-09-16 03:37:56 -0400 |
commit | d71415e88447f31ec63026e69b64a7e99465b7f4 (patch) | |
tree | 426a7a163380328c051aa36544b9add771720054 /arch/sh | |
parent | 5d75b3a2476d848a354d939d2b89c36d3394ac59 (diff) |
sh: kill big kernel lock
The only BKL user in arch/sh protects a single bit,
so we can trivially replace it with test_and_set_bit.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/ptrace_64.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index b97817016b6a..e0fb065914aa 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
23 | #include <linux/smp_lock.h> | 23 | #include <linux/bitops.h> |
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/ptrace.h> | 25 | #include <linux/ptrace.h> |
26 | #include <linux/user.h> | 26 | #include <linux/user.h> |
@@ -474,10 +474,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
474 | asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | 474 | asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) |
475 | { | 475 | { |
476 | #define WPC_DBRMODE 0x0d104008 | 476 | #define WPC_DBRMODE 0x0d104008 |
477 | static int first_call = 1; | 477 | static unsigned long first_call; |
478 | 478 | ||
479 | lock_kernel(); | 479 | if (!test_and_set_bit(0, &first_call)) { |
480 | if (first_call) { | ||
481 | /* Set WPC.DBRMODE to 0. This makes all debug events get | 480 | /* Set WPC.DBRMODE to 0. This makes all debug events get |
482 | * delivered through RESVEC, i.e. into the handlers in entry.S. | 481 | * delivered through RESVEC, i.e. into the handlers in entry.S. |
483 | * (If the kernel was downloaded using a remote gdb, WPC.DBRMODE | 482 | * (If the kernel was downloaded using a remote gdb, WPC.DBRMODE |
@@ -487,9 +486,7 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | |||
487 | * the remote gdb.) */ | 486 | * the remote gdb.) */ |
488 | printk("DBRMODE set to 0 to permit native debugging\n"); | 487 | printk("DBRMODE set to 0 to permit native debugging\n"); |
489 | poke_real_address_q(WPC_DBRMODE, 0); | 488 | poke_real_address_q(WPC_DBRMODE, 0); |
490 | first_call = 0; | ||
491 | } | 489 | } |
492 | unlock_kernel(); | ||
493 | 490 | ||
494 | return sys_ptrace(request, pid, addr, data); | 491 | return sys_ptrace(request, pid, addr, data); |
495 | } | 492 | } |