Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

start

Function start 

Source
pub unsafe fn start(ch: Channel, transfer: Transfer)
Expand description

Program channel ch with transfer and start it.

The same three stores every SDK driver makes: address, size, a compiler-only barrier that publishes ordinary RAM stores made before the call (it emits no instruction), then control. The caller still enables the channel (enable_channel) and waits for completion (wait_done).

All three are stored on every call, and that is load-bearing for block sync: silicon counts the size register’s block field down to 0 as the transfer runs, so a second kick that relied on the first call’s size would run 65,536 blocks. Call start again, with the size, for each block kick.

§Safety

From the control store until the channel goes idle (wait_done returns true, or abort stops it), the DMA controller reads or writes RAM with no regard for Rust’s borrow rules. The caller must guarantee that for that whole window:

  • every word the transfer can write (a device-to-RAM channel, such as MDEC-out, CD-ROM, GPU readback or the ordering-table clear) lies in memory the caller owns exclusively, with no live Rust reference to it;
  • every word the transfer can read (a RAM-to-device channel, or each node of a linked list and the nodes its tags link to) is live, initialised and not written by anyone else;
  • the extent is the one size and the sync mode describe, remembering that a zero block count means 65,536 blocks;
  • the channel is idle when this is called (silicon ignores a control write to a busy channel, so the old transfer would keep running).