fastboot.h revision 6915124bb75bc67ae012532a3a7727adc043a7cb
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FASTBOOT_H
#define _SYS_FASTBOOT_H
/*
* Platform dependent instruction sequences for fast reboot
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#include <sys/mach_mmu.h>
#endif /* _ASM */
#define FASTBOOT_NAME_UNIX 0
#define FASTBOOT_NAME_BOOTARCHIVE 1
#define FASTBOOT_UNIX 0
#define FASTBOOT_BOOTARCHIVE 1
#define FASTBOOT_SWTCH 2
/*
* Default sizes for varies information we have to save across boot for
* fast reboot. If the actual size is bigger than what we saved, abort
* fast reboot.
*/
#define FASTBOOT_SAVED_MMAP_COUNT 32
#define FASTBOOT_SAVED_DRIVES_MAX 8
#define FASTBOOT_SAVED_DRIVES_PORT_MAX 128
#define FASTBOOT_SAVED_DRIVES_SIZE \
FASTBOOT_SAVED_DRIVES_PORT_MAX * sizeof (uint16_t)) * \
/*
* dboot entry address comes from
*/
#define DBOOT_ENTRY_ADDRESS 0xc00000
/*
* Fake starting virtual address for creating mapping for the new kernel
* and boot_archive.
*/
#ifndef _ASM
#define MAX_ELF32_LOAD_SECTIONS 3
/*
* Data structure for specifying each section in a 32-bit ELF file.
*/
typedef struct fastboot_section
{
/*
* Data structure for describing each file that needs to be relocated from high
* memory to low memory for fast reboot. Currently these files are unix, the
* boot_archive, and the relocation function itself.
*/
typedef struct _fastboot_file {
int fb_sectcnt; /* actual number of sections */
/*
* Data structure containing all the information the switching routine needs
* for fast rebooting to the new kernel.
*
* NOTE: There is limited stack space (0x200 bytes) in the switcher to
* copy in the data structure. Fields that are not absolutely necessary for
* the switcher should be added after the fi_valid field.
*/
typedef struct _fastboot_info {
int fi_has_pae;
int fi_valid; /* is the new kernel valid */
int fi_top_level; /* top level of page tables */
/*
* Fast reboot core functions
*/
extern void fast_reboot(); /* Entry point for fb_switch */
extern void fastboot_load_kernel(char *); /* Load a new kernel */
extern int fastboot_cksum_verify(fastboot_info_t *);
/*
* Fast reboot tunables
*/
/* If set, the system is capable of fast reboot */
extern int fastreboot_capable;
/*
* If set, force fast reboot even if the system has
* drivers without quiesce(9E) implementation.
*/
extern int force_fastreboot;
/* If set, fast reboot after panic. */
extern int fastreboot_onpanic;
extern char fastreboot_onpanic_cmdline[FASTBOOT_SAVED_CMDLINE_LEN];
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FASTBOOT_H */