diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-09 23:18:09 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-10 00:10:36 -0400 |
commit | 0976eef35ab1c557238a87f253888a4d2dd1bf52 (patch) | |
tree | f712cc5515894a225d92c8b0dcb46d8ea7d9e046 /sys/include/arch/amd64/cpu.h | |
parent | 5e46817ba95f4ca0cf11b10e8655b60b4137baef (diff) |
kernel/amd64: Introduce flexible IPI management
This commit greatly improves the handling of how inter-processor
interrupts are allocated and managed. Previously Hyra used handlers at
fixed interrupt vectors for IPIs, however, that is very rigid and not
very scalable at all. With the new IPI framework, one may allocate IPIs
by calling 'md_ipi_alloc()' and initializing the handler field.
To send an IPI to a specific processor, one can use cpu_ipi_send() and
pass the specific CPU structure as well as the IPI identifier.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/cpu.h')
-rw-r--r-- | sys/include/arch/amd64/cpu.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h index 116661b..4586163 100644 --- a/sys/include/arch/amd64/cpu.h +++ b/sys/include/arch/amd64/cpu.h @@ -37,6 +37,7 @@ #include <sys/spinlock.h> #include <machine/tss.h> #include <machine/cdefs.h> +#include <machine/intr.h> #define CPU_IRQ(IRQ_N) (BIT((IRQ_N)) & 0xFF) @@ -44,9 +45,14 @@ #define CPU_FEAT_SMAP BIT(0) #define CPU_FEAT_SMEP BIT(1) +typedef uint16_t ipi_pend_t; + struct cpu_info { uint32_t apicid; uint32_t feat; + uint8_t ipi_dispatch : 1; /* 1: IPIs being dispatched */ + uint8_t ipi_id; + ipi_pend_t ipi_pending[N_IPIVEC]; uint8_t id; /* MI Logical ID */ uint8_t model : 4; /* CPU model number */ uint8_t family : 4; /* CPU family ID */ |