mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
kernel: DPC support
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#ifndef _DPC_H
|
||||
#define _DPC_H
|
||||
|
||||
#include <arch/context.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef void * dpcarg_t;
|
||||
typedef void (*dpcfn_t)(context_t *, dpcarg_t);
|
||||
|
||||
typedef struct _dpc_t {
|
||||
struct _dpc_t *next;
|
||||
struct _dpc_t *prev;
|
||||
bool enqueued;
|
||||
dpcfn_t fn;
|
||||
dpcarg_t arg;
|
||||
} dpc_t;
|
||||
|
||||
void dpc_enqueue(dpc_t *dpc, dpcfn_t, dpcarg_t);
|
||||
void dpc_dequeue(dpc_t *dpc);
|
||||
void dpc_init();
|
||||
|
||||
#endif
|
||||
@@ -15,6 +15,7 @@
|
||||
#define IPL_MAX 0
|
||||
#define IPL_TIMER 1
|
||||
#define IPL_KEYBOARD 2
|
||||
#define IPL_DPC 900
|
||||
#define IPL_NORMAL 1000
|
||||
|
||||
struct _isr_t;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <kernel/vmm.h>
|
||||
#include <kernel/timer.h>
|
||||
#include <kernel/scheduler.h>
|
||||
#include <kernel/dpc.h>
|
||||
|
||||
typedef struct cpu_t {
|
||||
thread_t *thread;
|
||||
@@ -26,6 +27,7 @@ typedef struct cpu_t {
|
||||
timerentry_t schedtimerentry;
|
||||
void *schedulerstack;
|
||||
isr_t *isrqueue;
|
||||
dpc_t *dpcqueue;
|
||||
} cpu_t;
|
||||
|
||||
#define CPU_HALT() asm volatile("hlt")
|
||||
|
||||
Reference in New Issue
Block a user