xref: /illumos-gate/usr/src/uts/common/sys/dkbad.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
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 /*
23  * Copyright (c) 1991,1997-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SYS_DKBAD_H
28 #define	_SYS_DKBAD_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * Definitions needed to perform bad sector
36  * revectoring ala DEC STD 144.
37  *
38  * The bad sector information is located in the
39  * first 5 even numbered sectors of the last
40  * track of the disk pack.  There are five
41  * identical copies of the information, described
42  * by the dkbad structure.
43  *
44  * Replacement sectors are allocated starting with
45  * the first sector before the bad sector information
46  * and working backwards towards the beginning of
47  * the disk.  A maximum of 126 bad sectors are supported.
48  * The position of the bad sector in the bad sector table
49  * determines which replacement sector it corresponds to.
50  *
51  * The bad sector information and replacement sectors
52  * are conventionally only accessible through the
53  * 'c' file system partition of the disk.  If that
54  * partition is used for a file system, the user is
55  * responsible for making sure that it does not overlap
56  * the bad sector information or any replacement sector.s
57  */
58 
59 #define	NDKBAD		126		/* # of entries maximum */
60 
61 struct dkbad {
62 	long	bt_csn;			/* cartridge serial number */
63 	ushort_t bt_mbz;		/* unused; should be 0 */
64 	ushort_t bt_flag;		/* -1 => alignment cartridge */
65 	struct bt_bad {
66 		short	bt_cyl;		/* cylinder number of bad sector */
67 		short	bt_trksec;	/* track and sector number */
68 	} bt_bad[NDKBAD];
69 };
70 
71 #ifdef	__cplusplus
72 }
73 #endif
74 
75 #endif	/* _SYS_DKBAD_H */
76