cobalt/timer: create and register TIMER_OOB_IPI handler
PATCH 2/4 cobalt/timer: create and register TIMER_OOB_IPI handler
1.create and register TIMER_OOB_IPI handler.
2.declare global xn_machine_cpudata so that it can be shared with other irq request.
Signed-off-by hongzha1 <[email protected]>
include/cobalt/kernel/sched.h +6 -0
@@ -31,6 +31,12 @@#include <cobalt/kernel/assert.h> #include <asm/xenomai/machine.h> + +struct xn_machine_cpudata { +}; + +DECLARE_PER_CPU(struct xn_machine_cpudata, xn_machine_cpudata); +/** * @addtogroup cobalt_core_sched * @{
kernel/cobalt/init.c +2 -0
@@ -37,6 +37,8 @@#include "posix/internal.h" #include "procfs.h" +DEFINE_PER_CPU(struct xn_machine_cpudata, xn_machine_cpudata); +EXPORT_PER_CPU_SYMBOL_GPL (xn_machine_cpudata); static DEFINE_PER_CPU(int, cobalt_escalate_devid);/**
kernel/cobalt/sched.c +0 -5
@@ -30,11 +30,6 @@#define CREATE_TRACE_POINTS #include <trace/events/cobalt-core.h> -struct xn_machine_cpudata { -}; - -DEFINE_PER_CPU(struct xn_machine_cpudata, xn_machine_cpudata); -static void xnsched_destroy (struct xnsched *sched);/**
kernel/cobalt/timer.c +13 -0
@@ -576,6 +576,13 @@ void __xntimer_set_affinity(struct xntimer *timer, struct xnsched *sched) }EXPORT_SYMBOL_GPL (__xntimer_set_affinity); +static irqreturn_t clock_ipi_handler (int irq,void *dev_id) +{ +xnintr_core_clock_handler (); + +return IRQ_HANDLED ; +} +int xntimer_setup_ipi (void ) {#warning TODO
@@ -583,12 +590,18 @@ int xntimer_setup_ipi(void)IPIPE_HRTIMER_IPI, (ipipe_irq_handler_t)xnintr_core_clock_handler, NULL, NULL);*/ +return __request_percpu_irq (TIMER_OOB_IPI , + clock_ipi_handler, +IRQF_OOB ,"Xenomai timer IPI" , + &xn_machine_cpudata); }void xntimer_release_ipi (void ) {#warning TODO//ipipe_free_irq(&xnsched_realtime_domain, IPIPE_HRTIMER_IPI); +free_percpu_irq (TIMER_OOB_IPI , + &xn_machine_cpudata); }#endif /* CONFIG_SMP */
Signature · 1 line
2.17.1