e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw/*
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * CDDL HEADER START
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw *
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * The contents of this file are subject to the terms of the
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * Common Development and Distribution License (the "License").
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * You may not use this file except in compliance with the License.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw *
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * or http://www.opensolaris.org/os/licensing.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * See the License for the specific language governing permissions
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * and limitations under the License.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw *
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * When distributing Covered Code, include this CDDL HEADER in each
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * If applicable, add the following below this CDDL HEADER, with the
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * fields enclosed by brackets "[]" replaced with your own identifying
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * information: Portions Copyright [yyyy] [name of copyright owner]
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw *
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * CDDL HEADER END
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw/*
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * Use is subject to license terms.
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#ident "%Z%%M% %I% %E% SMI"
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw/*
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw * srt0.s - bootlst startup code
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#include <sys/asm_linkage.h>
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#include <sys/machparam.h>
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#define STKSIZE 0x1000
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#if defined(lint)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwvoid *estack;
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwcaddr_t _end;
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#endif
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#if defined(lint)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw/* ARGSUSED */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwvoid
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw_start(void *a, ...)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw{}
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#else /* !lint */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .seg ".bss"
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .align MMU_PAGESIZE
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .skip STKSIZE
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwestack: ! top of cprboot stack
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .global estack
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .seg ".data"
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .align 8
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwlocal_cif:
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .xword 0 ! space for prom cookie
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .seg ".text"
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw .align 8
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ! regs on entry:
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ! %o4 = prom cookie
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ENTRY(_start)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw set estack - STACK_BIAS, %o5
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw save %o5, -SA(MINFRAME), %sp
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ! clear the bss
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw set _edata, %o0
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw set _end, %g2
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw call bzero
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw sub %g2, %o0, %o1 ! bss size = (_end - _edata)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw set local_cif, %g2
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw stx %i4, [%g2]
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw call main
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw mov %i4, %o0 ! SPARCV9/CIF
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw call prom_exit_to_mon
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw nop
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw SET_SIZE(_start)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#endif /* lint */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#if defined(lint)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw/* ARGSUSED */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwint
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gwclient_handler(void *cif_handler, void *arg_array)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw{ return (0); }
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#else
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ! 64/64 client interface for ieee1275 prom
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw !
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw ENTRY(client_handler)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw mov %o7, %g1
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw mov %o0, %g5
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw mov %o1, %o0
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw jmp %g5
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw mov %g1, %o7
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw SET_SIZE(client_handler)
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw#endif /* lint */
e7cbe64f7a72dae5cb44f100db60ca88f3313c65gw