[kvm-unit-tests PATCH v2 3/3] x86: use asm-generic spinlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>
---
 lib/x86/asm/spinlock.h |  7 +------
 lib/x86/smp.c          | 16 ----------------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/lib/x86/asm/spinlock.h b/lib/x86/asm/spinlock.h
index 4b0cb33..692020c 100644
--- a/lib/x86/asm/spinlock.h
+++ b/lib/x86/asm/spinlock.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_SPINLOCK_H
 #define __ASM_SPINLOCK_H
 
-struct spinlock {
-    int v;
-};
-
-void spin_lock(struct spinlock *lock);
-void spin_unlock(struct spinlock *lock);
+#include <asm-generic/spinlock.h>
 
 #endif
diff --git a/lib/x86/smp.c b/lib/x86/smp.c
index 1eb49f2..4bdbeae 100644
--- a/lib/x86/smp.c
+++ b/lib/x86/smp.c
@@ -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;
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux