Requesting A Yield; Checking For Yield; Yielding - Nintendo Ultra64 Programmer's Manual

Rsp
Table of Contents

Advertisement

Advanced Information
148

Requesting a Yield

An application requests an RSP task to yield by calling osSpTaskYield().
This function sets the Coprocessor 0 Status Register bit SP_SET_YIELD,
which is #define'd as SIG0 in rcp.h.

Checking for Yield

The microcode checks periodically for a yield request. It would be inefficient
to check too often, but it would also be dangerous to not check often enough,
possibly detecting the yield too late.
For the released graphics microcode, we check for the yield after processing
every display list command. The test is relatively cheap, only a few cycles,
and this guarantees that we will test every several hundred clock cycles at
the most.
# we're done with this command, do the next one (if
# available)...
#
GfxDone:
# stick our head up, see if we need to yield the SP.
# If so,checkpoint everything then exit.
#
mfc0
yield, SP_STATUS
andi
yield, yield, SP_STATUS_YIELD
bne
yield, zero, RSPYield
lh
overeturn, TASKYIELD(zero)

Yielding

The microcode's responsibility during yield is, by design, minimal.
The microcode saves a handful of important registers to DMEM, then
DMA's the necessary portion of DMEM to the yield buffer (originally
supplied to the task as part of the task header).
The microcode also sets the SP_YIELDED bit in the Coprocessor 0 Status
Register, this bit is #define'd as SIG1 in rcp.h.
# need to yield?
# return where?

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents