cpu: make timer irq use ist1

This commit is contained in:
Matheus
2022-09-19 18:32:28 -03:00
parent 41d6e7230e
commit 6c959ef878
3 changed files with 14 additions and 2 deletions
+11 -1
View File
@@ -3,8 +3,10 @@
#include <cpuid.h>
#include <arch/cls.h>
#include <stdio.h>
#include <kernel/pmm.h>
#include <arch/idt.h>
// initialises things like
// initializes things like
// syscall, sse, etc
// for the current cpu
@@ -48,4 +50,12 @@ void cpu_state_init(){
"or $0b11000000000, %%rax;"
"mov %%rax, %%cr4;"
: : : "rax");
// set up interrupt stacks
// timer stack is 1
arch_getcls()->ist.ist1 = pmm_hhdmalloc(10) + PAGE_SIZE*10;
}
+1 -1
View File
@@ -59,7 +59,7 @@ void idt_bspinit(){
idt_setentry(&idt[VECTOR_LAPICNMI], asmisr_lapicnmi, 0x28, FLAGS_PRESENT | FLAGS_TYPE_INTERRUPT, 0);
idt_setentry(&idt[VECTOR_TIMER], asmisr_timer, 0x28, FLAGS_PRESENT | FLAGS_TYPE_INTERRUPT, 0);
idt_setentry(&idt[VECTOR_TIMER], asmisr_timer, 0x28, FLAGS_PRESENT | FLAGS_TYPE_INTERRUPT, TIMER_IST);
idt_setentry(&idt[VECTOR_PS2KBD], asmisr_ps2kbd, 0x28, FLAGS_PRESENT | FLAGS_TYPE_INTERRUPT, 0);
+2
View File
@@ -30,6 +30,8 @@
#define VECTOR_PS2KBD 0x40
#define VECTOR_TIMER 0x80
#define TIMER_IST 1
typedef struct{
uint16_t size;
uint64_t offset;