xref: /csrg-svn/sys/pmax/stand/start.s (revision 56526)
152132Smckusick/*
252132Smckusick * Copyright (c) 1992 Regents of the University of California.
352132Smckusick * All rights reserved.
452132Smckusick *
552132Smckusick * This code is derived from software contributed to Berkeley by
652132Smckusick * Ralph Campbell.
752132Smckusick *
852132Smckusick * %sccs.include.redist.c%
952132Smckusick *
10*56526Sbostic *	@(#)start.s	7.4 (Berkeley) 10/11/92
1152132Smckusick *
1252132Smckusick * start.s -
1352132Smckusick *
1452132Smckusick *     Contains code that is the first executed at boot time.
1552132Smckusick *
1652132Smckusick *	Copyright (C) 1989 Digital Equipment Corporation.
1752132Smckusick *	Permission to use, copy, modify, and distribute this software and
1852132Smckusick *	its documentation for any purpose and without fee is hereby granted,
1952132Smckusick *	provided that the above copyright notice appears in all copies.
2052132Smckusick *	Digital Equipment Corporation makes no representations about the
2152132Smckusick *	suitability of this software for any purpose.  It is provided "as is"
2252132Smckusick *	without express or implied warranty.
2352132Smckusick *
2452132Smckusick * from: $Header: /sprite/src/boot/decprom/ds3100.md/RCS/start.s,
2552132Smckusick *	v 1.1 90/02/16 16:19:39 shirriff Exp $ SPRITE (DECWRL)
2652132Smckusick */
2752132Smckusick
28*56526Sbostic#include <machine/regdef.h>
29*56526Sbostic#include <machine/machConst.h>
3052132Smckusick
3152132Smckusick/*
3252132Smckusick * Amount to take off of the stack for the benefit of the debugger.
3352132Smckusick */
3452132Smckusick#define START_FRAME	((4 * 4) + 4 + 4)
3552132Smckusick#define Init	0xbfc00018
3652132Smckusick
3756233Sralph	.globl	start
3852132Smckusickstart:
3956233Sralph	.set	noreorder
4056233Sralph	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
4156233Sralph	li	sp, MACH_CODE_START - START_FRAME
4256233Sralph	la	gp, _gp
4356233Sralph	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
4456233Sralph	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
4556233Sralph	jal	main				# main(argc, argv, envp)
4656233Sralph	nop
4756233Sralph	li	a0, Init			# done, so call prom
4856233Sralph	j	a0
4952132Smckusick
5056233Sralph/* dummy routine for gcc2 */
5156233Sralph	.globl	__main
5256233Sralph__main:
5356233Sralph	j	ra
5456233Sralph	nop
5556233Sralph
5656233Sralph	.globl	Boot_Transfer
5752132SmckusickBoot_Transfer:
5856233Sralph	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
5956233Sralph	li	sp, MACH_CODE_START - START_FRAME
6056233Sralph	la	gp, _gp
6156233Sralph	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
6256233Sralph	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
6356233Sralph	jal	a3				# Jump to routine
6456233Sralph	nop
65