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