acphal: follow the 26100 APU heap, flag and alignment rules #527
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/527"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-29T20:09:00Z.
What
Three APU semantics that a title can observe, plus the default heaps the contract requires:
ApuCreateHeapnow allocates the documented defaults (64 MB cached and a small non-cached heap) and laterApuCreateHeapreturns the "already allocated" error, matching the 26100 contract.ApuHeapGetStatereports the "not allocated" error only when the defaults themselves cannot be allocated.ApuCreateHeapreturnsAPU_E_HEAP_ALREADY_ALLOCATED(0x8ACA0001) instead ofS_OK, and rejects a zero cached size withE_INVALIDARG.ApuAllocroutes by the cached/non-cached flag, rejects unknown flags and alignments of 0, below 4 or non-power-of-two withE_INVALIDARGinstead of clamping, and takes SHAPE contexts from the non-cached heap.MACROvalues were verified with a compilerstatic_assertagainst the supplied header, not by arithmetic.Verification
#[cfg(windows)]path with real address-space calls.python tuxbox.py check --no-gpu8/8.Not covered
ApuCreateHeap(0, …)now returnsE_INVALIDARGbecause no recorded call passes a zero cached size; the import exists, so the arguments are unrecorded rather than proven absent.ApuMap*,ApuIsVirtualAddressValidandApuFreeanswer without allocating the defaults, which is more generous than the console and never a new failure.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:38:02Z.
Thanks. From reading, this looks fine: honest local answers and tests for each case. We're adding Lanes self-test scenarios that call these providers, so they're checked without booting a title. We'll merge it once those pass with it.