xref: /illumos-gate/usr/src/psm/stand/bootlst/sparc/srt0.S (revision 5d9d9091f564c198a760790b0bfa72c44e17912b)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ident	"%Z%%M%	%I%	%E% SMI"
27
28/*
29 * srt0.s - bootlst startup code
30 */
31#include <sys/asm_linkage.h>
32#include <sys/machparam.h>
33
34#define	STKSIZE	0x1000
35
36#if defined(lint)
37void *estack;
38caddr_t _end;
39#endif
40
41#if defined(lint)
42
43/* ARGSUSED */
44void
45_start(void *a, ...)
46{}
47
48#else	/* !lint */
49
50	.seg	".bss"
51	.align	MMU_PAGESIZE
52	.skip	STKSIZE
53estack:					! top of cprboot stack
54	.global	estack
55
56	.seg	".data"
57	.align	8
58local_cif:
59	.xword	0			! space for prom cookie
60
61	.seg	".text"
62	.align	8
63
64	!
65	! regs on entry:
66	! %o4 = prom cookie
67	!
68	ENTRY(_start)
69	set	estack - STACK_BIAS, %o5
70	save	%o5, -SA(MINFRAME), %sp
71
72	!
73	! clear the bss
74	!
75	set	_edata, %o0
76	set	_end, %g2
77	call	bzero
78	sub	%g2, %o0, %o1		! bss size = (_end - _edata)
79
80	set	local_cif, %g2
81	stx	%i4, [%g2]
82	call	main
83	mov	%i4, %o0		! SPARCV9/CIF
84
85	call	prom_exit_to_mon
86	nop
87	SET_SIZE(_start)
88
89#endif	/* lint */
90
91
92#if defined(lint)
93
94/* ARGSUSED */
95int
96client_handler(void *cif_handler, void *arg_array)
97{ return (0); }
98
99#else
100
101	!
102	! 64/64 client interface for ieee1275 prom
103	!
104	ENTRY(client_handler)
105	mov	%o7, %g1
106	mov	%o0, %g5
107	mov	%o1, %o0
108	jmp	%g5
109	mov	%g1, %o7
110	SET_SIZE(client_handler)
111
112#endif	/* lint */
113
114