From 41706bf18839ff6ff853f3db1bd4fb34faf1bf39 Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Sun, 12 Jul 2026 02:58:45 +0000 Subject: [PATCH] ptos: hal: Add high-level interrupt interface groundwork Signed-off-by: Chloe M. --- service/ptos/head/hal/intr.h | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 service/ptos/head/hal/intr.h 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_ */