From patchwork Fri Oct 23 01:39:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 534677 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 80FB814130F for ; Fri, 23 Oct 2015 12:37:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=CCiVJ41D; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C5D7EB37E7; Fri, 23 Oct 2015 03:37:00 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4NnWcy7Irn_a; Fri, 23 Oct 2015 03:37:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2768EB37E8; Fri, 23 Oct 2015 03:36:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3293B37D1 for ; Fri, 23 Oct 2015 03:36:44 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id InZ-Fqyb7QV9 for ; Fri, 23 Oct 2015 03:36:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by theia.denx.de (Postfix) with ESMTPS id 2094BB37CF for ; Fri, 23 Oct 2015 03:36:40 +0200 (CEST) Received: by pabrc13 with SMTP id rc13so102114031pab.0 for ; Thu, 22 Oct 2015 18:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=6kJuxkVccHltfppFwBHGw9yBThLlvwW+HtLZkKga6z4=; b=CCiVJ41DpoiIehOTUnGboU5yc45AcejZjvcAD7c8O+eM0r3Sbvg/WCZeEmeWSThZky n+yHv7hax7vcfzsPQCZm7oGxjmLKr16LFn3hw1awiJizV2E2nmyQxRWJ3ArxVMUGHzmt yulZonYoY/HMlpw2OX61PRESnOIn/EDTF6jKcTPvJhHYaQZZwGtuMxeg96lu6IF+3Kif GYppwaWbAbWrXWZr0nRgEl9KGSYF5qISdLBhPJqcCz01y8FZl+d87BBc6EWBX/JdpBTL mmy3aaJpKp+PuIh7mDUgpZBJz3iUnbT89vD2RMH852fmajf84gcohDvxpgYpvXLIryZh thEA== X-Received: by 10.66.228.199 with SMTP id sk7mr1706979pac.8.1445564199232; Thu, 22 Oct 2015 18:36:39 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id nz4sm15938360pbb.47.2015.10.22.18.36.38 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Oct 2015 18:36:38 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Thu, 22 Oct 2015 18:39:08 -0700 Message-Id: <1445564355-19911-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1445564355-19911-1-git-send-email-bmeng.cn@gmail.com> References: <1445564355-19911-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 1/8] x86: Rename CONFIG_SYS_NUM_IRQS to SYS_NUM_IRQS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" CONFIG_SYS_NUM_IRQS is actually not something we can configure, but an architecture defined number of ISA IRQs. Move it from x86-common.h to asm/interrupt.h and rename it to SYS_NUM_IRQS. Signed-off-by: Bin Meng Acked-by: Simon Glass --- arch/x86/include/asm/interrupt.h | 2 ++ arch/x86/lib/interrupts.c | 10 +++++----- arch/x86/lib/pcat_interrupts.c | 10 +++------- include/configs/x86-common.h | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h index fcd766b..95a4de0 100644 --- a/arch/x86/include/asm/interrupt.h +++ b/arch/x86/include/asm/interrupt.h @@ -13,6 +13,8 @@ #include +#define SYS_NUM_IRQS 16 + /* Architecture defined exceptions */ enum x86_exception { EXC_DE = 0, diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index 146ad11..dd08402 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -39,7 +39,7 @@ struct irq_action { unsigned int count; }; -static struct irq_action irq_handlers[CONFIG_SYS_NUM_IRQS] = { {0} }; +static struct irq_action irq_handlers[SYS_NUM_IRQS] = { {0} }; static int spurious_irq_cnt; static int spurious_irq; @@ -47,7 +47,7 @@ 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; } @@ -75,7 +75,7 @@ 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; } @@ -97,7 +97,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; } @@ -130,7 +130,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 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", irq, diff --git a/arch/x86/lib/pcat_interrupts.c b/arch/x86/lib/pcat_interrupts.c index a9af87e..3704aaf 100644 --- a/arch/x86/lib/pcat_interrupts.c +++ b/arch/x86/lib/pcat_interrupts.c @@ -20,10 +20,6 @@ #include #include -#if CONFIG_SYS_NUM_IRQS != 16 -#error "CONFIG_SYS_NUM_IRQS must equal 16 if CONFIG_SYS_NUM_IRQS is defined" -#endif - int i8259_init(void) { u8 i; @@ -70,7 +66,7 @@ void mask_irq(int irq) { int imr_port; - if (irq >= CONFIG_SYS_NUM_IRQS) + if (irq >= SYS_NUM_IRQS) return; if (irq > 7) @@ -85,7 +81,7 @@ void unmask_irq(int irq) { int imr_port; - if (irq >= CONFIG_SYS_NUM_IRQS) + if (irq >= SYS_NUM_IRQS) return; if (irq > 7) @@ -98,7 +94,7 @@ void unmask_irq(int irq) void specific_eoi(int irq) { - if (irq >= CONFIG_SYS_NUM_IRQS) + if (irq >= SYS_NUM_IRQS) return; if (irq > 7) { diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index faadab8..2e90ef5 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -157,7 +157,6 @@ #define CONFIG_SYS_X86_TSC_TIMER #define CONFIG_SYS_PCAT_INTERRUPTS #define CONFIG_SYS_PCAT_TIMER -#define CONFIG_SYS_NUM_IRQS 16 #define CONFIG_SYS_STACK_SIZE (32 * 1024) #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE