start.c revision 139738
155714Skris/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */
255714Skris/*-
355714Skris * Copyright (C) 1995, 1996 Wolfgang Solfrank.
455714Skris * Copyright (C) 1995, 1996 TooLs GmbH.
555714Skris * All rights reserved.
655714Skris *
755714Skris * Redistribution and use in source and binary forms, with or without
8296341Sdelphij * modification, are permitted provided that the following conditions
955714Skris * are met:
1055714Skris * 1. Redistributions of source code must retain the above copyright
1155714Skris *    notice, this list of conditions and the following disclaimer.
1255714Skris * 2. Redistributions in binary form must reproduce the above copyright
1355714Skris *    notice, this list of conditions and the following disclaimer in the
1455714Skris *    documentation and/or other materials provided with the distribution.
15296341Sdelphij * 3. All advertising materials mentioning features or use of this software
1655714Skris *    must display the following acknowledgement:
1755714Skris *	This product includes software developed by TooLs GmbH.
1855714Skris * 4. The name of TooLs GmbH may not be used to endorse or promote products
1955714Skris *    derived from this software without specific prior written permission.
2055714Skris *
2155714Skris * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
22296341Sdelphij * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2355714Skris * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2455714Skris * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2555714Skris * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2655714Skris * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2755714Skris * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2855714Skris * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2955714Skris * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3055714Skris * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3155714Skris */
3255714Skris
3355714Skris#include <sys/cdefs.h>
3455714Skris__FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 139738 2005-01-05 22:16:58Z imp $");
3555714Skris
3655714Skris#include <stand.h>
37296341Sdelphij#include "libofw.h"
3855714Skris
3955714Skrisvoid startup(void *, int, int (*)(void *), char *, int);
40296341Sdelphij
4155714Skris__asm("				\n\
4255714Skris	.data			\n\
4355714Skrisstack:				\n\
4455714Skris	.space	16388		\n\
4555714Skris				\n\
4655714Skris	.text			\n\
4755714Skris	.globl	_start		\n\
4855714Skris_start:				\n\
4955714Skris	lis	%r1,stack@ha	\n\
5055714Skris	addi	%r1,%r1,stack@l	\n\
5155714Skris	addi	%r1,%r1,8192	\n\
52296341Sdelphij				\n\
5355714Skris	b	startup		\n\
5455714Skris");
5555714Skris
5655714Skrisvoid
5755714Skrisstartup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
58109998Smarkm{
59162911Ssimon	main(openfirm);
60109998Smarkm}
61109998Smarkm