These functions do not use driver model but are fairly widely used in
U-Boot. Move them to a new irq_legacy.h header file.

Signed-off-by: Simon Glass <s...@chromium.org>
---

 arch/arc/lib/interrupts.c             |  1 +
 arch/arm/lib/interrupts.c             |  1 +
 arch/arm/lib/interrupts_64.c          |  1 +
 arch/arm/lib/interrupts_m.c           |  1 +
 arch/m68k/cpu/mcf5227x/interrupts.c   |  1 +
 arch/m68k/cpu/mcf523x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf52x2/interrupts.c    |  1 +
 arch/m68k/cpu/mcf530x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf532x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf5445x/interrupts.c   |  1 +
 arch/m68k/cpu/mcf547x_8x/interrupts.c |  1 +
 arch/m68k/cpu/mcf547x_8x/slicetimer.c |  1 +
 arch/m68k/lib/interrupts.c            |  1 +
 arch/m68k/lib/time.c                  |  1 +
 arch/microblaze/cpu/interrupts.c      |  1 +
 arch/mips/cpu/interrupts.c            |  1 +
 arch/mips/mach-jz47xx/jz4780/timer.c  |  1 +
 arch/nds32/cpu/n1213/ag101/timer.c    |  1 +
 arch/nds32/lib/interrupts.c           |  1 +
 arch/nios2/cpu/interrupts.c           |  1 +
 arch/powerpc/cpu/mpc83xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc85xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc85xx/traps.c      |  1 +
 arch/powerpc/cpu/mpc86xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc8xx/interrupts.c  |  1 +
 arch/powerpc/lib/interrupts.c         |  1 +
 arch/riscv/lib/interrupts.c           |  1 +
 arch/sandbox/lib/interrupts.c         |  1 +
 arch/sh/cpu/sh4/interrupts.c          |  1 +
 arch/x86/cpu/i386/interrupt.c         |  1 +
 arch/x86/cpu/x86_64/interrupts.c      |  1 +
 arch/x86/lib/bios.c                   |  1 +
 arch/x86/lib/interrupts.c             |  1 +
 arch/x86/lib/spl.c                    |  1 +
 arch/xtensa/cpu/exceptions.c          |  1 +
 common/board_r.c                      |  1 +
 common/spl/spl.c                      |  1 +
 drivers/mtd/cfi_flash.c               |  1 +
 drivers/timer/mpc83xx_timer.c         |  1 +
 include/common.h                      |  7 -------
 include/exports.h                     |  2 ++
 include/irq_legacy.h                  | 17 +++++++++++++++++
 42 files changed, 58 insertions(+), 7 deletions(-)
 create mode 100644 include/irq_legacy.h

diff --git a/arch/arc/lib/interrupts.c b/arch/arc/lib/interrupts.c
index 24ff7512209..4aef49aea3d 100644
--- a/arch/arc/lib/interrupts.c
+++ b/arch/arc/lib/interrupts.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/arcregs.h>
 #include <asm/ptrace.h>
 
diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
index e78ca56d253..82802c0004c 100644
--- a/arch/arm/lib/interrupts.c
+++ b/arch/arm/lib/interrupts.c
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <irq_legacy.h>
 #include <asm/proc-armv/ptrace.h>
 #include <asm/u-boot-arm.h>
 
diff --git a/arch/arm/lib/interrupts_64.c b/arch/arm/lib/interrupts_64.c
index 0bfdb8d93d2..f2694779dc0 100644
--- a/arch/arm/lib/interrupts_64.c
+++ b/arch/arm/lib/interrupts_64.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <linux/compiler.h>
 #include <efi_loader.h>
 
