bootops.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1996-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Implementation of the vestigial bootops vector for platforms using the
* 1275-like boot interfaces.
*/
#include <sys/bootconf.h>
#include <stddef.h>
#include "boot_plat.h"
#ifdef DEBUG
extern int debug;
#else
static const int debug = 0;
#endif
extern void closeall(int);
/*
* This is the number for this version of bootops, which is vestigial.
* Standalones that require the old bootops will look in bootops.bsys_version,
* see this number is higher than they expect and fail gracefully.
* They can make this "peek" successfully even if they are ILP32 programs.
*/
int boot_version = BO_VERSION;
void
setup_bootops(void)
{
/* sanity-check bsys_printf - old kernels need to fail with a message */
#if !defined(lint)
printf("boot: bsys_printf is at offset 0x%lx instead of 60\n"
"boot: this will likely make old kernels die without "
"printing a message.\n",
}
/* sanity-check bsys_1275_call - if it moves, kernels cannot boot */
printf("boot: bsys_1275_call is at offset 0x%lx instead of 24\n"
"boot: this will likely break the kernel\n",
}
#endif
/* so old kernels die with a message */
if (!memlistpage) /* paranoia runs rampant */
prom_panic("\nMemlistpage not setup yet.");
/*
* The memory list should always be updated last. The prom
* calls which are made to update a memory list may have the
* undesirable affect of claiming physical memory. This may
* happen after the kernel has created its page free list.
* The kernel deals with this by comparing the n and n-1
* snapshots of memory. Updating the memory available list
* last guarantees we will have a current, accurate snapshot.
* See bug #1260786.
*/
dprintf("\nPhysinstalled: ");
dprintf("\nPhysfree: ");
dprintf("\nVirtfree: ");
}
void
install_memlistptrs(void)
{
/* prob only need 1 page for now */
}
/*
* A word of explanation is in order.
* This routine is meant to be called during
* boot_release(), when the kernel is trying
* to ascertain the current state of memory
* so that it can use a memlist to walk itself
* thru kvm_init().
*/
void
{
/* Just take another prom snapshot */
}
/*
* This routine is meant to be called by the
* kernel to shut down all boot and prom activity.
* After this routine is called, PROM or boot IO is no
* longer possible, nor is memory allocation.
*/
void
kern_killboot(void)
{
if (verbosemode) {
dprintf("Entering boot_release()\n");
dprintf("\nPhysinstalled: ");
dprintf("\nPhysfree: ");
dprintf("\nVirtfree: ");
}
if (debug) {
dprintf("Calling quiesce_io()\n");
}
/* close all open devices */
closeall(1);
/*
* Now we take YAPS (yet another Prom snapshot) of
* memory, just for safety sake.
*
* The memory list should always be updated last. The prom
* calls which are made to update a memory list may have the
* undesirable affect of claiming physical memory. This may
* happen after the kernel has created its page free list.
* The kernel deals with this by comparing the n and n-1
* snapshots of memory. Updating the memory available list
* last guarantees we will have a current, accurate snapshot.
* See bug #1260786.
*/
if (verbosemode) {
dprintf("Leaving boot_release()\n");
dprintf("Physinstalled: \n");
if (debug)
dprintf("Physfree:\n");
if (debug)
dprintf("Virtfree: \n");
if (debug)
}
#ifdef DEBUG_MMU
dump_mmu();
#endif
}
void
boot_fail_gracefully(void)
{
"mismatched version of /boot interface: new boot, old kernel");
}