bootops.c revision ca622e3ab18bb72e81149987556769fb415fb5da
1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License (the "License"). 1N/A * You may not use this file except in compliance with the License. 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * When distributing Covered Code, include this CDDL HEADER in each 1N/A * If applicable, add the following below this CDDL HEADER, with the 1N/A * fields enclosed by brackets "[]" replaced with your own identifying 1N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A * Definitions of interfaces that provide services from the secondary 1N/A * boot program to its clients (primarily Solaris, krtld, kmdb and their 1N/A * successors.) This interface replaces the bootops (BOP) implementation 1N/A * as the interface to be called by boot clients. /* fake bootops - it needs to point to non-NULL */ * Implementation of the "open" boot service. * Only look underneath archive for /etc files static char ind[] =
"|/-\\";
/* that's entertainment? */ * Implementation of the "read" boot service. * Implementation of the "seek" boot service. * Implementation of the "close" boot service. * Simple temp memory allocator * >PAGESIZE allocations are gotten directly from prom at bighand * smaller ones are satisfied from littlehand, which does a * 1 page bighand allocation when it runs out of memory * temporary memory storage until bop_tmp_freeall is called * (after the kernel heap is initialized) * OBP allocs 10MB to boot, which is where virthint = 0 * memory was allocated from. Without boot, we allocate * from BOOTTMPBASE and free when we're ready to take /* log it for bop_fini() */ * We have to call prom_free() with the same args * as we used in prom_alloc() * Implementation of the "alloc" boot service. * Similar to bop_alloc functionality except that * it will try to breakup into PAGESIZE chunk allocations * if the original single chunk request failed. * This routine does not guarantee physical contig * Normal request to prom_alloc has failed. * We will attempt to satisfy the request by allocating * smaller chunks resulting in allocation that * will be virtually contiguous but potentially * not physically contiguous. There are additional * requirements before we want to do this: * 1. virthirt must be PAGESIZE aligned. * 2. align must not be greater than PAGESIZE * 3. size request must be at least PAGESIZE * Otherwise, we will revert back to the original * bop_alloc behavior i.e. return failure. * Now we will break up the allocation * request in smaller chunks that are * always PAGESIZE aligned. /*LINTED E_FUNC_SET_NOT_USED*/ /* Can't really happen.. */ * Implementation of the "alloc_virt" boot service * Implementation of the "free" boot service. * Implementation of the "getproplen" boot service. * Implementation of the "getprop" boot service. * Implementation of the "print" boot service. * Special routine for kmdb * Implementation of the "mount" boot service. * Implementation of the "unmountroot" boot service. * Implementation of the "fstat" boot service. * If the ramdisk will eventually be root, or we weren't * booted via the archive, then nothing to do here * Blech. The C proms have a bug when freeing areas that cross * page sizes, so we have to break up the free into sections * bounded by the various pagesizes. * Large pages only used when size > 512k for (i =
3; i >= 0; i--) {
* Implementation of the "enter_mon" boot service. * free elf info allocated by booter /* Simple message to indicate that the bootops pointer has been zeroed */