Files
Astral/kernel-src/include/kernel/interrupt.h
T
8infy db55f99e23 Integrate uACPI & remove own ACPI parsing code
This commit adds uACPI as a submodule and removes all handwritten table
parsing code as well as struct definitions, since they now work via
uACPI. There's also now an ability to shut down by using the power
button.
2024-09-01 23:12:44 +03:00

46 lines
1.0 KiB
C

#ifndef _INTERRUPT_H
#define _INTERRUPT_H
#include <stdbool.h>
#include <arch/context.h>
#ifdef __x86_64__
#define MAX_ISR_COUNT 256
#define INTERRUPT_IDTOVECTOR(id) ((id) & 0xffffffff)
#else
#error Unsupported architecture!
#endif
#define IPL_IGNORE -1
#define IPL_MAX 0
#define IPL_TIMER 1
#define IPL_NET 400
#define IPL_DISK 500
#define IPL_KEYBOARD 600
#define IPL_MOUSE 650
#define IPL_ACPI 700
#define IPL_DPC 900
#define IPL_NORMAL 1000
struct _isr_t;
typedef struct _isr_t {
struct _isr_t *next;
struct _isr_t *prev;
void (*func)(struct _isr_t *self, context_t *ctx);
void (*eoi)(struct _isr_t *self);
void *priv;
long id;
long priority;
bool pending;
} 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);
long interrupt_loweripl(long newipl);
long interrupt_raiseipl(long ipl);
bool interrupt_set(bool status);
void interrupt_raise(isr_t *isr);
#endif