xref: /titanic_44/usr/src/lib/libbc/inc/include/sun/dklabel.h (revision 4eaa471005973e11a6110b69fe990530b3b95a38)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 #pragma ident	"%Z%%M%	%I%	%E% SMI"
23 
24 /*
25  * Copyright (c) 1987 by Sun Microsystems, Inc.
26  */
27 
28 #ifndef _sun_dklabel_h
29 #define	_sun_dklabel_h
30 
31 /*
32  * Miscellaneous defines
33  */
34 #define	DKL_MAGIC	0xDABE	/* magic number */
35 #define	FKL_MAGIC	0xff	/* magic number for DOS floppies */
36 #define	NDKMAP	8		/* # of logical partitions */
37 
38 /*
39  * Format of a Sun SMD disk label.
40  * Resides in cylinder 0, head 0, sector 0.
41  *
42  * sizeof (struct dk_label) should be 512 (sector size)
43  */
44 struct dk_label {
45 	char	dkl_asciilabel[128];	/* for compatibility */
46 	char	dkl_pad[512-(128+NDKMAP*8+14*2)];
47 	unsigned short	dkl_rpm;	/* rotations per minute */
48 	unsigned short	dkl_pcyl;	/* # physical cylinders */
49 	unsigned short	dkl_apc;	/* alternates per cylinder */
50 	unsigned short	dkl_obs1;	/* obsolete */
51 	unsigned short	dkl_obs2;	/* obsolete */
52 	unsigned short	dkl_intrlv;	/* interleave factor */
53 	unsigned short	dkl_ncyl;	/* # of data cylinders */
54 	unsigned short	dkl_acyl;	/* # of alternate cylinders */
55 	unsigned short	dkl_nhead;	/* # of heads in this partition */
56 	unsigned short	dkl_nsect;	/* # of 512 byte sectors per track */
57 	unsigned short	dkl_obs3;	/* obsolete */
58 	unsigned short	dkl_obs4;	/* obsolete */
59 	/* */
60 	struct dk_map {			/* logical partitions */
61 		daddr_t	dkl_cylno;	/* starting cylinder */
62 		daddr_t dkl_nblk;	/* number of blocks */
63 	} dkl_map[NDKMAP];
64 	unsigned short	dkl_magic;	/* identifies this label format */
65 	unsigned short	dkl_cksum;	/* xor checksum of sector */
66 };
67 
68 /*
69  * These defines are for historic compatibility with old drivers.
70  */
71 #define	dkl_gap1	dkl_obs1	/* used to be gap1 */
72 #define	dkl_gap2	dkl_obs2	/* used to be gap2 */
73 #define	dkl_bhead	dkl_obs3	/* used to be label head offset */
74 #define	dkl_ppart	dkl_obs4	/* used to by physical partition */
75 
76 struct fk_label {			/* DOS floppy label */
77 	u_char fkl_type;
78 	u_char fkl_magich;
79 	u_char fkl_magicl;
80 	u_char filler;
81 };
82 
83 #endif /*!_sun_dklabel_h*/
84