summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEd Nash <enash54@gmail.com>2013-07-31 12:11:03 -0400
committerAnthony Felice <tony.felice@timesys.com>2013-10-09 12:56:47 -0400
commit36a372c590f975825e255b66270370981c51c001 (patch)
tree874459b08434dccae2f8a1e9f57b688517ffb924 /arch
parent0cb2d0cc735bd784927a0579d7be9f7abc14e0fe (diff)
add a test call to determine state of semaphore without requesting it
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mvf/mvf_sema4.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-mvf/mvf_sema4.c b/arch/arm/mach-mvf/mvf_sema4.c
index 31e40f6d02f0..4521d124f1b7 100644
--- a/arch/arm/mach-mvf/mvf_sema4.c
+++ b/arch/arm/mach-mvf/mvf_sema4.c
@@ -286,3 +286,13 @@ int mvf_sema4_unlock(MVF_SEMA4 *sema4)
}
EXPORT_SYMBOL(mvf_sema4_unlock);
+// return 0 on success (meaning it is set to us)
+int mvf_sema4_test(MVF_SEMA4 *sema4)
+{
+ if(!sema4)
+ return -EINVAL;
+
+ return (readb(MVF_IO_ADDRESS(MVF_SEMA4_BASE_ADDR) + sema4->gate_num)) == LOCK_VALUE ? 0 : 1;
+}
+EXPORT_SYMBOL(mvf_sema4_test);
+