Commit c30b7adbcaa88511e7f6095e0683d83cc958bb30

Authored by Simon Glass
Committed by Tom Rini
1 parent 9d3915b2df

common: Move interrupt functions into a new header

These functions do not use driver model but are fairly widely used in
U-Boot. But it is not clear that they will use driver model anytime soon,
so we don't want to label them as 'legacy'.

Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it
is widely used in U-Boot already.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

Showing 42 changed files with 60 additions and 7 deletions Side-by-side Diff

arch/arc/lib/interrupts.c
... ... @@ -4,6 +4,7 @@
4 4 */
5 5  
6 6 #include <common.h>
  7 +#include <irq_func.h>
7 8 #include <asm/arcregs.h>
8 9 #include <asm/ptrace.h>
9 10  
arch/arm/lib/interrupts.c
... ... @@ -20,6 +20,7 @@
20 20  
21 21 #include <common.h>
22 22 #include <efi_loader.h>
  23 +#include <irq_func.h>
23 24 #include <asm/proc-armv/ptrace.h>
24 25 #include <asm/u-boot-arm.h>
25 26  
arch/arm/lib/interrupts_64.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9 #include <linux/compiler.h>
9 10 #include <efi_loader.h>
10 11  
arch/arm/lib/interrupts_m.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9  
9 10 /*
10 11 * Upon exception entry ARMv7-M processors automatically save stack
arch/m68k/cpu/mcf5227x/interrupts.c
... ... @@ -10,6 +10,7 @@
10 10  
11 11 /* CPU specific interrupt routine */
12 12 #include <common.h>
  13 +#include <irq_func.h>
13 14 #include <asm/immap.h>
14 15 #include <asm/io.h>
15 16  
arch/m68k/cpu/mcf523x/interrupts.c
... ... @@ -7,6 +7,7 @@
7 7  
8 8 /* CPU specific interrupt routine */
9 9 #include <common.h>
  10 +#include <irq_func.h>
10 11 #include <asm/immap.h>
11 12 #include <asm/io.h>
12 13  
arch/m68k/cpu/mcf52x2/interrupts.c
... ... @@ -8,6 +8,7 @@
8 8 */
9 9  
10 10 #include <common.h>
  11 +#include <irq_func.h>
11 12 #include <watchdog.h>
12 13 #include <asm/processor.h>
13 14 #include <asm/immap.h>
arch/m68k/cpu/mcf530x/interrupts.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9 #include <asm/immap.h>
9 10 #include <asm/io.h>
10 11  
arch/m68k/cpu/mcf532x/interrupts.c
... ... @@ -7,6 +7,7 @@
7 7  
8 8 /* CPU specific interrupt routine */
9 9 #include <common.h>
  10 +#include <irq_func.h>
10 11 #include <asm/immap.h>
11 12 #include <asm/io.h>
12 13  
arch/m68k/cpu/mcf5445x/interrupts.c
... ... @@ -10,6 +10,7 @@
10 10  
11 11 /* CPU specific interrupt routine */
12 12 #include <common.h>
  13 +#include <irq_func.h>
13 14 #include <asm/immap.h>
14 15 #include <asm/io.h>
15 16  
arch/m68k/cpu/mcf547x_8x/interrupts.c
... ... @@ -7,6 +7,7 @@
7 7  
8 8 /* CPU specific interrupt routine */
9 9 #include <common.h>
  10 +#include <irq_func.h>
10 11 #include <asm/immap.h>
11 12 #include <asm/io.h>
12 13  
arch/m68k/cpu/mcf547x_8x/slicetimer.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9  
9 10 #include <asm/timer.h>
10 11 #include <asm/immap.h>
arch/m68k/lib/interrupts.c
... ... @@ -8,6 +8,7 @@
8 8 */
9 9  
10 10 #include <common.h>
  11 +#include <irq_func.h>
11 12 #include <watchdog.h>
12 13 #include <asm/processor.h>
13 14 #include <asm/immap.h>
arch/m68k/lib/time.c
... ... @@ -7,6 +7,7 @@
7 7 */
8 8  
9 9 #include <common.h>
  10 +#include <irq_func.h>
10 11 #include <time.h>
11 12  
12 13 #include <asm/timer.h>
arch/microblaze/cpu/interrupts.c
... ... @@ -10,6 +10,7 @@
10 10 #include <common.h>
11 11 #include <command.h>
12 12 #include <fdtdec.h>
  13 +#include <irq_func.h>
