Skip to content

Commit 3795de2

Browse files
committed
genirq: Distangle kernel/irq/handle.c
kernel/irq/handle.c has become a dumpground for random code in random order. Split out the irq descriptor management and the dummy irq_chip implementation into separate files. Cleanup the include maze while at it. No code change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
1 parent f303a6d commit 3795de2

4 files changed

Lines changed: 340 additions & 332 deletions

File tree

‎kernel/irq/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
obj-y := handle.o manage.o spurious.o resend.o chip.o devres.o
2+
obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o
33
obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
44
obj-$(CONFIG_PROC_FS) += proc.o
55
obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o

‎kernel/irq/dummychip.c‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
3+
* Copyright (C) 2005-2006, Thomas Gleixner, Russell King
4+
*
5+
* This file contains the dummy interrupt chip implementation
6+
*/
7+
#include <linux/interrupt.h>
8+
#include <linux/irq.h>
9+
10+
#include "internals.h"
11+
12+
/*
13+
* What should we do if we get a hw irq event on an illegal vector?
14+
* Each architecture has to answer this themself.
15+
*/
16+
static void ack_bad(struct irq_data *data)
17+
{
18+
struct irq_desc *desc = irq_data_to_desc(data);
19+
20+
print_irq_desc(data->irq, desc);
21+
ack_bad_irq(data->irq);
22+
}
23+
24+
/*
25+
* NOP functions
26+
*/
27+
static void noop(struct irq_data *data) { }
28+
29+
static unsigned int noop_ret(struct irq_data *data)
30+
{
31+
return 0;
32+
}
33+
34+
#ifndef CONFIG_GENERIC_HARDIRQS_NO_CRUFT
35+
static void compat_noop(unsigned int irq) { }
36+
#define END_INIT .end = compat_noop
37+
#else
38+
#define END_INIT
39+
#endif
40+
41+
/*
42+
* Generic no controller implementation
43+
*/
44+
struct irq_chip no_irq_chip = {
45+
.name = "none",
46+
.irq_startup = noop_ret,
47+
.irq_shutdown = noop,
48+
.irq_enable = noop,
49+
.irq_disable = noop,
50+
.irq_ack = ack_bad,
51+
END_INIT
52+
};
53+
54+
/*
55+
* Generic dummy implementation which can be used for
56+
* real dumb interrupt sources
57+
*/
58+
struct irq_chip dummy_irq_chip = {
59+
.name = "dummy",
60+
.irq_startup = noop_ret,
61+
.irq_shutdown = noop,
62+
.irq_enable = noop,
63+
.irq_disable = noop,
64+
.irq_ack = noop,
65+
.irq_mask = noop,
66+
.irq_unmask = noop,
67+
END_INIT
68+
};

0 commit comments

Comments
 (0)