Home | History | Annotate | Line # | Download | only in bootblk
genfth.cf revision 1.4
      1 #	$NetBSD: genfth.cf,v 1.4 2004/06/18 18:42:15 martin Exp $
      2 
      3 #
      4 # Copyright (c) 1997 The NetBSD Foundation, Inc.
      5 # All rights reserved.
      6 #
      7 # This code is derived from software contributed to The NetBSD Foundation
      8 # by Christos Zoulas.
      9 #
     10 # Redistribution and use in source and binary forms, with or without
     11 # modification, are permitted provided that the following conditions
     12 # are met:
     13 # 1. Redistributions of source code must retain the above copyright
     14 #    notice, this list of conditions and the following disclaimer.
     15 # 2. Redistributions in binary form must reproduce the above copyright
     16 #    notice, this list of conditions and the following disclaimer in the
     17 #    documentation and/or other materials provided with the distribution.
     18 # 3. All advertising materials mentioning features or use of this software
     19 #    must display the following acknowledgement:
     20 #        This product includes software developed by the NetBSD
     21 #        Foundation, Inc. and its contributors.
     22 # 4. Neither the name of The NetBSD Foundation nor the names of its
     23 #    contributors may be used to endorse or promote products derived
     24 #    from this software without specific prior written permission.
     25 #
     26 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29 # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36 # POSSIBILITY OF SUCH DAMAGE.
     37 #
     38 # Copyright (c) 1992, 1993
     39 #	The Regents of the University of California.  All rights reserved.
     40 #
     41 # This software was developed by the Computer Systems Engineering group
     42 # at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
     43 # contributed to Berkeley.
     44 #
     45 # All advertising materials mentioning features or use of this software
     46 # must display the following acknowledgement:
     47 #	This product includes software developed by the University of
     48 #	California, Lawrence Berkeley Laboratory.
     49 #
     50 # Redistribution and use in source and binary forms, with or without
     51 # modification, are permitted provided that the following conditions
     52 # are met:
     53 # 1. Redistributions of source code must retain the above copyright
     54 #    notice, this list of conditions and the following disclaimer.
     55 # 2. Redistributions in binary form must reproduce the above copyright
     56 #    notice, this list of conditions and the following disclaimer in the
     57 #    documentation and/or other materials provided with the distribution.
     58 # 3. All advertising materials mentioning features or use of this software
     59 #    must display the following acknowledgement:
     60 #	This product includes software developed by the University of
     61 #	California, Berkeley and its contributors.
     62 # 4. Neither the name of the University nor the names of its contributors
     63 #    may be used to endorse or promote products derived from this software
     64 #    without specific prior written permission.
     65 #
     66 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     67 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     68 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     69 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     70 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     71 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     72 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     73 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     74 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     75 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     76 # SUCH DAMAGE.
     77 #
     78 #	@(#)genassym.c	8.1 (Berkeley) 6/11/93
     79 #
     80 
     81 include <sys/param.h>
     82 include <sys/time.h>
     83 include <ufs/ufs/dinode.h>
     84 include <ufs/ufs/dir.h>
     85 include <ufs/ffs/fs.h>
     86 include <dev/raidframe/raidframevar.h>
     87 
     88 #
     89 # ufs sizing constants
     90 #
     91 define	dev_bsize	DEV_BSIZE
     92 define	maxbsize	MAXBSIZE
     93 define	bbsize		BBSIZE
     94 define	sbsize		SBLOCKSIZE
     95 define	bboff		BBOFF
     96 define	sboff		SBLOCK_UFS1
     97 define	bblock		BBLOCK
     98 # XXX: Will not work for UFS2!
     99 define	sblock		SBLOCK_UFS1
    100 
    101 # RAID1 boot support
    102 define	rf_protected	RF_PROTECTED_SECTORS
    103 
    104 #
    105 # ufs superblock
    106 #
    107 struct	fs
    108 member	fs_magic
    109 member	fs_bsize
    110 member	fs_old_npsect
    111 member	fs_old_nsect
    112 member	fs_old_interleave
    113 member	fs_old_postblformat
    114 member	fs_old_nrpos
    115 member	fs_old_inodefmt
    116 member	fs_maxfilesize
    117 member	fs_qbmask
    118 member	fs_qfmask
    119 member	fs_bmask
    120 member	fs_fmask
    121 member	fs_ipg
    122 member	fs_fpg
    123 member	fs_inopb
    124 member	fs_fragshift
    125 member	fs_bshift
    126 member	fs_fshift
    127 member	fs_old_cgoffset
    128 member	fs_old_cgmask
    129 member	fs_dblkno
    130 member	fs_iblkno
    131 member	fs_sblkno
    132 member	fs_cblkno
    133 member  fs_fsbtodb
    134 member	fs_nindir
    135 member	fs_frag
    136 member	fs_maxsymlinklen
    137 
    138 #
    139 # ufs1 dinode
    140 #
    141 struct	ufs1_dinode
    142 member	di_size
    143 member	di_mode
    144 member	di_db
    145 member	di_ib
    146 
    147 #
    148 # ufs direct
    149 #
    150 struct	direct
    151 member	d_ino
    152 member	d_reclen
    153 #member	d_type		# notused
    154 member	d_namlen
    155 member	d_name
    156 
    157 define	fs_magic_value	FS_UFS1_MAGIC
    158 define	fs_42postblfmt	FS_42POSTBLFMT
    159 define	fs_44inodefmt	FS_44INODEFMT
    160 define	ndaddr		NDADDR
    161 define	niaddr		NIADDR
    162 define	rootino		ROOTINO
    163 define	ifmt		IFMT
    164 define	ifdir		IFDIR
    165 define	iflnk		IFLNK
    166