xref: /netbsd-src/lib/csu/arch/sparc/crt0.S (revision 463db15fc5682db56ff220ac07095d19ef907554)
1*463db15fSjoerg/* $NetBSD: crt0.S,v 1.3 2018/11/26 17:37:45 joerg Exp $ */
201bc9d50Sjoerg
301bc9d50Sjoerg/*
401bc9d50Sjoerg * Copyright (c) 1998 Christos Zoulas
501bc9d50Sjoerg * Copyright (c) 1995 Christopher G. Demetriou
601bc9d50Sjoerg * All rights reserved.
701bc9d50Sjoerg *
801bc9d50Sjoerg * Redistribution and use in source and binary forms, with or without
901bc9d50Sjoerg * modification, are permitted provided that the following conditions
1001bc9d50Sjoerg * are met:
1101bc9d50Sjoerg * 1. Redistributions of source code must retain the above copyright
1201bc9d50Sjoerg *    notice, this list of conditions and the following disclaimer.
1301bc9d50Sjoerg * 2. Redistributions in binary form must reproduce the above copyright
1401bc9d50Sjoerg *    notice, this list of conditions and the following disclaimer in the
1501bc9d50Sjoerg *    documentation and/or other materials provided with the distribution.
1601bc9d50Sjoerg * 3. All advertising materials mentioning features or use of this software
1701bc9d50Sjoerg *    must display the following acknowledgement:
1801bc9d50Sjoerg *          This product includes software developed for the
1901bc9d50Sjoerg *          NetBSD Project.  See http://www.NetBSD.org/ for
2001bc9d50Sjoerg *          information about NetBSD.
2101bc9d50Sjoerg * 4. The name of the author may not be used to endorse or promote products
2201bc9d50Sjoerg *    derived from this software without specific prior written permission.
2301bc9d50Sjoerg *
2401bc9d50Sjoerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2501bc9d50Sjoerg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2601bc9d50Sjoerg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2701bc9d50Sjoerg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2801bc9d50Sjoerg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2901bc9d50Sjoerg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3001bc9d50Sjoerg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3101bc9d50Sjoerg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3201bc9d50Sjoerg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3301bc9d50Sjoerg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3401bc9d50Sjoerg *
3501bc9d50Sjoerg * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
3601bc9d50Sjoerg */
3701bc9d50Sjoerg
3801bc9d50Sjoerg#include <machine/asm.h>
3901bc9d50Sjoerg
40*463db15fSjoergRCSID("$NetBSD: crt0.S,v 1.3 2018/11/26 17:37:45 joerg Exp $")
4101bc9d50Sjoerg
4201bc9d50SjoergSTRONG_ALIAS(_start,__start)
4301bc9d50Sjoerg
44724aa133Smartin	! called with:
45724aa133Smartin	!  %g3 = cleanup
46724aa133Smartin	!  %g1 = ps_strings
47*463db15fSjoerg	! call: ___start(cleanup, ps_strings)
4801bc9d50Sjoerg_ENTRY(__start)
4901bc9d50Sjoerg	mov	0, %fp
50724aa133Smartin	andn	%sp, 7,	%sp		! align stack
5101bc9d50Sjoerg	sub	%sp, 24, %sp		! expand to standard stack frame size
52724aa133Smartin	mov	%g3, %o0
5301bc9d50Sjoerg	call	___start
54*463db15fSjoerg	 mov	%g1, %o1
55724aa133Smartin
56