xref: /original-bsd/sys/pmax/stand/start.s (revision d40fa777)
1/*
2 * Copyright (c) 1992 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Ralph Campbell.
7 *
8 * %sccs.include.redist.c%
9 *
10 *	@(#)start.s	7.4 (Berkeley) 10/11/92
11 *
12 * start.s -
13 *
14 *     Contains code that is the first executed at boot time.
15 *
16 *	Copyright (C) 1989 Digital Equipment Corporation.
17 *	Permission to use, copy, modify, and distribute this software and
18 *	its documentation for any purpose and without fee is hereby granted,
19 *	provided that the above copyright notice appears in all copies.
20 *	Digital Equipment Corporation makes no representations about the
21 *	suitability of this software for any purpose.  It is provided "as is"
22 *	without express or implied warranty.
23 *
24 * from: $Header: /sprite/src/boot/decprom/ds3100.md/RCS/start.s,
25 *	v 1.1 90/02/16 16:19:39 shirriff Exp $ SPRITE (DECWRL)
26 */
27
28#include <machine/regdef.h>
29#include <machine/machConst.h>
30
31/*
32 * Amount to take off of the stack for the benefit of the debugger.
33 */
34#define START_FRAME	((4 * 4) + 4 + 4)
35#define Init	0xbfc00018
36
37	.globl	start
38start:
39	.set	noreorder
40	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
41	li	sp, MACH_CODE_START - START_FRAME
42	la	gp, _gp
43	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
44	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
45	jal	main				# main(argc, argv, envp)
46	nop
47	li	a0, Init			# done, so call prom
48	j	a0
49
50/* dummy routine for gcc2 */
51	.globl	__main
52__main:
53	j	ra
54	nop
55
56	.globl	Boot_Transfer
57Boot_Transfer:
58	mtc0	zero, MACH_COP_0_STATUS_REG	# Disable interrupts
59	li	sp, MACH_CODE_START - START_FRAME
60	la	gp, _gp
61	sw	zero, START_FRAME - 4(sp)	# Zero out old ra for debugger
62	sw	zero, START_FRAME - 8(sp)	# Zero out old fp for debugger
63	jal	a3				# Jump to routine
64	nop
65