gtinit.s
3.83 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* Copyright 1995, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
* GRAPHICS, INC.
*
*/
/*
* File: gtinit.s
* Creator: hsa@sgi.com
* Create Date: Wed Oct 11 14:31:21 PDT 1995
*
* This in the init code for the 'turbo graphics task'
*
*/
############################################################################
#
# Begin task initialization
#
# Register $1 holds the task header address
# format for the task header:
# (see sptask.h)
#
#
.ent doInit
doInit:
# set RSP yield flags to FALSE (IMPORTANT: don't clear yield flag)
ori $2,zero, (SP_CLR_YIELDED|SP_CLR_TASKDONE)
mtc0 $2, SP_STATUS
# reset output pointers
lw $2, OS_TASK_OFF_OUTBUFF($1)
lw $3, OS_TASK_OFF_OUTBUFF_SZ($1)
#ifdef OUTPUT_DRAM
sw $2, RSP_STATE_DRAM_OUTP(rsp_state)
#else
sw $0, RSP_STATE_DRAM_OUTP(rsp_state)
#endif
sw $3, RSP_STATE_DRAM_OUT_LENP(rsp_state)
#
# important constants:
#
lqv vconst[0], VCONST_OFFSET(zero)
lqv vconst1[0], VCONST1_OFFSET(zero)
#if 0
#
# The task header should tell us if this is a restart
# of a previously checkpointed run. If so, do some special
# init sequence.
#
.name yield, $2
lw yield, (RSP_TASK_OFFSET+OS_TASK_OFF_FLAGS)(zero)
andi yield, yield, OS_TASK_YIELDED
bne yield, zero, RSPYieldRestart
nop
.unname yield
#endif
# OUTPUT: initialize CP0 registers
# This assumes the DP is idle. We expect the
# host (or boot code) to enforce this.
#ifdef OUTPUT_DRAM
addi $4, zero, DPC_CLR_XBUS_DMEM_DMA
mtc0 $4, CMD_STATUS
addi outp, zero, RSP_OUTPUT_OFFSET
#else
#ifdef OUTPUT_FIFO
.name bufend, $3
# reset output pointers
lw outp, OS_TASK_OFF_OUTBUFF($1)
lw bufend, OS_TASK_OFF_OUTBUFF_SZ($1)
sw outp, RSP_STATE_FIFO_BUF_TOP(rsp_state)
sw bufend, RSP_STATE_FIFO_BUF_END(rsp_state)
mfc0 $4, CMD_STATUS
andi $4, $4, DPC_STATUS_XBUS_DMEM_DMA
bne $4, zero, restart_fifo
mfc0 $4, CMD_END
sub outp, outp, $4
bgtz outp, restart_fifo
mfc0 $5, CMD_CURRENT
beq $5, zero, restart_fifo
nop
beq $5, $4, restart_fifo
nop
j set_fifo
ori bufend, $4, 0
restart_fifo:
mfc0 $4, CMD_STATUS
andi $4, $4, DPC_STATUS_START_VALID
bne $4, zero, restart_fifo
addi $4, zero, DPC_CLR_XBUS_DMEM_DMA
### LOOP TO restart_fifo: UNTIL START_VALID=0
mtc0 $4, CMD_STATUS
mtc0 bufend, CMD_START
mtc0 bufend, CMD_END
set_fifo:
sw bufend, RSP_STATE_FIFO_OUTP(rsp_state)
addi outp, zero, RSP_OUTPUT_OFFSET
.unname bufend
#else /* XBUS */
addi $4, zero, DPC_SET_XBUS_DMEM_DMA
addi outp, zero, 0x1000 # DP initial conditions
mtc0 $4, CMD_STATUS
mtc0 outp, CMD_START
mtc0 outp, CMD_END
#endif
#endif
#
# get the first display list out of the header and
# start the DMA of the display list into DMEM.
jal LoadDL
lw inp, OS_TASK_OFF_DATA($1)
#
# while DMA is going on, do some initializations:
#
#
#
#
# end of initialization section
#
############################################################################
.end doInit