WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [POWERPC][XEN] support for recursive spin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [POWERPC][XEN] support for recursive spinlocks
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Dec 2006 17:34:46 +0000
Delivery-date: Wed, 13 Dec 2006 09:38:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 228c34916020645d020cf39bfe5c502f9dd15650
# Parent  176c7264715ca51611801ebdd57a9dd6a09416c4
[POWERPC][XEN] support for recursive spinlocks
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/include/asm-powerpc/spinlock.h |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff -r 176c7264715c -r 228c34916020 xen/include/asm-powerpc/spinlock.h
--- a/xen/include/asm-powerpc/spinlock.h        Fri Nov 10 16:45:25 2006 -0600
+++ b/xen/include/asm-powerpc/spinlock.h        Fri Dec 01 16:57:03 2006 -0600
@@ -70,13 +70,10 @@ cas_u32(volatile u32 *ptr, u32 oval, u32
     return tmp;
 }
 
-typedef union {
+typedef struct {
     volatile u32 lock;
-    struct {
-        s8 recurse_cpu;
-        u8 recurse_cnt;
-        s16 lock;
-    } fields;
+       u16 recurse_cpu;
+       u16 recurse_cnt;
 } spinlock_t;
 
 #define __UNLOCKED (0U)
@@ -181,17 +178,17 @@ static inline void _raw_spin_unlock_recu
 static inline void _raw_spin_unlock_recursive(spinlock_t *lock)
 {
     int cpu = smp_processor_id();
-    if (likely(lock->fields.recurse_cpu != cpu)) {
+    if (likely(lock->recurse_cpu != cpu)) {
         spin_lock(lock);
-        lock->fields.recurse_cpu = cpu;
-    }
-    lock->fields.recurse_cnt++;
+        lock->recurse_cpu = cpu;
+    }
+    lock->recurse_cnt++;
 }
 
 static inline void _raw_spin_unlock_recursive(spinlock_t *lock)
 {
-    if (likely(--lock->fields.recurse_cnt == 0)) {
-        lock->fields.recurse_cpu = -1;
+    if (likely(--lock->recurse_cnt == 0)) {
+        lock->recurse_cpu = -1;
         spin_unlock(lock);
     }
 }
@@ -200,19 +197,19 @@ static inline void _raw_spin_unlock_recu
 #define _raw_spin_lock_recursive(_lock)            \
     do {                                           \
         int cpu = smp_processor_id();              \
-        if ( likely((_lock)->fields.recurse_cpu != cpu) ) \
+        if ( likely((_lock)->recurse_cpu != cpu) ) \
         {                                          \
             spin_lock(_lock);                      \
-            (_lock)->fields.recurse_cpu = cpu;            \
+            (_lock)->recurse_cpu = cpu;            \
         }                                          \
-        (_lock)->fields.recurse_cnt++;                    \
+        (_lock)->recurse_cnt++;                    \
     } while ( 0 )
 
 #define _raw_spin_unlock_recursive(_lock)          \
     do {                                           \
-        if ( likely(--(_lock)->fields.recurse_cnt == 0) ) \
+        if ( likely(--(_lock)->recurse_cnt == 0) ) \
         {                                          \
-            (_lock)->fields.recurse_cpu = -1;             \
+            (_lock)->recurse_cpu = -1;             \
             spin_unlock(_lock);                    \
         }                                          \
     } while ( 0 )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [POWERPC][XEN] support for recursive spinlocks, Xen patchbot-unstable <=