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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Feb 13 16:08:50 2014 +0100

cobalt/kernel: cosmetic: use accessor to pipeline head domain

---

 include/cobalt/kernel/sched.h |    3 ++-
 kernel/cobalt/init.c          |   16 ++++++++--------
 kernel/cobalt/intr.c          |   16 ++++++++--------
 kernel/cobalt/shadow.c        |    8 ++++----
 kernel/cobalt/timer.c         |    4 ++--
 5 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index 83fa25f..d96eef0 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -225,7 +225,8 @@ static inline void xnsched_set_resched(struct xnsched 
*sched)
        }
 }
 
-#define xnsched_realtime_cpus xnarch_machdata.supported_cpus
+#define xnsched_realtime_cpus    xnarch_machdata.supported_cpus
+#define xnsched_realtime_domain  xnarch_machdata.domain
 
 static inline int xnsched_supported_cpu(int cpu)
 {
diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c
index 4062f84..19a2de1 100644
--- a/kernel/cobalt/init.c
+++ b/kernel/cobalt/init.c
@@ -109,7 +109,7 @@ static void sys_shutdown(void)
        disable_timesource();
        xnshadow_release_events();
 #ifdef CONFIG_SMP
-       ipipe_free_irq(&xnarch_machdata.domain, IPIPE_RESCHEDULE_IPI);
+       ipipe_free_irq(&xnsched_realtime_domain, IPIPE_RESCHEDULE_IPI);
 #endif
 
        xnlock_get_irqsave(&nklock, s);
@@ -177,7 +177,7 @@ static int __init mach_setup(void)
                        return ret;
        }
 
-       ipipe_register_head(&xnarch_machdata.domain, "Xenomai");
+       ipipe_register_head(&xnsched_realtime_domain, "Xenomai");
 
        ret = -EBUSY;
        virq = ipipe_alloc_virq();
@@ -197,7 +197,7 @@ static int __init mach_setup(void)
 
        xnarch_machdata.escalate_virq = virq;
 
