aboutsummaryrefslogtreecommitdiffstats
path: root/arch/metag/include/asm/spinlock_lock1.h
diff options
context:
space:
mode:
authorJames Hogan <jhogan@kernel.org>2017-10-24 13:07:54 +0100
committerJames Hogan <jhogan@kernel.org>2018-02-22 11:07:21 +0000
commitbb6fb6dfcc17cddac11ac295861f7608194447a7 (patch)
tree47ee071a415546dd01adbf628f61acb80473d476 /arch/metag/include/asm/spinlock_lock1.h
parentLinux 4.16-rc2 (diff)
downloadlinux-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.tar.xz
linux-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.zip
metag: Remove arch/metag/
The earliest Meta architecture port of Linux I have a record of was an import of a Meta port of Linux v2.4.1 in February 2004, which was worked on significantly over the next few years by Graham Whaley, Will Newton, Matt Fleming, myself and others. Eventually the port was merged into mainline in v3.9 in March 2013, not long after Imagination Technologies bought MIPS Technologies and shifted its CPU focus over to the MIPS architecture. As a result, though the port was maintained for a while, kept on life support for a while longer, and useful for testing a few specific drivers for which I don't have ready access to the equivalent MIPS hardware, it is now essentially dead with no users. It is also stuck using an out-of-tree toolchain based on GCC 4.2.4 which is no longer maintained, now struggles to build modern kernels due to toolchain bugs, and doesn't itself build with a modern GCC. The latest buildroot port is still using an old uClibc snapshot which is no longer served, and the latest uClibc doesn't build with GCC 4.2.4. So lets call it a day and drop the Meta architecture port from the kernel. RIP Meta. Signed-off-by: James Hogan <jhogan@kernel.org> Link: https://lkml.kernel.org/r/95906b76-6ce1-3f84-eaba-c29b4ae952eb@roeck-us.net Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Graham Whaley <graham.whaley@gmail.com> Cc: linux-metag@vger.kernel.org
Diffstat (limited to 'arch/metag/include/asm/spinlock_lock1.h')
-rw-r--r--arch/metag/include/asm/spinlock_lock1.h165
1 files changed, 0 insertions, 165 deletions
diff --git a/arch/metag/include/asm/spinlock_lock1.h b/arch/metag/include/asm/spinlock_lock1.h
deleted file mode 100644
index c0bd81bbe18c..000000000000
--- a/arch/metag/include/asm/spinlock_lock1.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_SPINLOCK_LOCK1_H
-#define __ASM_SPINLOCK_LOCK1_H
-
-#include <asm/bug.h>
-#include <asm/global_lock.h>
-
-static inline int arch_spin_is_locked(arch_spinlock_t *lock)
-{
- int ret;
-
- barrier();
- ret = lock->lock;
- WARN_ON(ret != 0 && ret != 1);
- return ret;
-}
-
-static inline void arch_spin_lock(arch_spinlock_t *lock)
-{
- unsigned int we_won = 0;
- unsigned long flags;
-
-again:
- __global_lock1(flags);
- if (lock->lock == 0) {
- fence();
- lock->lock = 1;
- we_won = 1;
- }
- __global_unlock1(flags);
- if (we_won == 0)
- goto again;
- WARN_ON(lock->lock != 1);
-}
-
-/* Returns 0 if failed to acquire lock */
-static inline int arch_spin_trylock(arch_spinlock_t *lock)
-{
- unsigned long flags;
- unsigned int ret;
-
- __global_lock1(flags);
- ret = lock->lock;
- if (ret == 0) {
- fence();
- lock->lock = 1;
- }
- __global_unlock1(flags);
- return (ret == 0);
-}
-
-static inline void arch_spin_unlock(arch_spinlock_t *lock)
-{
- barrier();
- WARN_ON(!lock->lock);
- lock->lock = 0;
-}
-
-/*
- * RWLOCKS
- *
- *
- * Write locks are easy - we just set bit 31. When unlocking, we can
- * just write zero since the lock is exclusively held.
- */
-
-static inline void arch_write_lock(arch_rwlock_t *rw)
-{
- unsigned long flags;
- unsigned int we_won = 0;
-
-again:
- __global_lock1(flags);
- if (rw->lock == 0) {
- fence();
- rw->lock = 0x80000000;
- we_won = 1;
- }
- __global_unlock1(flags);
- if (we_won == 0)
- goto again;
- WARN_ON(rw->lock != 0x80000000);
-}
-
-static inline int arch_write_trylock(arch_rwlock_t *rw)
-{
- unsigned long flags;
- unsigned int ret;
-
- __global_lock1(flags);
- ret = rw->lock;
- if (ret == 0) {
- fence();
- rw->lock = 0x80000000;
- }
- __global_unlock1(flags);
-
- return (ret == 0);
-}
-
-static inline void arch_write_unlock(arch_rwlock_t *rw)
-{
- barrier();
- WARN_ON(rw->lock != 0x80000000);
- rw->lock = 0;
-}
-
-/*
- * Read locks are a bit more hairy:
- * - Exclusively load the lock value.
- * - Increment it.
- * - Store new lock value if positive, and we still own this location.
- * If the value is negative, we've already failed.
- * - If we failed to store the value, we want a negative result.
- * - If we failed, try again.
- * Unlocking is similarly hairy. We may have multiple read locks
- * currently active. However, we know we won't have any write
- * locks.
- */
-static inline void arch_read_lock(arch_rwlock_t *rw)
-{
- unsigned long flags;
- unsigned int we_won = 0, ret;
-
-again:
- __global_lock1(flags);
- ret = rw->lock;
- if (ret < 0x80000000) {
- fence();
- rw->lock = ret + 1;
- we_won = 1;
- }
- __global_unlock1(flags);
- if (!we_won)
- goto again;
-}
-
-static inline void arch_read_unlock(arch_rwlock_t *rw)
-{
- unsigned long flags;
- unsigned int ret;
-
- __global_lock1(flags);
- fence();
- ret = rw->lock--;
- __global_unlock1(flags);
- WARN_ON(ret == 0);
-}
-
-static inline int arch_read_trylock(arch_rwlock_t *rw)
-{
- unsigned long flags;
- unsigned int ret;
-
- __global_lock1(flags);
- ret = rw->lock;
- if (ret < 0x80000000) {
- fence();
- rw->lock = ret + 1;
- }
- __global_unlock1(flags);
- return (ret < 0x80000000);
-}
-
-#endif /* __ASM_SPINLOCK_LOCK1_H */