summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/ptrace_64.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-14 19:35:00 +0000
committerPaul Mundt <lethal@linux-sh.org>2010-09-16 16:37:56 +0900
commitd71415e88447f31ec63026e69b64a7e99465b7f4 (patch)
tree426a7a163380328c051aa36544b9add771720054 /arch/sh/kernel/ptrace_64.c
parent5d75b3a2476d848a354d939d2b89c36d3394ac59 (diff)
downloadop-kernel-dev-d71415e88447f31ec63026e69b64a7e99465b7f4.zip
op-kernel-dev-d71415e88447f31ec63026e69b64a7e99465b7f4.tar.gz
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/kernel/ptrace_64.c')
-rw-r--r--arch/sh/kernel/ptrace_64.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index b978170..e0fb065 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -20,7 +20,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
+#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
@@ -474,10 +474,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
{
#define WPC_DBRMODE 0x0d104008
- static int first_call = 1;
+ static unsigned long first_call;
- lock_kernel();
- if (first_call) {
+ if (!test_and_set_bit(0, &first_call)) {
/* Set WPC.DBRMODE to 0. This makes all debug events get
* delivered through RESVEC, i.e. into the handlers in entry.S.
* (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)
* the remote gdb.) */
printk("DBRMODE set to 0 to permit native debugging\n");
poke_real_address_q(WPC_DBRMODE, 0);
- first_call = 0;
}
- unlock_kernel();
return sys_ptrace(request, pid, addr, data);
}
OpenPOWER on IntegriCloud