mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
dpc: fix smp
This commit is contained in:
@@ -32,6 +32,7 @@ typedef struct cpu_t {
|
|||||||
isr_t *isrqueue;
|
isr_t *isrqueue;
|
||||||
dpc_t *dpcqueue;
|
dpc_t *dpcqueue;
|
||||||
struct cpu_t *self;
|
struct cpu_t *self;
|
||||||
|
isr_t *dpcisr;
|
||||||
} cpu_t;
|
} cpu_t;
|
||||||
|
|
||||||
#define CPU_HALT() asm volatile("hlt")
|
#define CPU_HALT() asm volatile("hlt")
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include <kernel/interrupt.h>
|
#include <kernel/interrupt.h>
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
|
|
||||||
static isr_t *dpcisr;
|
|
||||||
|
|
||||||
static void remove(dpc_t *dpc) {
|
static void remove(dpc_t *dpc) {
|
||||||
if (dpc->prev)
|
if (dpc->prev)
|
||||||
@@ -49,7 +48,7 @@ void dpc_enqueue(dpc_t *dpc, dpcfn_t fn, dpcarg_t arg) {
|
|||||||
dpc->arg = arg;
|
dpc->arg = arg;
|
||||||
dpc->enqueued = true;
|
dpc->enqueued = true;
|
||||||
insert(dpc);
|
insert(dpc);
|
||||||
interrupt_raise(dpcisr);
|
interrupt_raise(_cpu()->dpcisr);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
interrupt_set(entrystate);
|
interrupt_set(entrystate);
|
||||||
@@ -69,6 +68,6 @@ void dpc_dequeue(dpc_t *dpc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dpc_init() {
|
void dpc_init() {
|
||||||
dpcisr = interrupt_allocate(isrfn, NULL, IPL_DPC);
|
_cpu()->dpcisr = interrupt_allocate(isrfn, NULL, IPL_DPC);
|
||||||
__assert(dpcisr);
|
__assert(_cpu()->dpcisr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user