xref: /csrg-svn/sys/pmax/stand/start.s (revision 56233)
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*56233Sralph *	@(#)start.s	7.3 (Berkeley) 09/13/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
2853944Sralph#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
37*56233Sralph	.globl	start
3852132Smckusickstart:
39*56233Sralph	.set	noreorder
40*56233Sralph	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
41*56233Sralph	li	sp, MACH_CODE_START - START_FRAME
42*56233Sralph	la	gp, _gp
43*56233Sralph	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
44*56233Sralph	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
45*56233Sralph	jal	main				# main(argc, argv, envp)
46*56233Sralph	nop
47*56233Sralph	li	a0, Init			# done, so call prom
48*56233Sralph	j	a0
4952132Smckusick
50*56233Sralph/* dummy routine for gcc2 */
51*56233Sralph	.globl	__main
52*56233Sralph__main:
53*56233Sralph	j	ra
54*56233Sralph	nop
55*56233Sralph
56*56233Sralph	.globl	Boot_Transfer
5752132SmckusickBoot_Transfer:
58*56233Sralph	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
59*56233Sralph	li	sp, MACH_CODE_START - START_FRAME
60*56233Sralph	la	gp, _gp
61*56233Sralph	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
62*56233Sralph	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
63*56233Sralph	jal	a3				# Jump to routine
64*56233Sralph	nop
65