Expand description
DMA controller.
The PS1 has 7 DMA channels (MDEC in, MDEC out, GPU, CD-ROM, SPU,
expansion, ordering-table clear). Each channel has an address, a size and
a control register at fixed 16-byte strides, plus a global enable and a
global interrupt register. The addresses and bit layouts live in
[psx_hw::dma].
Modules§
- raw
- Single-register writes for silicon probes and drivers that need a store
order other than
start’s.
Structs§
- Transfer
- The three per-channel register values that describe one transfer.
Enums§
- Channel
- Channel index 0..=6 in the order the DMA controller presents them.
Constants§
- DEFAULT_
SPINS - Spin budget for one DMA completion wait. Comfortably longer than the largest legitimate transfer (a full-screen VRAM upload) and short enough that a wedged channel returns control inside a frame.
Functions§
- abort
- Clear
ch’s control register, dropping its START bit, so the channel can be re-armed: on silicon a CHCR write to a channel whose START is still latched is ignored, which is how one wedged kick used to poison every later transfer on the channel. - address
- Read the channel’s RAM address register.
- clear_
ordering_ table Deprecated OrderingTableClearDma::clear_tableon a token the caller does not hold.- compiler_
barrier - Compiler-only barrier: ordinary RAM accesses are not moved across it in either direction, so stores before it land before an MMIO store after it and accesses after it follow an MMIO read before it.
- control
- Read the channel’s control register.
- enable_
channel - Enable a channel without disturbing the others.
- is_busy
- True while the channel is busy with an in-flight transfer.
- set_
bcr_ ⚠manual Deprecated - Write the size register in manual / linked-list mode: just a 16-bit word count.
- set_
chcr ⚠Deprecated - Write the control register. Starts the transfer if
CHCR_STARTis set. - set_
madr ⚠Deprecated - Write the channel’s RAM address register.
- size_
blocks - Size word for block sync:
block_countblocks ofblock_sizewords. - size_
words - Size word for manual or linked-list sync: a 16-bit word count (linked-list mode ignores it, but silicon wants it written).
- start⚠
- Program channel
chwithtransferand start it. - wait_
done - Bounded completion wait.
falsemeans the channel was still busy when the budget ran out, i.e. the transfer is wedged and the caller must not assume its data landed. - wait_
or_ abort - End a transfer started with
start:wait_done; if the budget runs out,abortthe channel and wait again, within the same budget, for it to read idle; then a compiler barrier so the caller’s next RAM access to the buffer is not moved before the completion read (the barrier emits no instruction).falsemeans the data did not all land.