diff --git a/arch/arm/lib/interrupts_m.c b/arch/arm/lib/interrupts_m.c
index 95df6cb1eb8..6a4beaf3ece 100644
--- a/arch/arm/lib/interrupts_m.c
+++ b/arch/arm/lib/interrupts_m.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 
 /*
  * Upon exception entry ARMv7-M processors automatically save stack
diff --git a/arch/m68k/cpu/mcf5227x/interrupts.c 
b/arch/m68k/cpu/mcf5227x/interrupts.c
index d38f01950b1..0d0ad5ed022 100644
--- a/arch/m68k/cpu/mcf5227x/interrupts.c
+++ b/arch/m68k/cpu/mcf5227x/interrupts.c
@@ -10,6 +10,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf523x/interrupts.c 
b/arch/m68k/cpu/mcf523x/interrupts.c
index 1d03724f15c..a524801151d 100644
--- a/arch/m68k/cpu/mcf523x/interrupts.c
+++ b/arch/m68k/cpu/mcf523x/interrupts.c
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf52x2/interrupts.c 
b/arch/m68k/cpu/mcf52x2/interrupts.c
index f874675b12f..4b20cf5751b 100644
--- a/arch/m68k/cpu/mcf52x2/interrupts.c
+++ b/arch/m68k/cpu/mcf52x2/interrupts.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <watchdog.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
diff --git a/arch/m68k/cpu/mcf530x/interrupts.c 
b/arch/m68k/cpu/mcf530x/interrupts.c
index cd85c69f129..9e61de7d952 100644
--- a/arch/m68k/cpu/mcf530x/interrupts.c
+++ b/arch/m68k/cpu/mcf530x/interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf532x/interrupts.c 
b/arch/m68k/cpu/mcf532x/interrupts.c
index 43a903ed72e..83c9c2e1b35 100644
--- a/arch/m68k/cpu/mcf532x/interrupts.c
+++ b/arch/m68k/cpu/mcf532x/interrupts.c
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf5445x/interrupts.c 
b/arch/m68k/cpu/mcf5445x/interrupts.c
index d38f01950b1..0d0ad5ed022 100644
--- a/arch/m68k/cpu/mcf5445x/interrupts.c
+++ b/arch/m68k/cpu/mcf5445x/interrupts.c
@@ -10,6 +10,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf547x_8x/interrupts.c 
b/arch/m68k/cpu/mcf547x_8x/interrupts.c
index 2cdf53ea09c..934343bc4a9 100644
--- a/arch/m68k/cpu/mcf547x_8x/interrupts.c
+++ b/arch/m68k/cpu/mcf547x_8x/interrupts.c
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
diff --git a/arch/m68k/cpu/mcf547x_8x/slicetimer.c 
b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
index 544bfd20831..7ced4db5f13 100644
--- a/arch/m68k/cpu/mcf547x_8x/slicetimer.c
+++ b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 
 #include <asm/timer.h>
 #include <asm/immap.h>
diff --git a/arch/m68k/lib/interrupts.c b/arch/m68k/lib/interrupts.c
index 85ae3b4ee07..00953ac92f1 100644
--- a/arch/m68k/lib/interrupts.c
+++ b/arch/m68k/lib/interrupts.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <watchdog.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
diff --git a/arch/m68k/lib/time.c b/arch/m68k/lib/time.c
index c76c5fedc99..9b5364b4a41 100644
--- a/arch/m68k/lib/time.c
+++ b/arch/m68k/lib/time.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <time.h>
 
 #include <asm/timer.h>
diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index aea612eef15..900cc618243 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <fdtdec.h>
+#include <irq_legacy.h>
 #include <malloc.h>
 #include <asm/microblaze_intc.h>
 #include <asm/asm.h>
diff --git a/arch/mips/cpu/interrupts.c b/arch/mips/cpu/interrupts.c
index 1c5192ed33f..05e4b0fdca9 100644
--- a/arch/mips/cpu/interrupts.c
+++ b/arch/mips/cpu/interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 
 int interrupt_init(void)
 {
diff --git a/arch/mips/mach-jz47xx/jz4780/timer.c 
b/arch/mips/mach-jz47xx/jz4780/timer.c
index 988ebd26715..e2d38e63734 100644
--- a/arch/mips/mach-jz47xx/jz4780/timer.c
+++ b/arch/mips/mach-jz47xx/jz4780/timer.c
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <div64.h>
+#include <irq_legacy.h>
 #include <time.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
diff --git a/arch/nds32/cpu/n1213/ag101/timer.c 
b/arch/nds32/cpu/n1213/ag101/timer.c
index cbfe07e3514..21a9044b983 100644
--- a/arch/nds32/cpu/n1213/ag101/timer.c
+++ b/arch/nds32/cpu/n1213/ag101/timer.c
@@ -9,6 +9,7 @@
  */
 #ifndef CONFIG_TIMER
 #include <common.h>
