ayield.s
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* ayield.s
*
* save graphics output buffer in the case of yield, and restore it
* when done.
*/
#############################################################
### SAVE XBUS BUFFER IF NOT EMPTY ###########################
#############################################################
#ifdef STARTUP_YIELD
.name tmp, $4
.name stat, $5
.ent yieldSave
yieldSave:
mfc0 stat, CMD_STATUS # Get DP buffer status
andi tmp, stat, DPC_STATUS_XBUS_DMEM_DMA # Is buffer in DMEM?
beq tmp, zero, noYield # If not, no yield
andi tmp, stat, DPC_STATUS_DMA_BUSY # Is buffer still in use?
### BRANCH OCCURS TO noYield: if DP buffer is in DRAM
beq tmp, zero, noYield # If not, no yield
nop #
#
# instead of yield, wait for DP to finish
#
yieldwaitloop:
mfc0 tmp, CMD_STATUS
andi tmp, tmp, 0x100 # dma busy ?
bgtz tmp, yieldwaitloop # wait until not busy
noYield: #
nop
.end yieldSave
#
.unname tmp #
.unname stat #
#
#endif /* STARTUP_YIELD */
#############################################################
### RESTORE XBUS BUFFER IF NOT EMPTY ########################
#############################################################
#ifdef DONE_UNYIELD
#
# don't need to do anything anymore
#
#endif /* DONE_UNYIELD */