Xenomai 3.3.2
Loading...
Searching...
No Matches
irq.h
1/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright (C) 2017 Philippe Gerum <rpm@xenomai.org>
5 */
6
7#ifndef _COBALT_DOVETAIL_IRQ_H
8#define _COBALT_DOVETAIL_IRQ_H
9
10#ifdef CONFIG_XENOMAI
11
12#include <cobalt/kernel/sched.h>
13
14/* hard irqs off. */
15static inline void irq_enter_pipeline(void)
16{
17 struct xnsched *sched = xnsched_current();
18
19 sched->lflags |= XNINIRQ;
20}
21
22/* hard irqs off. */
23static inline void irq_exit_pipeline(void)
24{
25 struct xnsched *sched = xnsched_current();
26
27 sched->lflags &= ~XNINIRQ;
28
29 /*
30 * CAUTION: Switching stages as a result of rescheduling may
31 * re-enable irqs, shut them off before returning if so.
32 */
33 if ((sched->status|sched->lflags) & XNRESCHED) {
35 if (!hard_irqs_disabled())
36 hard_local_irq_disable();
37 }
38}
39
40#else /* !CONFIG_XENOMAI */
41
42static inline void irq_enter_pipeline(void)
43{
44}
45
46static inline void irq_exit_pipeline(void)
47{
48}
49
50#endif /* !CONFIG_XENOMAI */
51
52#endif /* !_COBALT_DOVETAIL_IRQ_H */
static int xnsched_run(void)
The rescheduling procedure.
Definition sched.h:312
Scheduling information structure.
Definition sched.h:64
unsigned long status
Definition sched.h:66
unsigned long lflags
Definition sched.h:68