summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/ipi.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-21 20:11:31 -0400
committerIan Moffett <ian@osmora.org>2025-08-21 20:11:31 -0400
commit6bd8fc75891cf2c08aaf4584f0110ca1cbbf84db (patch)
treec4cc4cdda2d307ccd10c7396a10708e365b85958 /sys/include/arch/amd64/ipi.h
parent6da57a82e1b40f6f1f105aa990475b451d4958e9 (diff)
kernel/amd64: ipi: Greatly simplify IPI framework
The previous IPI framework design was quite an overengineered mess thanks to our friend, Φ of the body. - Use a flat array instead of a weird bitmap - Only use one ISR and chain the functions Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/ipi.h')
-rw-r--r--sys/include/arch/amd64/ipi.h51
1 files changed, 1 insertions, 50 deletions
diff --git a/sys/include/arch/amd64/ipi.h b/sys/include/arch/amd64/ipi.h
index 1a3b51c..452d006 100644
--- a/sys/include/arch/amd64/ipi.h
+++ b/sys/include/arch/amd64/ipi.h
@@ -53,57 +53,8 @@ struct cpu_ipi {
int(*handler)(struct cpu_ipi *ipi);
};
-/*
- * Represents an interrupt vector for a
- * specific IPI
- *
- * @ipi: IPIs associated with this vector
- * @cookie: Used to verify an instance
- * @nipi: Number of IPIs associated
- * @vec: System interrupt vector number
- */
-struct ipi_vector {
- struct cpu_ipi ipi[IPI_PER_VEC];
- uint16_t cookie;
- uint8_t nipi;
- uint8_t vec;
-};
-
int md_ipi_alloc(struct cpu_ipi **res);
-int md_ipi_send(struct cpu_info *ci);
+int md_ipi_send(struct cpu_info *ci, ipi_pend_t ipi);
void md_ipi_init(void);
-/*
- * Get the vector an IPI belongs to
- *
- * @ipi: IPI to check
- */
-__always_inline static inline uint8_t
-ipi_vector(uint8_t ipi)
-{
- return ipi / N_IPIVEC;
-}
-
-/*
- * Get the handler index an IPI belongs
- * to
- *
- * @ipi: IPI to check
- */
-__always_inline static inline uint8_t
-ipi_index(uint8_t ipi)
-{
- return ipi % (sizeof(ipi_pend_t) * 8);
-}
-
-__always_inline static inline int
-cpu_ipi_send(struct cpu_info *ci, uint8_t ipi)
-{
- uint8_t vec = ipi_vector(ipi);
- uint8_t idx = ipi_index(ipi);
-
- ci->ipi_pending[vec] |= BIT(idx);
- return md_ipi_send(ci);
-}
-
#endif /* !_MACHINE_IPI_H_ */