Stage K-5: xHCI Input Context allocated full size once per slot (FABRIC-3.10.8 §4.5)

- New XHCI_INPUT_CTX_BYTES (control ctx + slot + 31 EP contexts).
  Address Device allocates the Input Context at that size once per slot;
  Configure Endpoint reuses it (bounds-checked). It allocated a fresh one
  on every attach and never freed the old.
- Probe (removed), identical on all three ISAs: after the standard
  sequence's attach/detach/re-attach, input-context allocations=2 (one
  per xHCI slot) against configure-endpoint=3.
- Standard sequence on amd64/aarch64/riscv64: hash, G, ledger unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-26 06:43:59 -04:00
co-authored by Claude Opus 5.5
parent 1166713cc9
commit bfa876a0e2
15 changed files with 54926 additions and 17 deletions
+5
View File
@@ -449,6 +449,11 @@ typedef struct {
* -- the controller keeps the address it was given there. */
#define XHCI_DEVICE_CTX_ENTRIES 32u
#define XHCI_DEVICE_CTX_BYTES (XHCI_DEVICE_CTX_ENTRIES * sizeof(xhci_ep_ctx32_t))
/* FABRIC-3.10.8 K-5: the full Input Context -- Input Control Context plus
* a Slot Context and all 31 Endpoint Contexts. Allocated once per slot at
* Address Device, like the Output Device Context, and reused by Configure
* Endpoint (which used to allocate a new one per attach and leak the old). */
#define XHCI_INPUT_CTX_BYTES (sizeof(xhci_input_ctrl_ctx32_t) + XHCI_DEVICE_CTX_BYTES)
#define XHCI_EP_CTX_TYPE_SHIFT 3
#define XHCI_EP_CTX_TYPE_CONTROL_BIDI 4u /* EP0 */