danos/system/kernel/architecture/x86_64
Daniel Samson 4ef21fa083
M15: interrupts for PCI devices (ECAM config space + MSI)
Two parts, both blockers for real PCI drivers.

ECAM config space per function: enumeratePci now gives every pci_device its own 4 KiB
configuration window as resource 0. A claimed PCI driver mmio_maps that to reach its
command register, BARs, and — the point — its capability list (MSI/MSI-X, PCIe extended
caps), with no new syscall. Verified in the discovery test (QEMU q35's functions each
carry it).

MSI: msi_bind(device_id, endpoint) -> address (rax), data (rdx) allocates a per-device
edge-triggered vector, binds it to the endpoint, and returns the (address, data) the
driver programs into its own MSI capability. Unlike irq_bind there's no GSI, no I/O APIC
entry, no sharing, and no ack cycle — dispatch recognises an MSI vector (vector_gsi ==
none, msi_bound set), EOIs, and notifies. Owner-keyed release drops the binding on exit.
Legacy INTx (_PRT parsing + shared lines) is deliberately skipped; MSI is the real
answer.

QEMU's HPET has no MSI, so the new `msi` test proves the vector-routing path with a
self-IPI (new apic.selfIpi) standing in for the device's MSI write: bind a vector,
fire it, the bound endpoint is notified. The msi_bind syscall wraps irq.msiBind with
the claim check and lands its first real use with the first PCI driver. Suite 39/39
plus host tests.
2026-07-10 19:59:09 +01:00
..
apic.zig M15: interrupts for PCI devices (ECAM config space + MSI) 2026-07-10 19:59:09 +01:00
cpu.zig M15: interrupts for PCI devices (ECAM config space + MSI) 2026-07-10 19:59:09 +01:00
gdt.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
idt.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
io.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
ioapic.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
isr.s Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
linker.ld Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
paging.zig M14b: DMA memory (dma_alloc / dma_free) 2026-07-10 19:43:59 +01:00
per-cpu.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
serial.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
smp.zig Split the `system` contract into boot-handoff / abi / device-abi 2026-07-10 18:08:51 +01:00
trampoline.s Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
tss.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00