summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch/sh/_atomic_lock.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-09-01 00:32:23 +0000
committerguenther <guenther@openbsd.org>2012-09-01 00:32:23 +0000
commitcde6fc201d55f174c423caf7560c454b29da406e (patch)
tree3c8a6d2fd05c6c6d8d34297c0d9d94bea91bbc5b /lib/libpthread/arch/sh/_atomic_lock.c
parentmodload needs to invoke ld with -nopie now on ELF platforms (diff)
downloadwireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.tar.xz
wireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.zip
So passes uthreads
Like autumn leaves on water don't fear the tedu@
Diffstat (limited to 'lib/libpthread/arch/sh/_atomic_lock.c')
-rw-r--r--lib/libpthread/arch/sh/_atomic_lock.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/libpthread/arch/sh/_atomic_lock.c b/lib/libpthread/arch/sh/_atomic_lock.c
deleted file mode 100644
index 3431e69b3a8..00000000000
--- a/lib/libpthread/arch/sh/_atomic_lock.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $OpenBSD: _atomic_lock.c,v 1.3 2008/06/26 05:42:05 ray Exp $ */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Gregory McGarry.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "spinlock.h"
-
-int
-_atomic_lock(volatile _spinlock_lock_t *lock)
-{
- _spinlock_lock_t old;
-
- __asm volatile(
- " tas.b %0 \n"
- " mov #0, %1 \n"
- " rotcl %1 \n"
- : "=m" (*lock), "=r" (old));
-
- return (old == 0);
-}
-
-int
-_atomic_is_locked(volatile _spinlock_lock_t *lock)
-{
-
- return (*lock != _SPINLOCK_UNLOCKED);
-}