summaryrefslogtreecommitdiff
path: root/kc
diff options
context:
space:
mode:
Diffstat (limited to 'kc')
-rw-r--r--kc/core/cpu.h2
-rw-r--r--kc/core/cpu/cpu.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/kc/core/cpu.h b/kc/core/cpu.h
index a8da9bf..6986422 100644
--- a/kc/core/cpu.h
+++ b/kc/core/cpu.h
@@ -9,7 +9,7 @@ void cpu_init(void);
noreturn void cpu_task_begin(void);
void cpu_task_set(struct kc_thread *task);
-void isr_install(int vec, void (*isr)(void), int ist, int trap);
+void isr_install(int vec, void (*isr)(void), int trap, unsigned ist);
void ist_install(int ist, void *stack);
void int_enable(void);
diff --git a/kc/core/cpu/cpu.c b/kc/core/cpu/cpu.c
index 27ee827..6e8e8b6 100644
--- a/kc/core/cpu/cpu.c
+++ b/kc/core/cpu/cpu.c
@@ -261,7 +261,7 @@ void exceptions_init(void)
isr_install(PAGE_FAULT_VECTOR, &page_fault_isr, 0, 0);
}
-void isr_install(int vec, void (*isr)(void), int trap, int ist)
+void isr_install(int vec, void (*isr)(void), int trap, unsigned ist)
{
enum gate_descriptor_type type = INT64_GATE;
@@ -272,11 +272,11 @@ void isr_install(int vec, void (*isr)(void), int trap, int ist)
set_idt(vec, CODE_SUPER_SEG_INDEX << 3, (uintptr_t)isr, type);
// an IST greater than 7 is invalid
- if (ist && ist < 7)
+ if (ist && ist <= 7)
{
set_ist(vec, ist);
}
- else
+ else if (ist && ist > 7)
{
panic(GENERAL_PANIC);
}