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);
|
||||
}
|
||||
|
||||
return INTR_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ps2kbdev_init(void) {
|
||||
|
||||
@ -246,16 +246,13 @@ void intr_handleintr(IntrStackFrame *frame) {
|
||||
cpu_hang();
|
||||
}
|
||||
} else if (frame->trapnum >= 32 && frame->trapnum <= 47) {
|
||||
bool send = true;
|
||||
IntrHandler *ih, *ihtmp;
|
||||
LL_FOREACH_SAFE(INTR_HANDLERS, ih, ihtmp) {
|
||||
if ((uint64_t)ih->irq == frame->trapnum) {
|
||||
if (ih->fn(frame) == INTR_NOEOI) {
|
||||
send = false;
|
||||
ih->fn(frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (send) intr_pic_eoi();
|
||||
intr_pic_eoi();
|
||||
} else if (frame->trapnum == 0x80) {
|
||||
intr_syscalldispatch(frame);
|
||||
}
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
|
||||
#define INTR_IRQBASE 0x20
|
||||
|
||||
#define INTR_OK 1
|
||||
#define INTR_NOEOI 2
|
||||
|
||||
typedef struct {
|
||||
uint64_t r15;
|
||||
uint64_t r14;
|
||||
|
||||
@ -33,7 +33,7 @@ void intr_pit_wait(uint32_t ms) {
|
||||
|
||||
int intr_pit_intr(IntrStackFrame *frame) {
|
||||
PIT_TICKS++;
|
||||
return INTR_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void intr_pit_init(void) {
|
||||
|
||||
@ -256,7 +256,7 @@ void proc_killself(void) {
|
||||
int proc_intr(IntrStackFrame *frame) {
|
||||
intr_pic_eoi();
|
||||
proc_sched(frame);
|
||||
return INTR_NOEOI;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void proc_init(void) {
|
||||
|
||||
Reference in New Issue
Block a user