Module: xenomai-forge
Branch: next
Commit: 80f98e34ee2e46c6f05215fb526b0c8aeb57b9ea
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=80f98e34ee2e46c6f05215fb526b0c8aeb57b9ea

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Feb 13 12:09:58 2014 +0100

cobalt/intr: fix build when CONFIG_XENO_OPT_STATS is disabled

---

 include/cobalt/kernel/stat.h |    3 +++
 kernel/cobalt/intr.c         |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
index 1ee0bf9..81c56f3 100644
--- a/include/cobalt/kernel/stat.h
+++ b/include/cobalt/kernel/stat.h
@@ -33,6 +33,8 @@ typedef struct xnstat_exectime {
 
 } xnstat_exectime_t;
 
+#define xnstat_percpu_data                                     
__this_cpu_ptr(nktimer.stats)
+
 /* Return current date which can be passed to other xnstat services for
    immediate or lazy accounting. */
 #define xnstat_exectime_now() xnclock_core_read_raw()
@@ -106,6 +108,7 @@ static inline void xnstat_counter_set(xnstat_counter_t *c, 
unsigned long value)
 typedef struct xnstat_exectime {
 } xnstat_exectime_t;
 
+#define xnstat_percpu_data                                     NULL
 #define xnstat_exectime_now()                                  ({ 0; })
 #define xnstat_exectime_update(sched, date)                    do { } while (0)
 #define xnstat_exectime_set_current(sched, new_account)                ({ 
(void)sched; NULL; })
diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c
index b162d22..94c6623 100644
--- a/kernel/cobalt/intr.c
+++ b/kernel/cobalt/intr.c
@@ -36,7 +36,7 @@
 static DEFINE_MUTEX(intrlock);
 
 #ifdef CONFIG_XENO_OPT_STATS
-xnintr_t nktimer;           /* Only for statistics */
+struct xnintr nktimer;      /* Only for statistics */
 static int xnintr_count = 1; /* Number of attached xnintr objects + nktimer */
 static int xnintr_list_rev;  /* Modification counter of xnintr list */
 
@@ -106,7 +106,7 @@ void xnintr_core_clock_handler(void)
                return;
        }
 
-       statp = __this_cpu_ptr(nktimer.stats);
+       statp = xnstat_percpu_data;
        prev = xnstat_exectime_switch(sched, &statp->account);
        xnstat_counter_inc(&statp->hits);
 
@@ -849,6 +849,7 @@ static inline int xnintr_is_timer_irq(int irq)
 }
 
 #ifdef CONFIG_XENO_OPT_STATS
+
 int xnintr_get_query_lock(void)
 {
        return mutex_lock_interruptible(&intrlock) ? -ERESTARTSYS : 0;
@@ -932,6 +933,7 @@ int xnintr_query_next(int irq, xnintr_iterator_t *iterator, 
char *name_buf)
 
        return 0;
 }
+
 #endif /* CONFIG_XENO_OPT_STATS */
 
 #ifdef CONFIG_XENO_OPT_VFILE


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to