Commit 88325dbd authored by hongzha1's avatar hongzha1 Committed by Jan Kiszka

cobalt/init: init escalate irq with dovetail synthetic_irq_domain

alloc escalate irq with dovetail synthetic_irq_domain and init and
raise it with irq_post_oob
Signed-off-by: default avatarhongzha1 <hongzhan.chen@intel.com>
parent 7f8ecd03
Pipeline #4977 failed with stage
in 21 minutes and 40 seconds
......@@ -88,6 +88,11 @@ static inline void xnarch_enter_root(struct xnthread *root) { }
static inline int xnarch_escalate(void)
{
if (running_inband()) {
/* orginal xenomai domain equals oob stage */
irq_post_oob(cobalt_pipeline.escalate_virq);
return 1;
}
/* if (ipipe_root_p) {
ipipe_raise_irq(cobalt_pipeline.escalate_virq);
return 1;
......
......@@ -30,11 +30,15 @@
#include <cobalt/kernel/pipe.h>
#include <cobalt/kernel/select.h>
#include <cobalt/kernel/vdso.h>
#include <linux/irqdomain.h>
#include <linux/irq_pipeline.h>
#include <rtdm/fd.h>
#include "rtdm/internal.h"
#include "posix/internal.h"
#include "procfs.h"
static DEFINE_PER_CPU(int, cobalt_escalate_devid);
/**
* @defgroup cobalt Cobalt
*
......@@ -134,10 +138,17 @@ static void sys_shutdown(void)
xnheap_vfree(membase);
}
static irqreturn_t cobalt_escalate_irq_handler(int sirq, void *dev_id)
{
__xnsched_run_handler();
return IRQ_HANDLED;
}
static int __init mach_setup(void)
{
// struct ipipe_sysinfo sysinfo;
int ret/*, virq*/;
int ret, virq;
/* ret = ipipe_select_timers(&xnsched_realtime_cpus);
if (ret < 0)
......@@ -170,6 +181,25 @@ static int __init mach_setup(void)
}*/
#warning TODO: irq init
/* init escalate irq */
ret = -EAGAIN;
virq = irq_create_direct_mapping(synthetic_irq_domain);
if (WARN_ON(virq == 0))
return ret;
ret = __request_percpu_irq(virq,
cobalt_escalate_irq_handler,
IRQF_OOB,
"cobalt escalate",
&cobalt_escalate_devid);
if (WARN_ON(ret)) {
irq_dispose_mapping(virq);
return ret;
}
cobalt_pipeline.escalate_virq = virq;
/* ipipe_register_head(&xnsched_realtime_domain, "Xenomai");
ret = -EBUSY;
......@@ -203,6 +233,9 @@ static int __init mach_setup(void)
return 0;
fail_clock:
free_percpu_irq(cobalt_pipeline.escalate_virq,
&cobalt_escalate_devid);
irq_dispose_mapping(cobalt_pipeline.escalate_virq);
/* ipipe_free_irq(&xnsched_realtime_domain,
cobalt_pipeline.escalate_virq);
ipipe_free_virq(cobalt_pipeline.escalate_virq);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment