mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
dpc: add dpc_prepare
This commit is contained in:
@@ -39,13 +39,19 @@ static void isrfn(isr_t *self, context_t *context) {
|
||||
}
|
||||
}
|
||||
|
||||
void dpc_enqueue(dpc_t *dpc, dpcfn_t fn, dpcarg_t arg) {
|
||||
void dpc_prepare(dpc_t *dpc, dpcfn_t fn) {
|
||||
dpc->fn = fn;
|
||||
dpc->enqueued = false;
|
||||
dpc->next = NULL;
|
||||
dpc->prev = NULL;
|
||||
}
|
||||
|
||||
void dpc_enqueue(dpc_t *dpc, dpcarg_t arg) {
|
||||
bool entrystate = interrupt_set(false);
|
||||
|
||||
if (dpc->enqueued)
|
||||
goto cleanup;
|
||||
|
||||
dpc->fn = fn;
|
||||
dpc->arg = arg;
|
||||
dpc->enqueued = true;
|
||||
insert(dpc);
|
||||
|
||||
Reference in New Issue
Block a user