/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (C) 1994 by Rodney W. Grimes, Milwaukie, Oregon 972224* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer as11* the first lines of this file unmodified.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15* 3. All advertising materials mentioning features or use of this software16* must display the following acknowledgement:17* This product includes software developed by Rodney W. Grimes.18* 4. The name of the author may not be used to endorse or promote products19* derived from this software without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY RODNEY W. GRIMES ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL RODNEY W. GRIMES BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/3334#ifndef _MACHINE_BOOTINFO_H_35#define _MACHINE_BOOTINFO_H_3637/* Only change the version number if you break compatibility. */38#define BOOTINFO_VERSION 13940#define _WAS_N_BIOS_GEOM 84142/*43* A zero bootinfo field often means that there is no info available.44* Assumes booting with a boot loader from FreeBSD 2.1 or newer and45* that bi_size is always valid when bi_version == 1.46*/47struct bootinfo {48u_int32_t bi_version; /* Must be 1 */49u_int32_t bi_kernelname; /* represents a char * */50u_int32_t bi_nfs_diskless; /* struct nfs_diskless * */51u_int32_t _was_bi_n_bios_used;52u_int32_t _was_bi_bios_geom[_WAS_N_BIOS_GEOM];53u_int32_t bi_size;54u_int8_t bi_memsizes_valid;55u_int8_t bi_bios_dev; /* bootdev BIOS unit number (bootX -> loader only) */56u_int8_t bi_pad[2];57u_int32_t bi_basemem;58u_int32_t bi_extmem;59u_int32_t bi_symtab; /* struct symtab * */60u_int32_t bi_esymtab; /* struct symtab * */61/* Items below only from advanced bootloader */62u_int32_t bi_kernend; /* end of kernel space */63u_int32_t bi_envp; /* environment */64u_int32_t bi_modulep; /* preloaded modules */65};6667#ifdef _KERNEL68extern struct bootinfo bootinfo;69#endif7071/*72* Constants for converting boot-style device number to type,73* adaptor (uba, mba, etc), unit number and partition number.74* Type (== major device number) is in the low byte75* for backward compatibility. Except for that of the "magic76* number", each mask applies to the shifted value.77* Format:78* (4) (8) (4) (8) (8)79* --------------------------------80* |MA | SLICE | UN| PART | TYPE |81* --------------------------------82*/83#define B_SLICESHIFT 2084#define B_SLICEMASK 0xff85#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)86#define B_UNITSHIFT 1687#define B_UNITMASK 0xf88#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)89#define B_PARTITIONSHIFT 890#define B_PARTITIONMASK 0xff91#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)92#define B_TYPESHIFT 093#define B_TYPEMASK 0xff94#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)9596#define B_MAGICMASK 0xf000000097#define B_DEVMAGIC 0xa00000009899#define MAKEBOOTDEV(type, slice, unit, partition) \100(((type) << B_TYPESHIFT) | ((slice) << B_SLICESHIFT) | \101((unit) << B_UNITSHIFT) | ((partition) << B_PARTITIONSHIFT) | \102B_DEVMAGIC)103104#define BASE_SLICE 2105#define COMPATIBILITY_SLICE 0106#define MAX_SLICES 32107#define WHOLE_DISK_SLICE 1108109#endif /* !_MACHINE_BOOTINFO_H_ */110111112