mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
interrupt: basic ipl handling
This commit is contained in:
@@ -11,6 +11,11 @@
|
||||
#error Unsupported architecture!
|
||||
#endif
|
||||
|
||||
#define IPL_MAX -1
|
||||
#define IPL_NONE 0
|
||||
#define IPL_TIMER 1
|
||||
#define IPL_BASE 1000
|
||||
|
||||
struct _isr_t;
|
||||
typedef struct _isr_t {
|
||||
void (*func)(struct _isr_t *self, context_t *ctx);
|
||||
@@ -22,8 +27,7 @@ typedef struct _isr_t {
|
||||
|
||||
void interrupt_register(int vector, void (*func)(isr_t *self, context_t *ctx), void (*eoi)(isr_t *self), long priority);
|
||||
isr_t *interrupt_allocate(void (*func)(isr_t *self, context_t *ctx), void (*eoi)(isr_t *self), long priority);
|
||||
void interrupt_raiseipl(long newipl);
|
||||
void interrupt_loweripl(long newipl);
|
||||
long interrupt_setipl(long newipl);
|
||||
bool interrupt_set(bool status);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@ typedef struct {
|
||||
int acpiid;
|
||||
timer_t *timer;
|
||||
bool intstatus;
|
||||
long ipl;
|
||||
} cpu_t;
|
||||
|
||||
static inline cpu_t *_cpu() {
|
||||
|
||||
Reference in New Issue
Block a user