All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-help <xenomai@xenomai.org>
Subject: [Xenomai-help] [PATCH 6/6] Allow xnlock debugging on single-CPU systems
Date: Sun, 02 Mar 2008 11:38:23 +0100	[thread overview]
Message-ID: <47CA839F.90102@domain.hid> (raw)
In-Reply-To: <47C51A34.203@domain.hid>


[-- Attachment #1.1: Type: text/plain, Size: 105 bytes --]

After all the refactoring, arming xnlock_dbg services also for
!CONFIG_SMP setups was straightforward.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: xnlock-debugging-for-up.patch --]
[-- Type: text/x-patch; name="xnlock-debugging-for-up.patch", Size: 7137 bytes --]

---
 include/asm-generic/bits/pod.h |    4 ++--
 include/asm-generic/system.h   |   31 +++++++++++++++----------------
 ksrc/nucleus/intr.c            |    4 ++--
 ksrc/nucleus/module.c          |   12 ++++++------
 ksrc/nucleus/pod.c             |    4 ++--
 ksrc/skins/posix/signal.c      |    2 +-
 6 files changed, 28 insertions(+), 29 deletions(-)

Index: b/include/asm-generic/bits/pod.h
===================================================================
--- a/include/asm-generic/bits/pod.h
+++ b/include/asm-generic/bits/pod.h
@@ -295,7 +295,7 @@ unsigned long long xnarch_get_cpu_time(v
 
 EXPORT_SYMBOL(xnarch_get_cpu_time);
 
-#if defined(CONFIG_SMP) && !defined(CONFIG_XENO_OPT_TICKET_LOCK)
+#if (defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)) && !defined(CONFIG_XENO_OPT_TICKET_LOCK)
 void __xnlock_spin(xnlock_t *lock /*, */ XNLOCK_DBG_CONTEXT_ARGS)
 {
 	unsigned int spin_limit;
@@ -311,6 +311,6 @@ void __xnlock_spin(xnlock_t *lock /*, */
 		} while(atomic_read(&lock->owner) != ~0);
 }
 EXPORT_SYMBOL(__xnlock_spin);
-#endif /* CONFIG_SMP && !CONFIG_XENO_OPT_TICKET_LOCK */
+#endif /* (CONFIG_SMP || XENO_DEBUG(NUCLEUS)) && !CONFIG_XENO_OPT_TICKET_LOCK */
 
 #endif /* !_XENO_ASM_GENERIC_BITS_POD_H */
Index: b/include/asm-generic/system.h
===================================================================
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -76,11 +76,11 @@ extern "C" {
 typedef unsigned long spl_t;
 
 #define splhigh(x)  rthal_local_irq_save(x)
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)
 #define splexit(x)  rthal_local_irq_restore((x) & 1)
-#else /* !CONFIG_SMP */
+#else /* !CONFIG_SMP || XENO_DEBUG(NUCLEUS) */
 #define splexit(x)  rthal_local_irq_restore(x)
-#endif /* !CONFIG_SMP */
+#endif /* !CONFIG_SMP || XENO_DEBUG(NUCLEUS) */
 #define splnone()   rthal_local_irq_enable()
 #define spltest()   rthal_local_irq_test()
 #define splget(x)   rthal_local_irq_flags(x)
@@ -90,7 +90,7 @@ static inline unsigned xnarch_current_cp
 	return rthal_processor_id();
 }
 
