xref: /csrg-svn/sys/pmax/stand/start.s (revision 53944)
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*53944Sralph *	@(#)start.s	7.2 (Berkeley) 06/06/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*53944Sralph#include "../include/regdef.h"
2952132Smckusick#include "../include/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
3752132Smckusick    .globl	start
3852132Smckusickstart:
3952132Smckusick    .set noreorder
4052132Smckusick    mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
4152132Smckusick    li		sp, MACH_CODE_START - START_FRAME
4252132Smckusick    la		gp, _gp
4352132Smckusick    sw		zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
4452132Smckusick    sw		zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
4552132Smckusick    jal		main				# main(argc, argv, envp)
4652132Smckusick    nop
4752132Smckusick    li		a0, Init			# done, so call prom
4852132Smckusick    j		a0
4952132Smckusick
5052132Smckusick    .globl	Boot_Transfer
5152132SmckusickBoot_Transfer:
5252132Smckusick    mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
5352132Smckusick    li		sp, MACH_CODE_START - START_FRAME
5452132Smckusick    la		gp, _gp
5552132Smckusick    sw		zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
5652132Smckusick    sw		zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
5752132Smckusick    jal		a3				# Jump to routine
5852132Smckusick    nop
59