diff --git a/kernel-src/include/x86-64/arch/cpu.h b/kernel-src/include/x86-64/arch/cpu.h index 8bd751ea..bd3662c0 100644 --- a/kernel-src/include/x86-64/arch/cpu.h +++ b/kernel-src/include/x86-64/arch/cpu.h @@ -32,6 +32,7 @@ typedef struct cpu_t { isr_t *isrqueue; dpc_t *dpcqueue; struct cpu_t *self; + isr_t *dpcisr; } cpu_t; #define CPU_HALT() asm volatile("hlt") diff --git a/kernel-src/sys/dpc.c b/kernel-src/sys/dpc.c index 77ef5f38..59484b67 100644 --- a/kernel-src/sys/dpc.c +++ b/kernel-src/sys/dpc.c @@ -3,7 +3,6 @@ #include #include -static isr_t *dpcisr; static void remove(dpc_t *dpc) { if (dpc->prev) @@ -49,7 +48,7 @@ void dpc_enqueue(dpc_t *dpc, dpcfn_t fn, dpcarg_t arg) { dpc->arg = arg; dpc->enqueued = true; insert(dpc); - interrupt_raise(dpcisr); + interrupt_raise(_cpu()->dpcisr); cleanup: interrupt_set(entrystate); @@ -69,6 +68,6 @@ void dpc_dequeue(dpc_t *dpc) { } void dpc_init() { - dpcisr = interrupt_allocate(isrfn, NULL, IPL_DPC); - __assert(dpcisr); + _cpu()->dpcisr = interrupt_allocate(isrfn, NULL, IPL_DPC); + __assert(_cpu()->dpcisr); }