@@ -1,11 +1,6 @@
+#include <asm-generic/spinlock.h>
+
#ifndef __ASM_SPINLOCK_H
#define __ASM_SPINLOCK_H
-struct spinlock {
- int v;
-};
-
-void spin_lock(struct spinlock *lock);
-void spin_unlock(struct spinlock *lock);
-
#endif
@@ -43,22 +43,6 @@ asm (
#endif
);
-void spin_lock(struct spinlock *lock)
-{
- int v = 1;
-
- do {
- asm volatile ("xchg %1, %0" : "+m"(lock->v), "+r"(v));
- } while (v);
- asm volatile ("" : : : "memory");
-}
-
-void spin_unlock(struct spinlock *lock)
-{
- asm volatile ("" : : : "memory");
- lock->v = 0;
-}
-
int cpu_count(void)
{
return _cpu_count;
Signed-off-by: David Hildenbrand <david@redhat.com> --- lib/x86/asm/spinlock.h | 9 ++------- lib/x86/smp.c | 16 ---------------- 2 files changed, 2 insertions(+), 23 deletions(-)