1*f14fb602SLionel Sambuc/* $NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $ */ 2e83f7ba2SBen Gras 3e83f7ba2SBen Gras/* 4e83f7ba2SBen Gras * Copyright (c) 1998 Christos Zoulas 5e83f7ba2SBen Gras * Copyright (c) 1995 Christopher G. Demetriou 6e83f7ba2SBen Gras * All rights reserved. 7e83f7ba2SBen Gras * 8e83f7ba2SBen Gras * Redistribution and use in source and binary forms, with or without 9e83f7ba2SBen Gras * modification, are permitted provided that the following conditions 10e83f7ba2SBen Gras * are met: 11e83f7ba2SBen Gras * 1. Redistributions of source code must retain the above copyright 12e83f7ba2SBen Gras * notice, this list of conditions and the following disclaimer. 13e83f7ba2SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 14e83f7ba2SBen Gras * notice, this list of conditions and the following disclaimer in the 15e83f7ba2SBen Gras * documentation and/or other materials provided with the distribution. 16e83f7ba2SBen Gras * 3. All advertising materials mentioning features or use of this software 17e83f7ba2SBen Gras * must display the following acknowledgement: 18e83f7ba2SBen Gras * This product includes software developed for the 19e83f7ba2SBen Gras * NetBSD Project. See http://www.NetBSD.org/ for 20e83f7ba2SBen Gras * information about NetBSD. 21e83f7ba2SBen Gras * 4. The name of the author may not be used to endorse or promote products 22e83f7ba2SBen Gras * derived from this software without specific prior written permission. 23e83f7ba2SBen Gras * 24e83f7ba2SBen Gras * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 25e83f7ba2SBen Gras * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26e83f7ba2SBen Gras * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 27e83f7ba2SBen Gras * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 28e83f7ba2SBen Gras * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 29e83f7ba2SBen Gras * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30e83f7ba2SBen Gras * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31e83f7ba2SBen Gras * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32e83f7ba2SBen Gras * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33e83f7ba2SBen Gras * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34e83f7ba2SBen Gras * 35e83f7ba2SBen Gras * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 36e83f7ba2SBen Gras */ 37e83f7ba2SBen Gras 38e83f7ba2SBen Gras#include <machine/asm.h> 39e83f7ba2SBen Gras 40*f14fb602SLionel SambucRCSID("$NetBSD: crt0.S,v 1.4 2012/01/31 20:17:57 uwe Exp $") 41e83f7ba2SBen Gras 42e83f7ba2SBen GrasSTRONG_ALIAS(_start,__start) 43e83f7ba2SBen Gras 44*f14fb602SLionel Sambuc/* 45*f14fb602SLionel Sambuc * Kernel setregs() passes arguments for the 6-argument version of 46*f14fb602SLionel Sambuc * ___start (but with 5th and 6th in registers, to avoid copyout). 47*f14fb602SLionel Sambuc * Since we now use 3-argument version of ___start - that obtains 48*f14fb602SLionel Sambuc * argc, argv and environ from ps_strings - move its arguments to 49*f14fb602SLionel Sambuc * proper registers. 50*f14fb602SLionel Sambuc */ 51e83f7ba2SBen Gras_ENTRY(__start) 52*f14fb602SLionel Sambuc mov.l .L___start, r0 53*f14fb602SLionel Sambuc mov r7, r4 ! void (*cleanup)(void) 54*f14fb602SLionel Sambuc mov r8, r5 ! const Obj_Entry *obj 55*f14fb602SLionel Sambuc jmp @r0 56*f14fb602SLionel Sambuc mov r9, r6 ! struct ps_strings *ps_strings 57*f14fb602SLionel Sambuc 58*f14fb602SLionel Sambuc .p2align 2 59*f14fb602SLionel Sambuc.L___start: .long _C_LABEL(___start) 60