Skip to content

Commit

Permalink
common: Move enable/disable_interrupts out of common.h
Browse files Browse the repository at this point in the history
Move these two functions into the irq_funcs.h header file. Also move
interrupt_handler_t as this is used by the irq_install_handler() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
  • Loading branch information
sjg20 authored and trini committed Dec 2, 2019
1 parent c30b7ad commit 36bf446
Show file tree
Hide file tree
Showing 61 changed files with 69 additions and 7 deletions.
1 change: 1 addition & 0 deletions arch/arc/lib/bootm.c
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
*/

#include <irq_func.h>
#include <asm/cache.h>
#include <common.h>

Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/arm11/cpu.c
Expand Up @@ -17,6 +17,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>

static void cache_flush(void);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/arm920t/cpu.c
Expand Up @@ -15,6 +15,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>

static void cache_flush(void);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/arm926ejs/cpu.c
Expand Up @@ -15,6 +15,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>

static void cache_flush(void);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/arm946es/cpu.c
Expand Up @@ -15,6 +15,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>
#include <asm/io.h>

Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/armv7/cpu.c
Expand Up @@ -17,6 +17,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>
#include <asm/cache.h>
#include <asm/armv7.h>
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/armv7m/cpu.c
Expand Up @@ -9,6 +9,7 @@

#include <common.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/io.h>
#include <asm/armv7m.h>

Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/armv8/cpu.c
Expand Up @@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>
#include <asm/secure.h>
#include <linux/compiler.h>
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/pxa/pxa2xx.c
Expand Up @@ -11,6 +11,7 @@

#include <common.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/arch/pxa-regs.h>
#include <asm/io.h>
#include <asm/system.h>
Expand Down
1 change: 1 addition & 0 deletions arch/arm/cpu/sa1100/cpu.c
Expand Up @@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <asm/system.h>
#include <asm/io.h>

Expand Down
1 change: 1 addition & 0 deletions arch/arm/lib/reset.c
Expand Up @@ -21,6 +21,7 @@
*/

#include <common.h>
#include <irq_func.h>

