bootinfo.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
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/*
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Copyright 2007 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#pragma ident "%Z%%M% %I% %E% SMI"
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#ifdef __cplusplus
ae115bc77f6fcde83175c75b4206dc2e50747966mrjextern "C" {
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
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
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 {
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bm_addr;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bm_size;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj uint32_t bm_padding;
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;
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;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj native_ptr_t bi_mb_info;
ae115bc77f6fcde83175c75b4206dc2e50747966mrj};
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#pragma pack()
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#ifdef __cplusplus
ae115bc77f6fcde83175c75b4206dc2e50747966mrj}
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif
ae115bc77f6fcde83175c75b4206dc2e50747966mrj
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#endif /* _SYS_BOOTINFO_H */