aboutsummaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-19 23:56:22 -0400
committerIan Moffett <ian@osmora.org>2025-05-19 23:56:22 -0400
commit5dfbc067d095b2bbaefad6d77469f4d701bdd539 (patch)
treeea38f2a13cd18a7949046bd1697eade81647d361 /sys/include/arch/amd64
parent87013e38d1940ad183d3cdb42224fb6dcd9e7e03 (diff)
kernel/amd64: Deprecate intr_alloc_vector()mainexpt
Replace intr_alloc_vector() with a cleaner and more machine independent intr_register() Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64')
-rw-r--r--sys/include/arch/amd64/frameasm.h2
-rw-r--r--sys/include/arch/amd64/intr.h34
-rw-r--r--sys/include/arch/amd64/isa/i8042var.h2
3 files changed, 35 insertions, 3 deletions
diff --git a/sys/include/arch/amd64/frameasm.h b/sys/include/arch/amd64/frameasm.h
index c6316a5..4dc075e 100644
--- a/sys/include/arch/amd64/frameasm.h
+++ b/sys/include/arch/amd64/frameasm.h
@@ -30,6 +30,8 @@
#ifndef _MACHINE_FRAMEASM_H_
#define _MACHINE_FRAMEASM_H_
+#define ALIGN_TEXT .align 8, 0x90
+
/*
* If the interrupt has an error code, this macro shall
* be used to create the trapframe.
diff --git a/sys/include/arch/amd64/intr.h b/sys/include/arch/amd64/intr.h
index c643945..2a8d487 100644
--- a/sys/include/arch/amd64/intr.h
+++ b/sys/include/arch/amd64/intr.h
@@ -51,7 +51,39 @@ struct intr_entry {
int priority;
};
-int intr_alloc_vector(const char *name, uint8_t priority);
+/*
+ * Interrupt handler
+ *
+ * [r]: Required for intr_register()
+ * [o]: Not required for intr_register()
+ * [v]: Returned by intr_register()
+ *
+ * @func: The actual handler [r]
+ * @name: Interrupt name [v]
+ * @priority: Interrupt priority [r]
+ * @irq: Interrupt request number [o]
+ * @vector: Interrupt vector [v]
+ *
+ * XXX: `irq` can be set to -1 for MSI/MSI-X
+ * interrupts.
+ *
+ * XXX: `func` must be the first field in this
+ * structure so that it may be called through
+ * assembly.
+ *
+ * XXX: `ist' should usually be set to -1 but can be
+ * used if an interrupt requires its own stack.
+ */
+struct intr_hand {
+ int(*func)(void *);
+ char *name;
+ int priority;
+ int irq;
+ int vector;
+};
+
+void *intr_register(const char *name, const struct intr_hand *ih);
+
int splraise(uint8_t s);
void splx(uint8_t s);
diff --git a/sys/include/arch/amd64/isa/i8042var.h b/sys/include/arch/amd64/isa/i8042var.h
index ebd96ad..13c3095 100644
--- a/sys/include/arch/amd64/isa/i8042var.h
+++ b/sys/include/arch/amd64/isa/i8042var.h
@@ -82,7 +82,5 @@ void i8042_quirk(int mask);
/* Internal - do not use */
void i8042_sync(void);
-void i8042_kb_isr(void);
-void i8042_kb_event(void);
#endif /* _I8042VAR_H_ */