mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
cpu: make timer irq use ist1
This commit is contained in:
+11
-1
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#define VECTOR_PS2KBD 0x40
|
||||
#define VECTOR_TIMER 0x80
|
||||
|
||||
#define TIMER_IST 1
|
||||
|
||||
typedef struct{
|
||||
uint16_t size;
|
||||
uint64_t offset;
|
||||
|
||||
Reference in New Issue
Block a user