XenevaOS
Loading...
Searching...
No Matches
XenevaOS
BaseHdr
asm
irq.h
Go to the documentation of this file.
1
#ifndef __ASM_IRQ_H__
2
#define __ASM_IRQ_H__
3
4
/*
5
* DCL <asm/irq.h> -- probe_irq_on()/probe_irq_off(), the ISA interrupt probe.
6
*
7
* mainline provides these only to architectures with legacy interrupt
8
* controllers that can be asked "which line fired?" by masking and unmasking
9
* them; arm64's GIC cannot be probed that way, and neither does anything
10
* Xeneva runs. They are still required here because 8250's autoconfig_irq()
11
* (8250_port.c:1234, 1241, 1256) calls them unconditionally while working out
12
* whether an ISA-style port has an interrupt line -- the calls sit outside
13
* any config arm.
14
*
15
* The answers are chosen to make that code take its *honest* branch:
16
*
17
* probe_irq_on() -> 0, "no interrupt is being probed for"
18
* probe_irq_off(0) -> -ENODEV, "and none was found"
19
*
20
* and autoconfig_irq() then does `port->irq = (irq > 0) ? irq : 0`
21
* (8250_port.c:1266), i.e. the port comes up interrupt-free. That is the
22
* correct result for a polled/console UART and the wrong result for nothing:
23
* a driver that believed it had an IRQ it never received would spin in the
24
* RX path waiting for a handler that is never installed, whereas irq 0 keeps
25
* every caller on the polling path they are already written for.
26
*
27
* Returning 0 from probe_irq_off() instead would have looked the same at that
28
* one call site and would have been wrong at the next, where -ENODEV is the
29
* documented "no IRQ" answer.
30
*/
31
#include <
linux/errno.h
>
/* -ENODEV */
32
33
static
inline
unsigned
long
probe_irq_on(
void
)
34
{
35
return
0;
36
}
37
38
static
inline
int
probe_irq_off(
unsigned
long
irqs)
39
{
40
(void)irqs;
41
return
-
ENODEV
;
42
}
43
44
#endif
/* __ASM_IRQ_H__ */
errno.h
ENODEV
#define ENODEV
Definition
acclib.h:197
Generated by
1.9.8