Fix interrupts not working with -enable-kvm
This commit is contained in:
@ -165,7 +165,7 @@ int ps2kbdev_intr(IntrStackFrame *frame) {
|
|||||||
ipc_mbuspublish("ps2kb", &b);
|
ipc_mbuspublish("ps2kb", &b);
|
||||||
}
|
}
|
||||||
|
|
||||||
return INTR_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ps2kbdev_init(void) {
|
void ps2kbdev_init(void) {
|
||||||
|
|||||||
@ -246,16 +246,13 @@ void intr_handleintr(IntrStackFrame *frame) {
|
|||||||
cpu_hang();
|
cpu_hang();
|
||||||
}
|
}
|
||||||
} else if (frame->trapnum >= 32 && frame->trapnum <= 47) {
|
} else if (frame->trapnum >= 32 && frame->trapnum <= 47) {
|
||||||
bool send = true;
|
|
||||||
IntrHandler *ih, *ihtmp;
|
IntrHandler *ih, *ihtmp;
|
||||||
LL_FOREACH_SAFE(INTR_HANDLERS, ih, ihtmp) {
|
LL_FOREACH_SAFE(INTR_HANDLERS, ih, ihtmp) {
|
||||||
if ((uint64_t)ih->irq == frame->trapnum) {
|
if ((uint64_t)ih->irq == frame->trapnum) {
|
||||||
if (ih->fn(frame) == INTR_NOEOI) {
|
ih->fn(frame);
|
||||||
send = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
intr_pic_eoi();
|
||||||
if (send) intr_pic_eoi();
|
|
||||||
} else if (frame->trapnum == 0x80) {
|
} else if (frame->trapnum == 0x80) {
|
||||||
intr_syscalldispatch(frame);
|
intr_syscalldispatch(frame);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
#define INTR_IRQBASE 0x20
|
#define INTR_IRQBASE 0x20
|
||||||
|
|
||||||
#define INTR_OK 1
|
|
||||||
#define INTR_NOEOI 2
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t r15;
|
uint64_t r15;
|
||||||
uint64_t r14;
|
uint64_t r14;
|
||||||
|
|||||||
@ -33,7 +33,7 @@ void intr_pit_wait(uint32_t ms) {
|
|||||||
|
|
||||||
int intr_pit_intr(IntrStackFrame *frame) {
|
int intr_pit_intr(IntrStackFrame *frame) {
|
||||||
PIT_TICKS++;
|
PIT_TICKS++;
|
||||||
return INTR_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void intr_pit_init(void) {
|
void intr_pit_init(void) {
|
||||||
|
|||||||
@ -256,7 +256,7 @@ void proc_killself(void) {
|
|||||||
int proc_intr(IntrStackFrame *frame) {
|
int proc_intr(IntrStackFrame *frame) {
|
||||||
intr_pic_eoi();
|
intr_pic_eoi();
|
||||||
proc_sched(frame);
|
proc_sched(frame);
|
||||||
return INTR_NOEOI;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_init(void) {
|
void proc_init(void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user