-#if defined(CONFIG_SMP) && XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(NUCLEUS)
 
 typedef struct {
 
@@ -204,7 +204,7 @@ static inline int xnlock_dbg_release(xnl
 	return 0;
 }
 
-#else /* !(CONFIG_SMP && XENO_DEBUG(NUCLEUS)) */
+#else /* !XENO_DEBUG(NUCLEUS) */
 
 #ifdef CONFIG_XENO_OPT_TICKET_LOCK
 typedef struct {
@@ -237,7 +237,7 @@ static inline int xnlock_dbg_release(xnl
 	return 0;
 }
 
-#endif /* !(CONFIG_SMP && XENO_DEBUG(NUCLEUS)) */
+#endif /* !XENO_DEBUG(NUCLEUS) */
 
 #define XNARCH_NR_CPUS			RTHAL_NR_CPUS
 
@@ -321,7 +321,7 @@ static inline int xnarch_setimask (int i
 	return !!s;
 }
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)
 
 #define xnlock_get(lock)		__xnlock_get(lock  XNLOCK_DBG_CONTEXT)
 #define xnlock_get_irqsave(lock,x) \
@@ -481,17 +481,12 @@ static inline void xnlock_put_irqrestore
 	rthal_local_irq_restore(flags & 1);
 }
 
-static inline int xnarch_send_ipi(xnarch_cpumask_t cpumask)
-{
-	return rthal_send_ipi(RTHAL_SERVICE_IPI0, cpumask);
-}
-
 static inline int xnlock_is_owner(xnlock_t *lock)
 {
 	return xnlock_owner(lock) == xnarch_current_cpu();
 }
 
-#else /* !CONFIG_SMP */
+#else /* !(CONFIG_SMP || XENO_DEBUG(NUCLEUS)) */
 
 #define xnlock_init(lock)		do { } while(0)
 #define xnlock_get(lock)		do { } while(0)