13 14 #include <malloc.h>
14 15 #include <asm/microblaze_intc.h>
15 16 #include <asm/asm.h>
arch/mips/cpu/interrupts.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9  
9 10 int interrupt_init(void)
10 11 {
arch/mips/mach-jz47xx/jz4780/timer.c
... ... @@ -9,6 +9,7 @@
9 9 #include <config.h>
10 10 #include <common.h>
11 11 #include <div64.h>
  12 +#include <irq_func.h>
12 13 #include <time.h>
13 14 #include <asm/io.h>
14 15 #include <asm/mipsregs.h>
arch/nds32/cpu/n1213/ag101/timer.c
... ... @@ -9,6 +9,7 @@
9 9 */
10 10 #ifndef CONFIG_TIMER
11 11 #include <common.h>
  12 +#include <irq_func.h>
12 13 #include <time.h>
13 14 #include <asm/io.h>
14 15 #include <faraday/fttmr010.h>
arch/nds32/lib/interrupts.c
... ... @@ -10,6 +10,7 @@
10 10 */
11 11  
12 12 #include <common.h>
  13 +#include <irq_func.h>
13 14 #include <asm/ptrace.h>
14 15 #include <asm/system.h>
15 16 #undef INTERRUPT_MODE
arch/nios2/cpu/interrupts.c
... ... @@ -9,6 +9,7 @@
9 9  
10 10 #include <common.h>
11 11 #include <command.h>
  12 +#include <irq_func.h>
12 13 #include <asm/nios2.h>
13 14 #include <asm/types.h>
14 15 #include <asm/io.h>
arch/powerpc/cpu/mpc83xx/interrupts.c
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #include <common.h>
10 10 #include <command.h>
  11 +#include <irq_func.h>
11 12 #include <mpc83xx.h>
12 13 #include <asm/processor.h>
13 14  
arch/powerpc/cpu/mpc85xx/interrupts.c
... ... @@ -11,6 +11,7 @@
11 11 */
12 12  
13 13 #include <common.h>
  14 +#include <irq_func.h>
14 15 #include <watchdog.h>
15 16 #include <command.h>
16 17 #include <asm/processor.h>
arch/powerpc/cpu/mpc85xx/traps.c
... ... @@ -21,6 +21,7 @@
21 21  
22 22 #include <common.h>
23 23 #include <command.h>
  24 +#include <irq_func.h>
24 25 #include <kgdb.h>
25 26 #include <asm/processor.h>
26 27  
arch/powerpc/cpu/mpc86xx/interrupts.c
... ... @@ -15,6 +15,7 @@
15 15 */
16 16  
17 17 #include <common.h>
  18 +#include <irq_func.h>
18 19 #include <mpc86xx.h>
19 20 #include <command.h>
20 21 #include <asm/processor.h>
arch/powerpc/cpu/mpc8xx/interrupts.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9 #include <mpc8xx.h>
9 10 #include <mpc8xx_irq.h>
10 11 #include <asm/cpm_8xx.h>
arch/powerpc/lib/interrupts.c
... ... @@ -8,6 +8,7 @@
8 8 */
9 9  
10 10 #include <common.h>
  11 +#include <irq_func.h>
11 12 #include <asm/processor.h>
12 13 #include <watchdog.h>
13 14 #ifdef CONFIG_LED_STATUS
arch/riscv/lib/interrupts.c
... ... @@ -8,6 +8,7 @@
8 8 */
9 9  
10 10 #include <common.h>
  11 +#include <irq_func.h>
11 12 #include <asm/ptrace.h>
12 13 #include <asm/system.h>
13 14 #include <asm/encoding.h>
arch/sandbox/lib/interrupts.c
... ... @@ -6,6 +6,7 @@
6 6 */
7 7  
8 8 #include <common.h>
  9 +#include <irq_func.h>
9 10  
10 11 int interrupt_init(void)
11 12 {
arch/sh/cpu/sh4/interrupts.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9  
9 10 int interrupt_init(void)
10 11 {
arch/x86/cpu/i386/interrupt.c
... ... @@ -13,6 +13,7 @@
13 13 #include <common.h>
14 14 #include <dm.h>
15 15 #include <efi_loader.h>
  16 +#include <irq_func.h>
16 17 #include <asm/control_regs.h>
17 18 #include <asm/i8259.h>
18 19 #include <asm/interrupt.h>
arch/x86/cpu/x86_64/interrupts.c
... ... @@ -5,6 +5,7 @@
5 5 */
6 6  
7 7 #include <common.h>
  8 +#include <irq_func.h>
8 9 #include <asm/processor-flags.h>
9 10  
10 11 void enable_interrupts(void)
... ... @@ -7,6 +7,7 @@
7 7 */
8 8 #include <common.h>
9 9 #include <bios_emul.h>
  10 +#include <irq_func.h>
10 11 #include <vbe.h>
11 12 #include <linux/linkage.h>
12 13 #include <asm/cache.h>
arch/x86/lib/interrupts.c
... ... @@ -30,6 +30,7 @@
30 30 */
31 31  
32 32 #include <common.h>
  33 +#include <irq_func.h>
33 34 #include <asm/interrupt.h>
34 35  
35 36 #if !CONFIG_IS_ENABLED(X86_64)
... ... @@ -7,6 +7,7 @@
7 7 #include <cpu_func.h>
8 8 #include <debug_uart.h>
9 9 #include <dm.h>
  10 +#include <irq_func.h>
10 11 #include <malloc.h>
11 12 #include <spl.h>
12 13 #include <syscon.h>
arch/xtensa/cpu/exceptions.c
... ... @@ -12,6 +12,7 @@
12 12  
13 13 #include <common.h>
14 14 #include <command.h>
  15 +#include <irq_func.h>
15 16 #include <asm/string.h>
16 17 #include <asm/regs.h>
17 18  
... ... @@ -28,6 +28,7 @@
28 28 #if defined(CONFIG_CMD_KGDB)
29 29 #include <kgdb.h>
30 30 #endif
  31 +#include <irq_func.h>
31 32 #include <malloc.h>
32 33 #include <mapmem.h>
33 34 #ifdef CONFIG_BITBANGMII
... ... @@ -11,6 +11,7 @@
11 11 #include <binman_sym.h>
12 12 #include <dm.h>
13 13 #include <handoff.h>
  14 +#include <irq_func.h>
14 15 #include <serial.h>
15 16 #include <spl.h>
16 17 #include <asm/u-boot.h>
drivers/mtd/cfi_flash.c
... ... @@ -22,6 +22,7 @@
22 22 #include <env.h>
23 23 #include <errno.h>
24 24 #include <fdt_support.h>
  25 +#include <irq_func.h>
25 26 #include <asm/processor.h>
26 27 #include <asm/io.h>
27 28 #include <asm/byteorder.h>
drivers/timer/mpc83xx_timer.c
... ... @@ -8,6 +8,7 @@
8 8 #include <board.h>
9 9 #include <clk.h>
10 10 #include <dm.h>
  11 +#include <irq_func.h>
11 12 #include <status_led.h>
12 13 #include <time.h>
13 14 #include <timer.h>
... ... @@ -208,13 +208,6 @@
208 208 int get_serial_clock(void);
209 209  
210 210 /* $(CPU)/interrupts.c */
211   -int interrupt_init (void);
212   -void timer_interrupt (struct pt_regs *);
213   -void external_interrupt (struct pt_regs *);
214   -void irq_install_handler(int, interrupt_handler_t *, void *);
215   -void irq_free_handler (int);
216   -void reset_timer (void);
217   -
218 211 void enable_interrupts (void);
219 212 int disable_interrupts (void);
220 213  
1 1 #ifndef __EXPORTS_H__
2 2 #define __EXPORTS_H__
3 3  
  4 +#include <irq_func.h>
  5 +
4 6 #ifndef __ASSEMBLY__
5 7 #ifdef CONFIG_PHY_AQUANTIA
6 8 #include <env.h>
  1 +/* SPDX-License-Identifier: GPL-2.0+ */
  2 +/*
  3 + * Header file for interrupt functions
  4 + *
  5 + * (C) Copyright 2000-2009
  6 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7 + */
  8 +
  9 +#ifndef __IRQ_FUNC_H
  10 +#define __IRQ_FUNC_H
  11 +
  12 +int interrupt_init(void);
  13 +void timer_interrupt(struct pt_regs *regs);
  14 +void external_interrupt(struct pt_regs *regs);
  15 +void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg);
  16 +void irq_free_handler(int vec);
  17 +void reset_timer(void);
  18 +
  19 +#endif