-       ipipe_request_irq(&xnarch_machdata.domain,
+       ipipe_request_irq(&xnsched_realtime_domain,
                          xnarch_machdata.escalate_virq,
                          (ipipe_irq_handler_t)__xnsched_run_handler,
                          NULL, NULL);
@@ -209,7 +209,7 @@ static int __init mach_setup(void)
        return 0;
 
 fail_clock:
-       ipipe_free_irq(&xnarch_machdata.domain,
+       ipipe_free_irq(&xnsched_realtime_domain,
                       xnarch_machdata.escalate_virq);
        ipipe_free_virq(xnarch_machdata.escalate_virq);
 fail_escalate:
@@ -217,7 +217,7 @@ fail_escalate:
                       xnarch_machdata.apc_virq);
        ipipe_free_virq(xnarch_machdata.apc_virq);
 fail_apc:
-       ipipe_unregister_head(&xnarch_machdata.domain);
+       ipipe_unregister_head(&xnsched_realtime_domain);
 
        if (xnarch_machdesc.cleanup)
                xnarch_machdesc.cleanup();
@@ -227,8 +227,8 @@ fail_apc:
 
 static __init void mach_cleanup(void)
 {
-       ipipe_unregister_head(&xnarch_machdata.domain);
-       ipipe_free_irq(&xnarch_machdata.domain,
+       ipipe_unregister_head(&xnsched_realtime_domain);
+       ipipe_free_irq(&xnsched_realtime_domain,
                       xnarch_machdata.escalate_virq);
        ipipe_free_virq(xnarch_machdata.escalate_virq);
        ipipe_timers_release();
@@ -345,7 +345,7 @@ static __init int sys_init(void)
        }
 
 #ifdef CONFIG_SMP
-       ipipe_request_irq(&xnarch_machdata.domain,
+       ipipe_request_irq(&xnsched_realtime_domain,
                          IPIPE_RESCHEDULE_IPI,
                          (ipipe_irq_handler_t)__xnsched_run_handler,
                          NULL, NULL);
diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c
index 94c6623..47512fe 100644
--- a/kernel/cobalt/intr.c
+++ b/kernel/cobalt/intr.c
@@ -350,7 +350,7 @@ static inline int xnintr_irq_attach(xnintr_t *intr)
                }
                shirq->unhandled = 0;
 
-               ret = ipipe_request_irq(&xnarch_machdata.domain,
+               ret = ipipe_request_irq(&xnsched_realtime_domain,
                                        intr->irq, handler, intr, 
(ipipe_irq_ackfn_t)intr->iack);
                if (ret)
                        return ret;
@@ -381,7 +381,7 @@ static inline void xnintr_irq_detach(xnintr_t *intr)
 
                        /* Release the IRQ line if this was the last user */
                        if (shirq->handlers == NULL)
-                               ipipe_free_irq(&xnarch_machdata.domain, 
intr->irq);
+                               ipipe_free_irq(&xnsched_realtime_domain, 
intr->irq);
 
                        return;
                }
@@ -406,7 +406,7 @@ static xnintr_irq_t xnirqs[IPIPE_NR_IRQS];
 
 static inline xnintr_t *xnintr_shirq_first(unsigned int irq)
 {
-       return __ipipe_irq_cookie(&xnarch_machdata.domain, irq);
+       return __ipipe_irq_cookie(&xnsched_realtime_domain, irq);
 }
 
 static inline xnintr_t *xnintr_shirq_next(xnintr_t *prev)
@@ -416,7 +416,7 @@ static inline xnintr_t *xnintr_shirq_next(xnintr_t *prev)
 
 static inline int xnintr_irq_attach(xnintr_t *intr)
 {
-       return ipipe_request_irq(&xnarch_machdata.domain,
+       return ipipe_request_irq(&xnsched_realtime_domain,
                                 intr->irq, xnintr_irq_handler, intr,
                                 (ipipe_irq_ackfn_t)intr->iack);
 }
@@ -426,7 +426,7 @@ static inline void xnintr_irq_detach(xnintr_t *intr)
        int irq = intr->irq;
 
        xnlock_get(&xnirqs[irq].lock);
-       ipipe_free_irq(&xnarch_machdata.domain, irq);
+       ipipe_free_irq(&xnsched_realtime_domain, irq);
        xnlock_put(&xnirqs[irq].lock);
 
        sync_stat_references(intr);
@@ -464,7 +464,7 @@ static void xnintr_irq_handler(unsigned irq, void *cookie)
         * interrupt service routine, so the scheduler pointer will
         * remain valid throughout this function.
         */
-       intr = __ipipe_irq_cookie(&xnarch_machdata.domain, irq);
+       intr = __ipipe_irq_cookie(&xnsched_realtime_domain, irq);
        if (unlikely(!intr)) {
                s = 0;
                goto unlock_and_exit;
@@ -1006,14 +1006,14 @@ static int irq_vfile_show(struct 
xnvfile_regular_iterator *it,
                xnvfile_printf(it, "        CPU%d", cpu);
 
        for (irq = 0; irq < IPIPE_NR_IRQS; irq++) {
-               if (__ipipe_irq_handler(&xnarch_machdata.domain, irq) == NULL)
+               if (__ipipe_irq_handler(&xnsched_realtime_domain, irq) == NULL)
                        continue;
 
                xnvfile_printf(it, "\n%5d:", irq);
 
                for_each_realtime_cpu(cpu) {
                        xnvfile_printf(it, "%12lu",
-                                      
__ipipe_cpudata_irq_hits(&xnarch_machdata.domain, cpu,
+                                      
__ipipe_cpudata_irq_hits(&xnsched_realtime_domain, cpu,
                                                                irq));
                }
 
diff --git a/kernel/cobalt/shadow.c b/kernel/cobalt/shadow.c
index fa8fad3..8c18ed2 100644
--- a/kernel/cobalt/shadow.c
+++ b/kernel/cobalt/shadow.c
@@ -1978,7 +1978,7 @@ restart:
         */
        if (sysflags & __xn_exec_lostage) {
                /* Syscall must run into the Linux domain. */
-               if (ipd == &xnarch_machdata.domain) {
+               if (ipd == &xnsched_realtime_domain) {
                        /*
                         * Request originates from the Xenomai domain:
                         * just relax the caller and execute the
@@ -1999,7 +1999,7 @@ restart:
                 * Syscall must be processed either by Xenomai, or by
                 * the calling domain.
                 */
-               if (ipd != &xnarch_machdata.domain)
+               if (ipd != &xnsched_realtime_domain)
                        /*
                         * Request originates from the Linux domain:
                         * propagate the event to our Linux-based
@@ -2624,12 +2624,12 @@ void xnshadow_grab_events(void)
 {
        init_hostrt();
        ipipe_set_hooks(ipipe_root_domain, IPIPE_SYSCALL|IPIPE_KEVENT);
-       ipipe_set_hooks(&xnarch_machdata.domain, IPIPE_SYSCALL|IPIPE_TRAP);
+       ipipe_set_hooks(&xnsched_realtime_domain, IPIPE_SYSCALL|IPIPE_TRAP);
 }
 
 void xnshadow_release_events(void)
 {
-       ipipe_set_hooks(&xnarch_machdata.domain, 0);
+       ipipe_set_hooks(&xnsched_realtime_domain, 0);
        ipipe_set_hooks(ipipe_root_domain, 0);
 }
 
diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
index 5501962..acc3989 100644
--- a/kernel/cobalt/timer.c
+++ b/kernel/cobalt/timer.c
@@ -503,7 +503,7 @@ EXPORT_SYMBOL_GPL(__xntimer_migrate);
 
 int xntimer_setup_ipi(void)
 {
-       return ipipe_request_irq(&xnarch_machdata.domain,
+       return ipipe_request_irq(&xnsched_realtime_domain,
                                 IPIPE_HRTIMER_IPI,
                                 (ipipe_irq_handler_t)xnintr_core_clock_handler,
                                 NULL, NULL);
@@ -511,7 +511,7 @@ int xntimer_setup_ipi(void)
 
 void xntimer_release_ipi(void)
 {
-       ipipe_free_irq(&xnarch_machdata.domain, IPIPE_HRTIMER_IPI);
+       ipipe_free_irq(&xnsched_realtime_domain, IPIPE_HRTIMER_IPI);
 }
 
 #endif /* CONFIG_SMP */


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

Reply via email to