summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-10-22 19:13:26 -0700
committerBin Meng <bmeng.cn@gmail.com>2015-11-13 06:46:16 -0800
commit6c5052716e252d8ccbf161042b5a167fb1090030 (patch)
treea7d378d26174a990257f3a65d1af0408d7b7bb09
parent9ac4fc82071ce346e3885118242ff45d22f69b82 (diff)
x86: Rename CONFIG_SYS_NUM_IRQS to SYS_NUM_IRQS
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 <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/x86/include/asm/interrupt.h2
-rw-r--r--arch/x86/lib/interrupts.c10
-rw-r--r--arch/x86/lib/pcat_interrupts.c10
-rw-r--r--include/configs/x86-common.h1
4 files changed, 10 insertions, 13 deletions
diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h
index fcd766ba9b..95a4de023e 100644
--- a/arch/x86/include/asm/interrupt.h
+++ b/arch/x86/include/asm/interrupt.h
@@ -13,6 +13,8 @@
#include <asm/types.h>
+#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 146ad11fb5..dd08402665 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 a9af87e4ce..3704aafdc3 100644
--- a/arch/x86/lib/pcat_interrupts.c
+++ b/arch/x86/lib/pcat_interrupts.c
@@ -20,10 +20,6 @@
#include <asm/ibmpc.h>
#include <asm/interrupt.h>
-#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 faadab83ce..2e90ef509d 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