bootinfo.h revision 0181461b79a0991f2269dad3ef978086e6c70257
ae115bc77f6fcde83175c75b4206dc2e50747966mrj/*
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * CDDL HEADER START
ae115bc77f6fcde83175c75b4206dc2e50747966mrj *
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * The contents of this file are subject to the terms of the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Common Development and Distribution License (the "License").
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * You may not use this file except in compliance with the License.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj *
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * or http://www.opensolaris.org/os/licensing.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * See the License for the specific language governing permissions
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * and limitations under the License.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj *
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * When distributing Covered Code, include this CDDL HEADER in each
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * If applicable, add the following below this CDDL HEADER, with the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * fields enclosed by brackets "[]" replaced with your own identifying
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * information: Portions Copyright [yyyy] [name of copyright owner]
ae115bc77f6fcde83175c75b4206dc2e50747966mrj *
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * CDDL HEADER END
ae115bc77f6fcde83175c75b4206dc2e50747966mrj */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj/*
1de082f7b7fd4b6629e14b0f9b8f94f6c0bda3c2Vikram Hegde * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Use is subject to license terms.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#ifndef _SYS_BOOTINFO_H
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#define _SYS_BOOTINFO_H
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#ifdef __cplusplus
ae115bc77f6fcde83175c75b4206dc2e50747966mrjextern "C" {
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski/*
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski * This is used by bootfs and dboot. It should be at least as large as the
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski * number of modules that bootloaders (e.g., grub) can support. This figure
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski * has been chosen to match grub's value exactly.
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski */
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski#define MAX_BOOT_MODULES 99
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski
ae115bc77f6fcde83175c75b4206dc2e50747966mrj/*
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * The 32-bit kernel loader code needs to build several structures that the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * kernel is expecting. They will contain native sized pointers for the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * target kernel.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#if defined(_BOOT_TARGET_amd64)
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrjtypedef uint64_t native_ptr_t;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#elif defined(_BOOT_TARGET_i386)
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrjtypedef uint32_t native_ptr_t;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#elif defined(_KERNEL)
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrjtypedef void *native_ptr_t;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowskitypedef enum boot_module_type {
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski BMT_ROOTFS,
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski BMT_FILE,
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski BMT_HASH
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski} boot_module_type_t;
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstruct boot_memlist {
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint64_t addr;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint64_t size;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t next;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t prev;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj};
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj/*
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * The kernel needs to know how to find its modules.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj */
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstruct boot_modules {
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski native_ptr_t bm_addr;
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski native_ptr_t bm_name;
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski native_ptr_t bm_hash;
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski uint32_t bm_size;
0181461b79a0991f2269dad3ef978086e6c70257Keith M Wesolowski boot_module_type_t bm_type;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj};
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj/*
ae115bc77f6fcde83175c75b4206dc2e50747966mrj *
ae115bc77f6fcde83175c75b4206dc2e50747966mrj */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#pragma pack(1)
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstruct xboot_info {
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint64_t bi_next_paddr; /* next physical address not used */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_next_vaddr; /* next virtual address not used */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_cmdline;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_phys_install;
1de082f7b7fd4b6629e14b0f9b8f94f6c0bda3c2Vikram Hegde native_ptr_t bi_rsvdmem;
c9464e8ba8697e799ceb2a4c284803137a386109josephb native_ptr_t bi_pcimem;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_modules;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bi_module_cnt;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bi_use_largepage; /* MMU uses large pages */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bi_use_pae; /* MMU uses PAE mode (8 byte PTES) */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bi_use_nx; /* MMU uses NX bit in PTEs */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bi_use_pge; /* MMU uses Page Global Enable */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_pt_window;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_pte_to_pt_window;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_kseg_size; /* size used for kernel nucleus pages */
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint64_t bi_top_page_table;
843e19887f64dde75055cf8842fc4db2171eff45johnlev#if defined(__xpv)
843e19887f64dde75055cf8842fc4db2171eff45johnlev native_ptr_t bi_xen_start_info;
843e19887f64dde75055cf8842fc4db2171eff45johnlev native_ptr_t bi_shared_info; /* VA for shared_info */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#else
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_mb_info;
843e19887f64dde75055cf8842fc4db2171eff45johnlev#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj};
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#pragma pack()
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#ifdef __cplusplus
ae115bc77f6fcde83175c75b4206dc2e50747966mrj}
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif /* _SYS_BOOTINFO_H */