summaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel/sys_bfin.c
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2010-03-11 19:24:18 +0300
committerMike Frysinger <vapier@gentoo.org>2010-05-21 17:40:17 +0400
commit2a12c4632db1c0c548a7023e63869b27c7789a92 (patch)
tree518ec2b9379886d5fe7301cf3d5eed959f0452ca /arch/blackfin/kernel/sys_bfin.c
parentbb84dbf69b0730fcc78c275f900ed74b2b8453a5 (diff)
downloadlinux-2a12c4632db1c0c548a7023e63869b27c7789a92.tar.xz
Blackfin: split kernel/traps.c
The current kernel/traps.c file has grown a bit unwieldy as more debugging functionality has been added over time, so split it up into more logical files. There should be no functional changes here, just minor whitespace tweaking. This should make future extensions easier to manage. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/sys_bfin.c')
-rw-r--r--arch/blackfin/kernel/sys_bfin.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index 2e7f8e10bf87..bdc1e2f0da32 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -47,3 +47,26 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr,
}
EXPORT_SYMBOL(get_fb_unmapped_area);
#endif
+
+/* Needed for legacy userspace atomic emulation */
+static DEFINE_SPINLOCK(bfin_spinlock_lock);
+
+#ifdef CONFIG_SYS_BFIN_SPINLOCK_L1
+__attribute__((l1_text))
+#endif
+asmlinkage int sys_bfin_spinlock(int *p)
+{
+ int ret, tmp = 0;
+
+ spin_lock(&bfin_spinlock_lock); /* This would also hold kernel preemption. */
+ ret = get_user(tmp, p);
+ if (likely(ret == 0)) {
+ if (unlikely(tmp))
+ ret = 1;
+ else
+ put_user(1, p);
+ }
+ spin_unlock(&bfin_spinlock_lock);
+
+ return ret;
+}