1# $OpenBSD: genfth.cf,v 1.6 2020/04/02 06:06:22 otto Exp $ 2# $NetBSD: genfth.cf,v 1.9 2013/06/10 10:26:22 hannken Exp $ 3 4# 5# Copyright (c) 1997 The NetBSD Foundation, Inc. 6# All rights reserved. 7# 8# This code is derived from software contributed to The NetBSD Foundation 9# by Christos Zoulas. 10# 11# Redistribution and use in source and binary forms, with or without 12# modification, are permitted provided that the following conditions 13# are met: 14# 1. Redistributions of source code must retain the above copyright 15# notice, this list of conditions and the following disclaimer. 16# 2. Redistributions in binary form must reproduce the above copyright 17# notice, this list of conditions and the following disclaimer in the 18# documentation and/or other materials provided with the distribution. 19# 20# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30# POSSIBILITY OF SUCH DAMAGE. 31# 32# Copyright (c) 1992, 1993 33# The Regents of the University of California. All rights reserved. 34# 35# This software was developed by the Computer Systems Engineering group 36# at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 37# contributed to Berkeley. 38# 39# All advertising materials mentioning features or use of this software 40# must display the following acknowledgement: 41# This product includes software developed by the University of 42# California, Lawrence Berkeley Laboratory. 43# 44# Redistribution and use in source and binary forms, with or without 45# modification, are permitted provided that the following conditions 46# are met: 47# 1. Redistributions of source code must retain the above copyright 48# notice, this list of conditions and the following disclaimer. 49# 2. Redistributions in binary form must reproduce the above copyright 50# notice, this list of conditions and the following disclaimer in the 51# documentation and/or other materials provided with the distribution. 52# 3. All advertising materials mentioning features or use of this software 53# must display the following acknowledgement: 54# This product includes software developed by the University of 55# California, Berkeley and its contributors. 56# 4. Neither the name of the University nor the names of its contributors 57# may be used to endorse or promote products derived from this software 58# without specific prior written permission. 59# 60# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 61# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 63# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 64# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 65# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 66# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 67# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70# SUCH DAMAGE. 71# 72# @(#)genassym.c 8.1 (Berkeley) 6/11/93 73# 74 75include <sys/param.h> 76include <sys/disklabel.h> 77include <sys/time.h> 78 79include <dev/sun/disklabel.h> 80 81include <ufs/ufs/dinode.h> 82include <ufs/ufs/dir.h> 83include <ufs/ffs/fs.h> 84 85#ifdef SOFTRAID 86include <sys/stdarg.h> /* XXX */ 87include <sys/device.h> 88include <sys/sensors.h> 89include <dev/softraidvar.h> 90include <dev/biovar.h> 91#endif 92 93# 94# sun disklabel 95# 96struct sun_disklabel 97member sl_types 98member sl_magic 99 100define sun_dkmagic SUN_DKMAGIC 101define fs_bsdffs FS_BSDFFS 102define fs_raid FS_RAID 103 104# 105# ufs sizing constants 106# 107define dev_bsize DEV_BSIZE 108define maxbsize MAXBSIZE 109define bbsize BBSIZE 110define sbsize SBLOCKSIZE 111define bboff BBOFF 112define sboff SBLOCK_UFS1 113define bblock BBLOCK 114# XXX: Will not work for UFS2! 115define sblock SBLOCK_UFS1 116 117# 118# ufs superblock 119# 120struct fs 121member fs_magic 122member fs_bsize 123member fs_npsect 124member fs_nsect 125member fs_interleave 126member fs_postblformat 127member fs_nrpos 128member fs_inodefmt 129member fs_maxfilesize 130member fs_qbmask 131member fs_qfmask 132member fs_bmask 133member fs_fmask 134member fs_ipg 135member fs_fpg 136member fs_inopb 137member fs_fragshift 138member fs_bshift 139member fs_fshift 140member fs_cgoffset 141member fs_cgmask 142member fs_dblkno 143member fs_iblkno 144member fs_sblkno 145member fs_cblkno 146member fs_fsbtodb 147member fs_nindir 148member fs_frag 149member fs_maxsymlinklen 150 151# 152# ufs1 dinode 153# 154struct ufs1_dinode 155member di1_size di_size 156member di1_mode di_mode 157member di1_db di_db 158member di1_ib di_ib 159 160# 161# ufs2 dinode 162# 163struct ufs2_dinode 164member di2_size di_size 165member di2_mode di_mode 166member di2_db di_db 167member di2_ib di_ib 168 169# 170# ufs direct 171# 172struct direct 173member d_ino 174member d_reclen 175#member d_type # notused 176member d_namlen 177member d_name 178 179define fs1_magic_value FS_UFS1_MAGIC 180define fs2_magic_value FS_UFS2_MAGIC 181define fs_42postblfmt FS_42POSTBLFMT 182define fs_44inodefmt FS_44INODEFMT 183define ndaddr NDADDR 184define niaddr NIADDR 185define rootino ROOTINO 186define ifmt IFMT 187define ifdir IFDIR 188define iflnk IFLNK 189 190# 191# softraid 192# 193#ifdef SOFTRAID 194struct sr_meta_invariant 195member ssd_magic 196member ssd_version 197member ssd_vol_flags 198 199define sr_magic1 (SR_MAGIC >> 32) 200define sr_magic2 (SR_MAGIC & 0xffffffff) 201define sr_meta_offset SR_META_OFFSET 202define sr_meta_size SR_META_SIZE 203define sr_boot_offset SR_BOOT_LOADER_OFFSET 204define sr_boot_size SR_BOOT_LOADER_SIZE 205 206define bioc_scbootable BIOC_SCBOOTABLE 207#endif 208