diff --git a/service/ptos/head/hal/intr.h b/service/ptos/head/hal/intr.h new file mode 100644 index 0000000..9155245 --- /dev/null +++ b/service/ptos/head/hal/intr.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2026, Chloe M. + * Provided under the BSD-3 clause. + * + * Description: High-level interrupt management + * Author: Chloe M. + */ + +#ifndef _HAL_INTR_H_ +#define _HAL_INTR_H_ 1 + +#include + +/* + * Represents value interrupt request levels that can be set within + * the machine specific task priority store. + */ +#define IRQL_PASSIVE 0 +#define IRQL_APC 1 +#define IRQL_DISPATCH 2 +#define IRQL_DEV_IRQ 3 +#define IRQL_HIGH 4 + +/* Interrupt request level type */ +typedef UCHAR IRQL; + +/* + * Represents an interrupt handler + * + * @Handler: Actual in-driver handler [@Data: driver specific data] + * @Irql: IRQL of this handler context + * @Present: If true, entry is present + * + * XXX: This structured must be consistently ordered as it is + * read from assembly, always add to the bottom !! + */ +typedef struct _INTR_HANDLER { + PT_STATUS(*Handler)(VOID *Data); + IRQL Irql; + BOOLEAN Present; +} INTR_HANDLER; + +#endif /* !_HAL_INTR_H_ */