Home | History | Annotate | Line # | Download | only in include
disklabel.h revision 1.2
      1 /*	$NetBSD: disklabel.h,v 1.2 1996/04/26 19:40:54 chuck Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Dale Rahn.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *   This product includes software developed by Dale Rahn.
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 #ifndef _MACHINE_DISKLABEL_H_
     34 #define _MACHINE_DISKLABEL_H_
     35 
     36 /* number of boot pieces , ie xxboot bootxx */
     37 #define NUMBOOT		2
     38 
     39 #define	PARTITIONSHIFT	4
     40 
     41 #define LABELSECTOR     0                       /* sector containing label */
     42 #define LABELOFFSET	0			/* offset of label in sector */
     43 #define MAXPARTITIONS	(1 << PARTITIONSHIFT)	/* number of partitions */
     44 #define RAW_PART	2			/* raw partition: xx?c */
     45 
     46 /*
     47  * used to encode disk minor numbers
     48  * this should probably be moved to sys/disklabel.h
     49  */
     50 #define DISKUNIT(dev)	(minor(dev) / MAXPARTITIONS)
     51 #define DISKPART(dev)	(minor(dev) % MAXPARTITIONS)
     52 #define MAKEDISKDEV(maj, unit, part) \
     53     (makedev((maj), ((unit) * MAXPARTITIONS) + (part)))
     54 
     55 struct cpu_disklabel {
     56 	/* VID */
     57 	u_char		vid_id[4];
     58 	u_char		vid_0[16];
     59 	u_int		vid_oss;
     60 	u_short		vid_osl;
     61 	u_char		vid_1[4];
     62 	u_short		vid_osa_u;
     63 	u_short		vid_osa_l;
     64 	u_char		vid_2[2];
     65 	u_short		partitions;
     66 	u_char		vid_vd[16];
     67 	u_long		bbsize;
     68 	u_long		magic1;		/* 4 */
     69 	u_short		type;		/* 2 */
     70 	u_short		subtype;	/* 2 */
     71 	u_char		packname[16];	/* 16 */
     72 	u_long		flags;		/* 4 */
     73 	u_long		drivedata[5];	/* 4 */
     74 	u_long		spare[5];	/* 4 */
     75 	u_short		checksum;	/* 2 */
     76 
     77 	u_long		secpercyl;	/* 4 */
     78 	u_long		secperunit;	/* 4 */
     79 	u_long		headswitch;	/* 4 */
     80 
     81 	u_char		vid_3[4];
     82 	u_int		vid_cas;
     83 	u_char		vid_cal;
     84 	u_char		vid_4_0[3];
     85 	u_char		vid_4[64];
     86 	u_char		vid_4_1[28];
     87 	u_long		sbsize;
     88 	u_char		vid_mot[8];
     89 
     90 	/* CFG */
     91 	u_char		cfg_0[4];
     92 	u_short		cfg_atm;
     93 	u_short		cfg_prm;
     94 	u_short		cfg_atw;
     95 	u_short		cfg_rec;
     96 
     97 	u_short		sparespertrack;
     98 	u_short		sparespercyl;
     99 	u_long		acylinders;
    100 	u_short		rpm;
    101 	u_short		cylskew;
    102 
    103 	u_char		cfg_spt;
    104 	u_char		cfg_hds;
    105 	u_short		cfg_trk;
    106 	u_char		cfg_ilv;
    107 	u_char		cfg_sof;
    108 	u_short		cfg_psm;
    109 	u_short		cfg_shd;
    110 	u_char		cfg_2[2];
    111 	u_short		cfg_pcom;
    112 	u_char		cfg_3;
    113 	u_char		cfg_ssr;
    114 	u_short		cfg_rwcc;
    115 	u_short		cfg_ecc;
    116 	u_short		cfg_eatm;
    117 	u_short		cfg_eprm;
    118 	u_short		cfg_eatw;
    119 	u_char		cfg_gpb1;
    120 	u_char		cfg_gpb2;
    121 	u_char		cfg_gpb3;
    122 	u_char		cfg_gpb4;
    123 	u_char		cfg_ssc;
    124 	u_char		cfg_runit;
    125 	u_short		cfg_rsvc1;
    126 	u_short		cfg_rsvc2;
    127 	u_long		magic2;
    128 	u_char		cfg_4[192];
    129 };
    130 #endif _MACHINE_DISKLABEL_H_
    131