/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */1/*-2* Copyright (C) 1995, 1996 Wolfgang Solfrank.3* Copyright (C) 1995, 1996 TooLs GmbH.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. All advertising materials mentioning features or use of this software15* must display the following acknowledgement:16* This product includes software developed by TooLs GmbH.17* 4. The name of TooLs GmbH may not be used to endorse or promote products18* derived from this software without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR21* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES22* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.23* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,24* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,25* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;26* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,27* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR28* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF29* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/3132#include <stand.h>33#include "libofw.h"3435void startup(void *, int, int (*)(void *), char *, int);3637__asm(" \n\38.data \n\39.align 4 \n\40stack: \n\41.space 16388 \n\42\n\43.text \n\44.globl _start \n\45_start: \n\46lis %r1,stack@ha \n\47addi %r1,%r1,stack@l \n\48addi %r1,%r1,8192 \n\49\n\50/* Clear the .bss!!! */ \n\51li %r0,0 \n\52lis %r8,_edata@ha \n\53addi %r8,%r8,_edata@l\n\54lis %r9,_end@ha \n\55addi %r9,%r9,_end@l \n\56\n\571: cmpw 0,%r8,%r9 \n\58bge 2f \n\59stw %r0,0(%r8) \n\60addi %r8,%r8,4 \n\61b 1b \n\62\n\632: b startup \n\64");6566void main(int (*openfirm)(void *));6768void69startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)70{71main(openfirm);72}737475