Module: xenomai-3
Branch: wip/dovetail
Commit: 0232adaeae6b69f6869f00786ccaac4383445035
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0232adaeae6b69f6869f00786ccaac4383445035

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat May 21 10:43:59 2016 +0200

dovetail: rework clocking information retrieval

---

 .../cobalt/include/asm-generic/xenomai/machine.h   |    2 +-
 kernel/cobalt/init.c                               |   32 ++++++++++----------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/kernel/cobalt/include/asm-generic/xenomai/machine.h 
b/kernel/cobalt/include/asm-generic/xenomai/machine.h
index 3def3c4..12ad565 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/machine.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/machine.h
@@ -47,7 +47,7 @@ DECLARE_PER_CPU(struct cobalt_machine_cpudata, 
cobalt_machine_cpudata);
 
 struct cobalt_pipeline {
        struct irq_stage stage;
-       struct ipipe_sysinfo clock_data;
+       struct irq_pipeline_clocking clock_data;
        unsigned long clock_freq;
        unsigned int apc_virq;
        unsigned long apc_map;
diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c
index b0b042e..f7e6159 100644
--- a/kernel/cobalt/init.c
+++ b/kernel/cobalt/init.c
@@ -155,32 +155,32 @@ static int __init mach_setup(void)
 {
        int ret, virq;
 
-       ipipe_get_sysinfo(&cobalt_pipeline.clock_data);
+       if (cobalt_machine.init) {
+               ret = cobalt_machine.init();
+               if (ret) {
+                       printk(XENO_ERR "machine.init() failed\n");
+                       return ret;
+               }
+       }
+
+       irq_push_stage(&cobalt_pipeline.stage, "Xenomai",
+                      &cobalt_pipeline.clock_data);
 
        if (clockfreq_arg == 0)
                clockfreq_arg = cobalt_pipeline.clock_data.sys_hrclock_freq;
 
        if (clockfreq_arg == 0) {
                printk(XENO_ERR "null clock frequency? Aborting.\n");
-               return -ENODEV;
+               ret = -ENODEV;
+               goto fail;
        }
 
        cobalt_pipeline.clock_freq = clockfreq_arg;
 
-       if (cobalt_machine.init) {
-               ret = cobalt_machine.init();
-               if (ret) {
-                       printk(XENO_ERR "machine.init() failed\n");
-                       return ret;
-               }
-       }
-
-       ipipe_register_head(&cobalt_pipeline.stage, "Xenomai");
-
        ret = -EAGAIN;
        virq = irq_create_direct_mapping(synthetic_irq_domain);
        if (virq == 0)
-               goto fail_apc_alloc;
+               goto fail;
 
        cobalt_pipeline.apc_virq = virq;
        ret = request_irq(virq, apc_dispatch, 0,
@@ -213,8 +213,8 @@ fail_escalate_alloc:
        free_irq(cobalt_pipeline.apc_virq, &root_irq_stage);
 fail_apc_request:
        irq_dispose_mapping(cobalt_pipeline.apc_virq);
-fail_apc_alloc:
-       ipipe_unregister_head(&cobalt_pipeline.stage);
+fail:
+       irq_pop_stage(&cobalt_pipeline.stage);
 
        if (cobalt_machine.cleanup)
                cobalt_machine.cleanup();
@@ -237,7 +237,7 @@ static __init void mach_cleanup(void)
        irq_dispose_mapping(cobalt_pipeline.escalate_virq);
        free_irq(cobalt_pipeline.apc_virq, &root_irq_stage);
        irq_dispose_mapping(cobalt_pipeline.apc_virq);
-       ipipe_unregister_head(&cobalt_pipeline.stage);
+       irq_pop_stage(&cobalt_pipeline.stage);
 }
 
 static struct {


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

Reply via email to