This patch renames DECLARE_*XNLOCK to DEFINE_*XNLOCK, defines real 
DECLARE_XNLOCK +
DECLARE_EXTERN_XNLOCK and applies it on several users.

Jan

---
 include/asm-generic/system.h |   10 +++++++---
 include/asm-sim/system.h     |    4 +++-
 include/nucleus/heap.h       |    4 +---
 include/nucleus/pod.h        |    4 +---
 ksrc/nucleus/intr.c          |    4 +---
 ksrc/nucleus/pod.c           |    2 +-
 ksrc/nucleus/shadow.c        |    2 +-
 ksrc/skins/posix/registry.c  |    4 +---
 ksrc/skins/posix/registry.h  |    4 +---
 ksrc/skins/rtdm/core.c       |    4 +---
 ksrc/skins/rtdm/core.h       |    4 +---
 ksrc/skins/rtdm/device.c     |    5 +----
 12 files changed, 20 insertions(+), 31 deletions(-)

Index: include/asm-generic/system.h
===================================================================
--- include/asm-generic/system.h        (Revision 2216)
+++ include/asm-generic/system.h        (Arbeitskopie)
@@ -245,8 +245,10 @@ static inline void xnlock_init (xnlock_t
     *lock = XNARCH_LOCK_UNLOCKED;
 }
 
-#define DECLARE_XNLOCK(lock)           xnlock_t lock = XNARCH_LOCK_UNLOCKED
-#define DECLARE_PRIVATE_XNLOCK(lock) static DECLARE_XNLOCK(lock)
+#define DECLARE_XNLOCK(lock)           xnlock_t lock
+#define DECLARE_EXTERN_XNLOCK(lock)    extern xnlock_t lock
+#define DEFINE_XNLOCK(lock)            xnlock_t lock = XNARCH_LOCK_UNLOCKED
+#define DEFINE_PRIVATE_XNLOCK(lock) static DEFINE_XNLOCK(lock)
 
 #if XENO_DEBUG(NUCLEUS)
 
@@ -386,7 +388,9 @@ static inline void xnlock_put_irqrestore
 #define xnlock_clear_irqon(lock)       rthal_local_irq_enable()
 
 #define DECLARE_XNLOCK(lock)
-#define DECLARE_PRIVATE_XNLOCK(lock)
+#define DECLARE_EXTERN_XNLOCK(lock)
+#define DEFINE_XNLOCK(lock)
+#define DEFINE_PRIVATE_XNLOCK(lock)
 
 #endif /* !CONFIG_SMP */
 
Index: include/asm-sim/system.h
===================================================================
--- include/asm-sim/system.h    (Revision 2216)
+++ include/asm-sim/system.h    (Arbeitskopie)
@@ -79,7 +79,9 @@ typedef unsigned long xnlock_t;
 #define xnlock_clear_irqon(lock)       mvm_set_irqmask(0)
 
 #define DECLARE_XNLOCK(lock)
-#define DECLARE_PRIVATE_XNLOCK(lock)
+#define DECLARE_EXTERN_XNLOCK(lock)
+#define DEFINE_XNLOCK(lock)
+#define DEFINE_PRIVATE_XNLOCK(lock)
 
 #define XNARCH_NR_CPUS              1
 
