tinit.s 2.11 KB

/**************************************************************************
 *								          *
 *               Copyright (C) 1994, Silicon Graphics, Inc.       	  *
 *								          *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *								          *
 *************************************************************************/

/*
 * File:		tinit.s
 * Creator:		acorn@sgi.com
 * Create Date:		9/22/95
 *
 * This in the init code for the 'manufacturing tests'
 *
 */


 ############################################################################
 #
 #  Begin task initialization
 #
 #  Register $1 holds the task header address
 # format for the task header:
 #	(see task.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)
	
	# 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
		addi	$4, zero, DPC_SET_XBUS_DMEM_DMA
 # 		addi	outp, zero, 0x1000	# DP initial conditions
 		addi	outp, zero, RSP_OUTPUT_OFFSET	# DP initial conditions
		mtc0	$4, CMD_STATUS
		mtc0	outp, CMD_START
		mtc0	outp, CMD_END
#endif
	
 #
 #
 #
 # end of initialization section
 #
 ############################################################################
		.end	doInit