__weak void reset_misc(void)
{
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-tegra/cmd_enterrcm.c
Expand Up @@ -25,6 +25,7 @@
*/

#include <common.h>
#include <irq_func.h>
#include <asm/arch/tegra.h>
#include <asm/arch-tegra/pmc.h>

Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/include/asm/microblaze_intc.h
Expand Up @@ -5,6 +5,8 @@
* Michal SIMEK <monstr@monstr.cz>
*/

#include <irq_func.h>

typedef volatile struct microblaze_intc_t {
int isr; /* interrupt status register */
int ipr; /* interrupt pending register */
Expand Down
1 change: 1 addition & 0 deletions arch/nds32/cpu/n1213/ag101/cpu.c
Expand Up @@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <watchdog.h>
#include <asm/cache.h>

Expand Down
1 change: 1 addition & 0 deletions arch/nios2/cpu/cpu.c
Expand Up @@ -9,6 +9,7 @@
#include <cpu_func.h>
#include <dm.h>
#include <errno.h>
#include <irq_func.h>
#include <asm/cache.h>

DECLARE_GLOBAL_DATA_PTR;
Expand Down
1 change: 1 addition & 0 deletions arch/nios2/lib/bootm.c
Expand Up @@ -6,6 +6,7 @@

#include <common.h>
#include <cpu_func.h>
#include <irq_func.h>

#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/cpu/mpc83xx/cpu.c
Expand Up @@ -11,6 +11,7 @@

#include <common.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/cpu/mpc83xx/ecc.c
Expand Up @@ -7,6 +7,7 @@
*/

#include <common.h>
#include <irq_func.h>
#include <mpc83xx.h>
#include <command.h>

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/cpu/mpc85xx/cpu.c
Expand Up @@ -11,6 +11,7 @@
#include <config.h>
#include <common.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
Expand Down
1 change: 1 addition & 0 deletions arch/riscv/cpu/generic/cpu.c
Expand Up @@ -5,6 +5,7 @@

#include <common.h>
#include <dm.h>
#include <irq_func.h>

/*
* cleanup_before_linux() is called just before we call linux
Expand Down
1 change: 1 addition & 0 deletions arch/sh/cpu/sh4/cpu.c
Expand Up @@ -6,6 +6,7 @@

#include <common.h>
#include <command.h>
#include <irq_func.h>
#include <cpu_func.h>
#include <netdev.h>
#include <asm/processor.h>
Expand Down
1 change: 1 addition & 0 deletions arch/sh/lib/zimageboot.c
Expand Up @@ -10,6 +10,7 @@
*/

#include <common.h>
#include <irq_func.h>
#include <asm/io.h>
#include <asm/zimage.h>

Expand Down
1 change: 1 addition & 0 deletions arch/x86/lib/zimage.c
Expand Up @@ -14,6 +14,7 @@

#include <common.h>
#include <env.h>
#include <irq_func.h>
#include <malloc.h>
#include <asm/acpi_table.h>
#include <asm/io.h>
Expand Down
1 change: 1 addition & 0 deletions board/bosch/shc/board.c
Expand Up @@ -14,6 +14,7 @@
#include <common.h>
#include <env.h>
#include <errno.h>
#include <irq_func.h>
#include <spl.h>
#include <asm/arch/cpu.h>
#include <asm/arch/hardware.h>
Expand Down
1 change: 1 addition & 0 deletions board/cobra5272/flash.c
Expand Up @@ -7,6 +7,7 @@
#include <common.h>
#include <console.h>
#include <cpu_func.h>
#include <irq_func.h>

#define PHYS_FLASH_1 CONFIG_SYS_FLASH_BASE
#define FLASH_BANK_SIZE 0x200000
Expand Down
1 change: 1 addition & 0 deletions board/freescale/b4860qds/b4860qds.c
Expand Up @@ -7,6 +7,7 @@
#include <command.h>
#include <env.h>
#include <i2c.h>
#include <irq_func.h>
#include <netdev.h>
#include <linux/compiler.h>
#include <asm/mmu.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/common/vid.c
Expand Up @@ -7,6 +7,7 @@
#include <command.h>
#include <env.h>
#include <i2c.h>
#include <irq_func.h>
#include <asm/io.h>
#ifdef CONFIG_FSL_LSCH2
#include <asm/arch/immap_lsch2.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/m5253demo/flash.c
Expand Up @@ -8,6 +8,7 @@
*/

#include <common.h>
#include <irq_func.h>

#include <asm/immap.h>

Expand Down
1 change: 1 addition & 0 deletions board/freescale/t4qds/t4240qds.c
Expand Up @@ -7,6 +7,7 @@
#include <command.h>
#include <env.h>
#include <i2c.h>
#include <irq_func.h>
#include <netdev.h>
#include <linux/compiler.h>
#include <asm/mmu.h>
Expand Down
1 change: 1 addition & 0 deletions board/synopsys/hsdk/hsdk.c
Expand Up @@ -8,6 +8,7 @@
#include <config.h>
#include <cpu_func.h>
#include <env.h>
#include <irq_func.h>
#include <linux/printk.h>
#include <linux/kernel.h>
#include <linux/io.h>
Expand Down
1 change: 1 addition & 0 deletions cmd/booti.c
Expand Up @@ -8,6 +8,7 @@
#include <bootm.h>
#include <command.h>
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
#include <mapmem.h>
#include <linux/kernel.h>
Expand Down
1 change: 1 addition & 0 deletions cmd/bootz.c
Expand Up @@ -7,6 +7,7 @@
#include <common.h>
#include <bootm.h>
#include <command.h>
#include <irq_func.h>
#include <lmb.h>
#include <linux/compiler.h>

Expand Down
1 change: 1 addition & 0 deletions cmd/fdc.c
Expand Up @@ -11,6 +11,7 @@
#include <config.h>
#include <command.h>
#include <image.h>
#include <irq_func.h>


#undef FDC_DEBUG
Expand Down
1 change: 1 addition & 0 deletions cmd/irq.c
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
#include <irq_func.h>

static int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
Expand Down
1 change: 1 addition & 0 deletions common/board_r.c
Expand Up @@ -12,6 +12,7 @@
#include <common.h>
#include <api.h>
#include <cpu_func.h>
#include <irq_func.h>
#include <u-boot/crc.h>
/* TODO: can we just include all these headers whether needed or not? */
#if defined(CONFIG_CMD_BEDBUG)
Expand Down
1 change: 1 addition & 0 deletions common/bootm.c
Expand Up @@ -11,6 +11,7 @@
#include <env.h>
#include <errno.h>
#include <fdt_support.h>
#include <irq_func.h>
#include <lmb.h>
#include <malloc.h>
#include <mapmem.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/firmware/psci.c
Expand Up @@ -8,6 +8,7 @@

#include <common.h>
#include <dm.h>
#include <irq_func.h>
#include <dm/lists.h>
#include <efi_loader.h>
#include <linux/libfdt.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/pic32_flash.c
Expand Up @@ -10,6 +10,7 @@
#include <dm.h>
#include <fdt_support.h>
#include <flash.h>
#include <irq_func.h>
#include <mach/pic32.h>
#include <wait_bit.h>

Expand Down
6 changes: 0 additions & 6 deletions include/common.h
Expand Up @@ -46,8 +46,6 @@ typedef volatile unsigned char vu_char;

#include <log.h>

typedef void (interrupt_handler_t)(void *);

#include <asm/u-boot.h> /* boot information for Linux kernel */
#include <asm/global_data.h> /* global data used for startup functions */

Expand Down Expand Up @@ -207,10 +205,6 @@ int get_clocks (void);
ulong get_bus_freq (ulong);
int get_serial_clock(void);

/* $(CPU)/interrupts.c */
void enable_interrupts (void);
int disable_interrupts (void);

/* lib/uuid.c */
#include <uuid.h>

Expand Down
2 changes: 2 additions & 0 deletions include/exports.h
Expand Up @@ -9,6 +9,8 @@
#include <phy_interface.h>
#endif

#include <irq_func.h>

struct spi_slave;

/* These are declarations of exported functions available in C code */
Expand Down
9 changes: 8 additions & 1 deletion include/irq_func.h
Expand Up @@ -9,11 +9,18 @@
#ifndef __IRQ_FUNC_H
#define __IRQ_FUNC_H

struct pt_regs;

typedef void (interrupt_handler_t)(void *arg);

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_install_handler(int vec, interrupt_handler_t *handler, void *arg);
void irq_free_handler(int vec);
void reset_timer(void);

void enable_interrupts(void);
int disable_interrupts(void);

#endif
1 change: 1 addition & 0 deletions lib/efi_loader/efi_boottime.c
Expand Up @@ -8,6 +8,7 @@
#include <common.h>
#include <div64.h>
#include <efi_loader.h>
#include <irq_func.h>
#include <malloc.h>
#include <time.h>
#include <linux/libfdt_env.h>
Expand Down
1 change: 1 addition & 0 deletions post/lib_powerpc/andi.c
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <irq_func.h>

/*
* CPU test
Expand Down
1 change: 1 addition & 0 deletions post/lib_powerpc/b.c
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <irq_func.h>

/*
* CPU test
Expand Down
1 change: 1 addition & 0 deletions post/lib_powerpc/cmp.c
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <irq_func.h>

/*
* CPU test
Expand Down
1 change: 1 addition & 0 deletions post/lib_powerpc/cmpi.c
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <irq_func.h>

/*
* CPU test
Expand Down

0 comments on commit 36bf446

Please sign in to comment.