Index: include/nucleus/heap.h
===================================================================
--- include/nucleus/heap.h      (Revision 2216)
+++ include/nucleus/heap.h      (Arbeitskopie)
@@ -89,9 +89,7 @@ typedef struct xnheap {
 
        xnqueue_t extents;
 
-#ifdef CONFIG_SMP
-       xnlock_t lock;
-#endif /* CONFIG_SMP */
+       DECLARE_XNLOCK(lock);
 
        caddr_t buckets[XNHEAP_NBUCKETS];
 
Index: include/nucleus/pod.h
===================================================================
--- include/nucleus/pod.h       (Revision 2216)
+++ include/nucleus/pod.h       (Arbeitskopie)
@@ -219,9 +219,7 @@ typedef struct xnpod xnpod_t;
 
 extern xnpod_t *nkpod;
 
-#ifdef CONFIG_SMP
-extern xnlock_t nklock;
-#endif /* CONFIG_SMP */
+DECLARE_EXTERN_XNLOCK(nklock);
 
 extern u_long nkschedlat;
 
Index: ksrc/skins/posix/registry.c
===================================================================
--- ksrc/skins/posix/registry.c (Revision 2216)
+++ ksrc/skins/posix/registry.c (Arbeitskopie)
@@ -322,9 +322,7 @@ int pse51_desc_get(pse51_desc_t ** descp
 
 #if defined(__KERNEL__) && defined(CONFIG_XENO_OPT_PERVASIVE)
 
-#ifdef CONFIG_SMP
-xnlock_t pse51_assoc_lock;
-#endif
+DEFINE_XNLOCK(pse51_assoc_lock);
 
 static int pse51_assoc_lookup_inner(pse51_assocq_t * q,
                                    pse51_assoc_t ** passoc,
Index: ksrc/skins/posix/registry.h
===================================================================
--- ksrc/skins/posix/registry.h (Revision 2216)
+++ ksrc/skins/posix/registry.h (Arbeitskopie)
@@ -90,9 +90,7 @@ int pse51_desc_destroy(pse51_desc_t *des
 #if defined(__KERNEL__) && defined(CONFIG_XENO_OPT_PERVASIVE)
 struct mm_struct;
 
-#ifdef CONFIG_SMP
-extern xnlock_t pse51_assoc_lock;
-#endif
+DECLARE_EXTERN_XNLOCK(pse51_assoc_lock);
 
 typedef xnqueue_t pse51_assocq_t;
 
Index: ksrc/skins/rtdm/device.c
===================================================================
--- ksrc/skins/rtdm/device.c    (Revision 2216)
+++ ksrc/skins/rtdm/device.c    (Arbeitskopie)
@@ -61,10 +61,7 @@ static int          name_hashkey_mask;
 static int          proto_hashkey_mask;
 
 DECLARE_MUTEX(nrt_dev_lock);
-
-#ifdef CONFIG_SMP
-xnlock_t            rt_dev_lock = XNARCH_LOCK_UNLOCKED;
-#endif /* CONFIG_SMP */
+DEFINE_PRIVATE_XNLOCK(rt_dev_lock);
 
 #ifndef MODULE
 int                 rtdm_initialised = 0;
Index: ksrc/skins/rtdm/core.c
===================================================================
--- ksrc/skins/rtdm/core.c      (Revision 2216)
+++ ksrc/skins/rtdm/core.c      (Arbeitskopie)
@@ -45,9 +45,7 @@ static unsigned long    used_fildes[FD_B
 int                     open_fildes;    /* amount of used descriptors */
 xntbase_t               *rtdm_tbase;
 
-#ifdef CONFIG_SMP
-xnlock_t                rt_fildes_lock = XNARCH_LOCK_UNLOCKED;
-#endif /* !CONFIG_SMP */
+DEFINE_XNLOCK(rt_fildes_lock);
 
 
 /**
Index: ksrc/skins/rtdm/core.h
===================================================================
--- ksrc/skins/rtdm/core.h      (Revision 2216)
+++ ksrc/skins/rtdm/core.h      (Arbeitskopie)
@@ -24,9 +24,7 @@
 #include <rtdm/rtdm_driver.h>
 
 
-#ifdef CONFIG_SMP
-extern xnlock_t             rt_fildes_lock;
-#endif /* CONFIG_SMP */
+DECLARE_EXTERN_XNLOCK(rt_fildes_lock);
 
 #define RTDM_FD_MAX         CONFIG_XENO_OPT_RTDM_FILDES
 
Index: ksrc/nucleus/intr.c
===================================================================
--- ksrc/nucleus/intr.c (Revision 2216)
+++ ksrc/nucleus/intr.c (Arbeitskopie)
@@ -39,9 +39,7 @@
 
 #define XNINTR_MAX_UNHANDLED   1000
 
-#ifdef CONFIG_SMP
-xnlock_t intrlock = XNARCH_LOCK_UNLOCKED;
-#endif /* CONFIG_SMP */
+DEFINE_PRIVATE_XNLOCK(intrlock);
 
 xnintr_t nkclock;
 
Index: ksrc/nucleus/pod.c
===================================================================
--- ksrc/nucleus/pod.c  (Revision 2216)
+++ ksrc/nucleus/pod.c  (Arbeitskopie)
@@ -56,7 +56,7 @@
 
 xnpod_t *nkpod = NULL;
 
-DECLARE_XNLOCK(nklock);
+DEFINE_XNLOCK(nklock);
 
 u_long nkschedlat = 0;
 
Index: ksrc/nucleus/shadow.c
===================================================================
--- ksrc/nucleus/shadow.c       (Revision 2216)
+++ ksrc/nucleus/shadow.c       (Arbeitskopie)
@@ -175,7 +175,7 @@ void xnpod_discard_iface_proc(struct xns
  * its base priority, i.e. the lowest available level.
  */
 
-DECLARE_PRIVATE_XNLOCK(rpilock);
+DEFINE_PRIVATE_XNLOCK(rpilock);
 
 #define rpi_p(t)       ((t)->rpi != NULL)
 


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to