@@ -507,12 +502,16 @@ static inline int xnlock_is_owner(xnlock
 #define DEFINE_XNLOCK(lock)
 #define DEFINE_PRIVATE_XNLOCK(lock)
 
-static inline int xnarch_send_ipi (xnarch_cpumask_t cpumask)
+#endif /* !(CONFIG_SMP || XENO_DEBUG(NUCLEUS)) */
+
+static inline int xnarch_send_ipi(xnarch_cpumask_t cpumask)
 {
+#ifdef CONFIG_SMP
+	return rthal_send_ipi(RTHAL_SERVICE_IPI0, cpumask);
+#else /* !CONFIG_SMP */
 	return 0;
-}
-
 #endif /* !CONFIG_SMP */
+}
 
 #define xnlock_sync_irq(lock, x)			\
 	do {						\
Index: b/ksrc/nucleus/intr.c
===================================================================
--- a/ksrc/nucleus/intr.c
+++ b/ksrc/nucleus/intr.c
@@ -387,7 +387,7 @@ static inline int xnintr_irq_detach(xnin
 
 #else /* !CONFIG_XENO_OPT_SHIRQ */
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)
 typedef struct xnintr_irq {
 
 	DECLARE_XNLOCK(lock);
@@ -395,7 +395,7 @@ typedef struct xnintr_irq {
 } ____cacheline_aligned_in_smp xnintr_irq_t;
 
 static xnintr_irq_t xnirqs[XNARCH_NR_IRQS];
-#endif /* CONFIG_SMP */
+#endif /* CONFIG_SMP || XENO_DEBUG(NUCLEUS) */
 
 static inline xnintr_t *xnintr_shirq_first(unsigned irq)
 {
Index: b/ksrc/nucleus/module.c
===================================================================
--- a/ksrc/nucleus/module.c
+++ b/ksrc/nucleus/module.c
@@ -664,7 +664,7 @@ void xnpod_discard_tbase_proc(xntbase_t 
 
 #endif /* CONFIG_XENO_OPT_STATS */
 
-#if defined(CONFIG_SMP) && XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(NUCLEUS)
 
 xnlockinfo_t xnlock_stats[RTHAL_NR_CPUS];
 
@@ -712,7 +712,7 @@ static int lock_read_proc(char *page,
 
 EXPORT_SYMBOL(xnlock_stats);
 
-#endif /* CONFIG_SMP && XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(NUCLEUS) */
 
 static int latency_read_proc(char *page,
 			     char **start,
@@ -1033,9 +1033,9 @@ void xnpod_init_proc(void)
 		create_proc_entry("timerstat", S_IFDIR, rthal_proc_root);
 #endif /* CONFIG_XENO_OPT_STATS */
 
-#if defined(CONFIG_SMP) && XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(NUCLEUS)
 	add_proc_leaf("lock", &lock_read_proc, NULL, NULL, rthal_proc_root);
-#endif /* CONFIG_SMP && XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(NUCLEUS) */
 
 	add_proc_leaf("latency",
 		      &latency_read_proc,
@@ -1087,9 +1087,9 @@ void xnpod_delete_proc(void)
 	remove_proc_entry("timerstat", rthal_proc_root);
 	remove_proc_entry("stat", rthal_proc_root);
 #endif /* CONFIG_XENO_OPT_STATS */
-#if defined(CONFIG_SMP) && XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(NUCLEUS)
 	remove_proc_entry("lock", rthal_proc_root);
-#endif /* CONFIG_SMP && XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(NUCLEUS) */
 }
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
Index: b/ksrc/nucleus/pod.c
===================================================================
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -3472,7 +3472,7 @@ EXPORT_SYMBOL(xnpod_welcome_thread);
 
 EXPORT_SYMBOL(nkpod_struct);
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)
 EXPORT_SYMBOL(nklock);
-#endif /* CONFIG_SMP */
+#endif /* CONFIG_SMP || XENO_DEBUG(NUCLEUS) */
 EXPORT_SYMBOL(nklatency);
Index: b/ksrc/skins/posix/signal.c
===================================================================
--- a/ksrc/skins/posix/signal.c
+++ b/ksrc/skins/posix/signal.c
@@ -64,7 +64,7 @@ typedef void siginfo_handler_t(int, sigi
 #define SIGRTMAX 64
 static struct sigaction actions[SIGRTMAX];
 static pse51_siginfo_t pse51_infos_pool[PSE51_SIGQUEUE_MAX];
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || XENO_DEBUG(NUCLEUS)
 static xnlock_t pse51_infos_lock = XNARCH_LOCK_UNLOCKED;
 #endif
 static xnpqueue_t pse51_infos_free_list;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

  parent reply	other threads:[~2008-03-02 10:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <47C51A34.203@domain.hid>
2008-03-02 10:38 ` [Xenomai-help] [PATCH 1/6] Refactor xnlock debugging Jan Kiszka
2008-03-02 10:38 ` [Xenomai-help] [PATCH 2/6] Whitespace fixes for asm-generic/system.h Jan Kiszka
2008-03-02 10:38 ` [Xenomai-help] [PATCH 3/6] Consolidate xnlock_put debugging Jan Kiszka
2008-03-02 10:38 ` [Xenomai-help] [PATCH 4/6] Move spinning code out-of-line Jan Kiszka
2008-03-02 10:38 ` [Xenomai-help] [PATCH 5/6] Introduce optional recursive ticket xnlock Jan Kiszka
2008-03-02 10:38 ` Jan Kiszka [this message]
2008-03-02 11:02 ` [Xenomai-core] [PATCH 1/6] Refactor xnlock debugging Jan Kiszka
2008-03-02 11:02 ` [Xenomai-core] [PATCH 2/6] Whitespace fixes for asm-generic/system.h Jan Kiszka
2008-03-02 11:02 ` [Xenomai-core] [PATCH 3/6] Consolidate xnlock_put debugging Jan Kiszka
2008-03-02 11:02 ` [Xenomai-core] [PATCH 4/6] Move spinning code out-of-line Jan Kiszka
2008-03-02 11:02 ` [Xenomai-core] [PATCH 5/6] Introduce optional recursive ticket xnlock Jan Kiszka
2008-03-02 11:02 ` [Xenomai-core] [PATCH 6/6] Allow xnlock debugging on single-CPU systems Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CA839F.90102@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.