X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Fx86%2Flib%2Finterrupts.c;h=d3ae6d9694aaf0d0e074a1fef74568f6a78a507b;hb=45410da714a1857c9e06573159877cff98fa4129;hp=a2c598f9a4f7d129257874abdf7973f546c833df;hpb=9dd5dad88777a7c6a63f8c103706b57364a135f4;p=oweals%2Fu-boot.git diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index a2c598f9a4..d3ae6d9694 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -12,28 +12,12 @@ * Wolfgang Denk, DENX Software Engineering, * * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, + * Daniel Engström, Omicron Ceti AB, * * (C) Copyright 2001 * Josh Huber, Mission Critical Linux, Inc, * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -43,37 +27,39 @@ * Daniel Hellstrom, Detlev Zundel, Wolfgang Denk and Josh Huber are * credited for the corresponding work on those ports. The original * interrupt handling routines for the x86 port were written by - * Daniel Engström + * Daniel Engström */ #include #include +#if !CONFIG_IS_ENABLED(X86_64) + struct irq_action { interrupt_handler_t *handler; void *arg; unsigned int count; }; -static struct irq_action irq_handlers[CONFIG_SYS_NUM_IRQS] = { {0} }; -static int spurious_irq_cnt = 0; -static int spurious_irq = 0; +static struct irq_action irq_handlers[SYS_NUM_IRQS] = { {0} }; +static int spurious_irq_cnt; +static int spurious_irq; void irq_install_handler(int irq, interrupt_handler_t *handler, void *arg) { int status; - if (irq < 0 || irq >= CONFIG_SYS_NUM_IRQS) { + if (irq < 0 || irq >= SYS_NUM_IRQS) { printf("irq_install_handler: bad irq number %d\n", irq); return; } if (irq_handlers[irq].handler != NULL) printf("irq_install_handler: 0x%08lx replacing 0x%08lx\n", - (ulong) handler, - (ulong) irq_handlers[irq].handler); + (ulong) handler, + (ulong) irq_handlers[irq].handler); - status = disable_interrupts (); + status = disable_interrupts(); irq_handlers[irq].handler = handler; irq_handlers[irq].arg = arg; @@ -91,12 +77,12 @@ void irq_free_handler(int irq) { int status; - if (irq < 0 || irq >= CONFIG_SYS_NUM_IRQS) { + if (irq < 0 || irq >= SYS_NUM_IRQS) { printf("irq_free_handler: bad irq number %d\n", irq); return; } - status = disable_interrupts (); + status = disable_interrupts(); mask_irq(irq); @@ -113,7 +99,7 @@ void do_irq(int hw_irq) { int irq = hw_irq - 0x20; - if (irq < 0 || irq >= CONFIG_SYS_NUM_IRQS) { + if (irq < 0 || irq >= SYS_NUM_IRQS) { printf("do_irq: bad irq number %d\n", irq); return; } @@ -134,27 +120,30 @@ void do_irq(int hw_irq) } } } +#endif #if defined(CONFIG_CMD_IRQ) int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { +#if !CONFIG_IS_ENABLED(X86_64) int irq; printf("Spurious IRQ: %u, last unknown IRQ: %d\n", - spurious_irq_cnt, spurious_irq); + spurious_irq_cnt, spurious_irq); - printf ("Interrupt-Information:\n"); - printf ("Nr Routine Arg Count\n"); + printf("Interrupt-Information:\n"); + printf("Nr Routine Arg Count\n"); - for (irq = 0; irq <= CONFIG_SYS_NUM_IRQS; irq++) { + for (irq = 0; irq < SYS_NUM_IRQS; irq++) { if (irq_handlers[irq].handler != NULL) { - printf ("%02d %08lx %08lx %d\n", + printf("%02d %08lx %08lx %d\n", irq, (ulong)irq_handlers[irq].handler, (ulong)irq_handlers[irq].arg, irq_handlers[irq].count); } } +#endif return 0; }