+#include <irq_legacy.h>
 #include <time.h>
 #include <asm/io.h>
 #include <faraday/fttmr010.h>
diff --git a/arch/nds32/lib/interrupts.c b/arch/nds32/lib/interrupts.c
index 966c19a1ae5..1a47c5c3a94 100644
--- a/arch/nds32/lib/interrupts.c
+++ b/arch/nds32/lib/interrupts.c
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #undef INTERRUPT_MODE
diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 96c30209353..e414b4feac1 100644
--- a/arch/nios2/cpu/interrupts.c
+++ b/arch/nios2/cpu/interrupts.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_legacy.h>
 #include <asm/nios2.h>
 #include <asm/types.h>
 #include <asm/io.h>
diff --git a/arch/powerpc/cpu/mpc83xx/interrupts.c 
b/arch/powerpc/cpu/mpc83xx/interrupts.c
index 04cd1473214..5bee590b769 100644
--- a/arch/powerpc/cpu/mpc83xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc83xx/interrupts.c
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_legacy.h>
 #include <mpc83xx.h>
 #include <asm/processor.h>
 
diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c 
b/arch/powerpc/cpu/mpc85xx/interrupts.c
index b5a6ead8bde..7e862f11f32 100644
--- a/arch/powerpc/cpu/mpc85xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc85xx/interrupts.c
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc85xx/traps.c b/arch/powerpc/cpu/mpc85xx/traps.c
index e1d492f05a9..9a249c9b402 100644
--- a/arch/powerpc/cpu/mpc85xx/traps.c
+++ b/arch/powerpc/cpu/mpc85xx/traps.c
@@ -21,6 +21,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_legacy.h>
 #include <kgdb.h>
 #include <asm/processor.h>
 
diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c 
b/arch/powerpc/cpu/mpc86xx/interrupts.c
index 04c8f25af60..176c2b06c99 100644
--- a/arch/powerpc/cpu/mpc86xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc86xx/interrupts.c
@@ -15,6 +15,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <mpc86xx.h>
 #include <command.h>
 #include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c 
b/arch/powerpc/cpu/mpc8xx/interrupts.c
index 26aa7a56455..03579ef4a66 100644
--- a/arch/powerpc/cpu/mpc8xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc8xx/interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <mpc8xx.h>
 #include <mpc8xx_irq.h>
 #include <asm/cpm_8xx.h>
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index a58ddfa569c..906713575d7 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/processor.h>
 #include <watchdog.h>
 #ifdef CONFIG_LED_STATUS
diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
index 74c1e561c71..b82b8006301 100644
--- a/arch/riscv/lib/interrupts.c
+++ b/arch/riscv/lib/interrupts.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #include <asm/encoding.h>
diff --git a/arch/sandbox/lib/interrupts.c b/arch/sandbox/lib/interrupts.c
index 4ddcd37522d..a0a5373c237 100644
--- a/arch/sandbox/lib/interrupts.c
+++ b/arch/sandbox/lib/interrupts.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 
 int interrupt_init(void)
 {
diff --git a/arch/sh/cpu/sh4/interrupts.c b/arch/sh/cpu/sh4/interrupts.c
index 5982aad54eb..5cb1fcf7ba3 100644
--- a/arch/sh/cpu/sh4/interrupts.c
+++ b/arch/sh/cpu/sh4/interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 
 int interrupt_init(void)
 {
diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c
index 1445204878c..24d034787c0 100644
--- a/arch/x86/cpu/i386/interrupt.c
+++ b/arch/x86/cpu/i386/interrupt.c
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
+#include <irq_legacy.h>
 #include <asm/control_regs.h>
 #include <asm/i8259.h>
 #include <asm/interrupt.h>
diff --git a/arch/x86/cpu/x86_64/interrupts.c b/arch/x86/cpu/x86_64/interrupts.c
index 15830d6a1a0..270162f4616 100644
--- a/arch/x86/cpu/x86_64/interrupts.c
+++ b/arch/x86/cpu/x86_64/interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/processor-flags.h>
 
 void enable_interrupts(void)
diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c
index b990f53bfd7..7ca72d15798 100644
--- a/arch/x86/lib/bios.c
+++ b/arch/x86/lib/bios.c
@@ -7,6 +7,7 @@
  */
 #include <common.h>
 #include <bios_emul.h>
+#include <irq_legacy.h>
 #include <vbe.h>
 #include <linux/linkage.h>
 #include <asm/cache.h>
diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c
index 39f8deaed13..d3f1b4bf910 100644
--- a/arch/x86/lib/interrupts.c
+++ b/arch/x86/lib/interrupts.c
@@ -30,6 +30,7 @@
  */
 
 #include <common.h>
+#include <irq_legacy.h>
 #include <asm/interrupt.h>
 
 #if !CONFIG_IS_ENABLED(X86_64)
diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c
index 8594ec56b61..96739926fe1 100644
--- a/arch/x86/lib/spl.c
+++ b/arch/x86/lib/spl.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <cpu_legacy.h>
 #include <debug_uart.h>
+#include <irq_legacy.h>
 #include <malloc.h>
 #include <spl.h>
 #include <asm/cpu.h>
diff --git a/arch/xtensa/cpu/exceptions.c b/arch/xtensa/cpu/exceptions.c
index fe2dedf3c4b..6e70f322afd 100644
--- a/arch/xtensa/cpu/exceptions.c
+++ b/arch/xtensa/cpu/exceptions.c
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_legacy.h>
 #include <asm/string.h>
 #include <asm/regs.h>
 
diff --git a/common/board_r.c b/common/board_r.c
index 1aee896e438..a7a92b4de57 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -28,6 +28,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
 #endif
+#include <irq_legacy.h>
 #include <malloc.h>
 #include <mapmem.h>
 #ifdef CONFIG_BITBANGMII
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 5b0927cecbb..b06ce0ce1ba 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -11,6 +11,7 @@
 #include <binman_sym.h>
 #include <dm.h>
 #include <handoff.h>
+#include <irq_legacy.h>
 #include <serial.h>
 #include <spl.h>
 #include <asm/u-boot.h>
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index c59254c76e3..9271ed8e7a7 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -22,6 +22,7 @@
 #include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
+#include <irq_legacy.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c
index 69949d53338..773f0c310ab 100644
--- a/drivers/timer/mpc83xx_timer.c
+++ b/drivers/timer/mpc83xx_timer.c
@@ -8,6 +8,7 @@
 #include <board.h>
 #include <clk.h>
 #include <dm.h>
+#include <irq_legacy.h>
 #include <status_led.h>
 #include <time.h>
 #include <timer.h>
diff --git a/include/common.h b/include/common.h
index 6dedb37a067..81387d561e2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -208,13 +208,6 @@ ulong      get_bus_freq  (ulong);
 int get_serial_clock(void);
 
 /* $(CPU)/interrupts.c */
-int    interrupt_init     (void);
-void   timer_interrupt    (struct pt_regs *);
-void   external_interrupt (struct pt_regs *);
-void   irq_install_handler(int, interrupt_handler_t *, void *);
-void   irq_free_handler   (int);
-void   reset_timer        (void);
-
 void   enable_interrupts  (void);
 int    disable_interrupts (void);
 
diff --git a/include/exports.h b/include/exports.h
index 147a00f860b..fc06c83f848 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -1,6 +1,8 @@
 #ifndef __EXPORTS_H__
 #define __EXPORTS_H__
 
+#include <irq_legacy.h>
+
 #ifndef __ASSEMBLY__
 #ifdef CONFIG_PHY_AQUANTIA
 #include <env.h>
diff --git a/include/irq_legacy.h b/include/irq_legacy.h
new file mode 100644
index 00000000000..72a3af65d7a
--- /dev/null
+++ b/include/irq_legacy.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ */
+
+#ifndef __IRQ_LEGACY_H
+#define __IRQ_LEGACY_H
+
+int interrupt_init(void);
+void timer_interrupt(struct pt_regs *regs);
+void external_interrupt(struct pt_regs *regs);
+void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg);
+void irq_free_handler(int vec);
+void reset_timer(void);
+
+#endif
-- 
2.23.0.444.g18eeb5a265-goog

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to