Xenomai 3.3.2
Loading...
Searching...
No Matches
intr.h
1/*
2 * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>.
3 *
4 * Xenomai is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * Xenomai is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Xenomai; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
18 */
19#ifndef _COBALT_KERNEL_INTR_H
20#define _COBALT_KERNEL_INTR_H
21
22#include <linux/spinlock.h>
23#include <cobalt/kernel/stat.h>
24#include <pipeline/irq.h>
25
31/* Possible return values of a handler. */
32#define XN_IRQ_NONE 0x1
33#define XN_IRQ_HANDLED 0x2
34#define XN_IRQ_STATMASK (XN_IRQ_NONE|XN_IRQ_HANDLED)
35#define XN_IRQ_PROPAGATE 0x100
36#define XN_IRQ_DISABLE 0x200
37
38/* Init flags. */
39#define XN_IRQTYPE_SHARED 0x1
40#define XN_IRQTYPE_EDGE 0x2
41
42/* Status bits. */
43#define XN_IRQSTAT_ATTACHED 0
44#define _XN_IRQSTAT_ATTACHED (1 << XN_IRQSTAT_ATTACHED)
45#define XN_IRQSTAT_DISABLED 1
46#define _XN_IRQSTAT_DISABLED (1 << XN_IRQSTAT_DISABLED)
47
48struct xnintr;
49struct xnsched;
50
51typedef int (*xnisr_t)(struct xnintr *intr);
52
53typedef void (*xniack_t)(unsigned irq, void *arg);
54
55struct xnirqstat {
57 xnstat_counter_t hits;
59 xnstat_exectime_t account;
61 xnstat_exectime_t sum;
62};
63
64struct xnintr {
65#ifdef CONFIG_XENO_OPT_SHIRQ
67 struct xnintr *next;
68#endif
70 unsigned int unhandled;
72 xnisr_t isr;
74 void *cookie;
76 unsigned long status;
78 int flags;
80 unsigned int irq;
82 xniack_t iack;
84 const char *name;
86 raw_spinlock_t lock;
87};
88
89struct xnintr_iterator {
90 int cpu;
91 unsigned long hits;
92 xnticks_t exectime_period;
93 xnticks_t account_period;
94 xnticks_t exectime_total;
95 int list_rev;
96 struct xnintr *prev;
97};
98
99void xnintr_core_clock_handler(void);
100
101void xnintr_host_tick(struct xnsched *sched);
102
103 /* Public interface. */
104
105int xnintr_init(struct xnintr *intr,
106 const char *name,
107 unsigned irq,
108 xnisr_t isr,
109 xniack_t iack,
110 int flags);
111
112void xnintr_destroy(struct xnintr *intr);
113
114int xnintr_attach(struct xnintr *intr,
115 void *cookie, const cpumask_t *cpumask);
116
117void xnintr_detach(struct xnintr *intr);
118
119void xnintr_enable(struct xnintr *intr);
120
121void xnintr_disable(struct xnintr *intr);
122
123int xnintr_affinity(struct xnintr *intr, const cpumask_t *cpumask);
124
127#endif /* !_COBALT_KERNEL_INTR_H */
Scheduling information structure.
Definition sched.h:64