summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-06-24 22:12:09 +0200
committerRichard Braun <rbraun@sceen.net>2017-06-24 22:12:09 +0200
commit58401aa087399e0344b73e91f5708af2451b33e7 (patch)
treea2651576c09da835eafba4d06608ef956c641cf4
parent7fc9d340e5ff385846c0c77fd24877c1b208a3bb (diff)
Move the INTR_TABLE_SIZE macro to the x86/trap module
-rw-r--r--arch/x86/machine/param.h5
-rw-r--r--arch/x86/machine/trap.h2
-rw-r--r--kern/intr.c4
3 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/machine/param.h b/arch/x86/machine/param.h
index db60c8fd..42133ab4 100644
--- a/arch/x86/machine/param.h
+++ b/arch/x86/machine/param.h
@@ -32,11 +32,6 @@
#define PAGE_MASK (PAGE_SIZE - 1)
/*
- * Maximum number of available interrupts.
- */
-#define INTR_TABLE_SIZE 256
-
-/*
* Virtual memory properties.
*/
diff --git a/arch/x86/machine/trap.h b/arch/x86/machine/trap.h
index c2885c59..94639c0f 100644
--- a/arch/x86/machine/trap.h
+++ b/arch/x86/machine/trap.h
@@ -65,6 +65,8 @@
#define TRAP_NR_VECTORS 256
+#define TRAP_INTR_TABLE_SIZE 256
+
#define TRAP_STACK_SIZE PAGE_SIZE
#ifndef __ASSEMBLER__
diff --git a/kern/intr.c b/kern/intr.c
index ca733e29..6590fca0 100644
--- a/kern/intr.c
+++ b/kern/intr.c
@@ -33,10 +33,10 @@
#include <kern/log.h>
#include <kern/macros.h>
#include <kern/panic.h>
-#include <kern/param.h>
#include <kern/spinlock.h>
#include <kern/thread.h>
#include <machine/cpu.h>
+#include <machine/trap.h>
struct intr_handler {
struct list node;
@@ -76,7 +76,7 @@ struct intr_entry {
/*
* Interrupt table.
*/
-static struct intr_entry intr_table[INTR_TABLE_SIZE];
+static struct intr_entry intr_table[TRAP_INTR_TABLE_SIZE];
/*
* List of registered controllers.