summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2022-02-03 19:45:00 +0000
committerAda Christine <adachristine18@gmail.com>2022-02-03 19:45:00 +0000
commit073e21313eb1d11027985e0367159de6ecad0f9e (patch)
tree20865bd11b59aa34797d2b83ac2056c56f33e071
parent65430cd09f3b6162187d66d66f860e8883f8ff9b (diff)
bad conditional
-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);
}