xref: /onnv-gate/usr/src/uts/common/sys/dktp/altsctr.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 1992 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
28*0Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
29*0Sstevel@tonic-gate /* All Rights Reserved */
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate /*
32*0Sstevel@tonic-gate  * (c) Copyright INTERACTIVE Systems Corporation 1986, 1988, 1990
33*0Sstevel@tonic-gate  * All rights reserved.
34*0Sstevel@tonic-gate  */
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate #ifndef _SYS_DKTP_ALTSCTR_H
37*0Sstevel@tonic-gate #define	_SYS_DKTP_ALTSCTR_H
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate #ifdef	__cplusplus
42*0Sstevel@tonic-gate extern "C" {
43*0Sstevel@tonic-gate #endif
44*0Sstevel@tonic-gate 
45*0Sstevel@tonic-gate /*	alternate sector partition information table			*/
46*0Sstevel@tonic-gate struct	alts_parttbl {
47*0Sstevel@tonic-gate 	long	alts_sanity;	/* to validate correctness		*/
48*0Sstevel@tonic-gate 	long  	alts_version;	/* version number			*/
49*0Sstevel@tonic-gate 	daddr_t	alts_map_base;	/* disk offset of alts_partmap		*/
50*0Sstevel@tonic-gate 	long	alts_map_len;	/* byte length of alts_partmap		*/
51*0Sstevel@tonic-gate 	daddr_t	alts_ent_base;	/* disk offset of alts_entry		*/
52*0Sstevel@tonic-gate 	long	alts_ent_used;	/* number of alternate entries used	*/
53*0Sstevel@tonic-gate 	long	alts_ent_end;	/* disk offset of top of alts_entry	*/
54*0Sstevel@tonic-gate 	daddr_t	alts_resv_base;	/* disk offset of alts_reserved		*/
55*0Sstevel@tonic-gate 	long 	alts_pad[5];	/* reserved fields			*/
56*0Sstevel@tonic-gate };
57*0Sstevel@tonic-gate 
58*0Sstevel@tonic-gate /*	alternate sector remap entry table				*/
59*0Sstevel@tonic-gate struct	alts_ent {
60*0Sstevel@tonic-gate 	daddr_t	bad_start;	/* starting bad sector number		*/
61*0Sstevel@tonic-gate 	daddr_t	bad_end;	/* ending bad sector number		*/
62*0Sstevel@tonic-gate 	daddr_t	good_start;	/* starting alternate sector to use	*/
63*0Sstevel@tonic-gate };
64*0Sstevel@tonic-gate 
65*0Sstevel@tonic-gate /*	size of alternate partition table structure			*/
66*0Sstevel@tonic-gate #define	ALTS_PARTTBL_SIZE	sizeof (struct alts_parttbl)
67*0Sstevel@tonic-gate /*	size of alternate entry table structure				*/
68*0Sstevel@tonic-gate #define	ALTS_ENT_SIZE	sizeof (struct alts_ent)
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate /*	definition for alternate sector partition sector map		*/
71*0Sstevel@tonic-gate #define	ALTS_GOOD	0	/* good alternate sectors		*/
72*0Sstevel@tonic-gate #define	ALTS_BAD	1	/* bad alternate sectors		*/
73*0Sstevel@tonic-gate 
74*0Sstevel@tonic-gate /*	definition for alternate sector partition id			*/
75*0Sstevel@tonic-gate #define	ALTS_SANITY	0xaabbccdd /* magic number to validate alts_part */
76*0Sstevel@tonic-gate #define	ALTS_VERSION1	0x01	/* version of alts_parttbl		*/
77*0Sstevel@tonic-gate 
78*0Sstevel@tonic-gate #define	ALTS_ENT_EMPTY	-1	/* empty alternate entry		*/
79*0Sstevel@tonic-gate #define	ALTS_MAP_UP	1	/* search forward with increasing sect# */
80*0Sstevel@tonic-gate #define	ALTS_MAP_DOWN	-1	/* search backward with decreasing sect# */
81*0Sstevel@tonic-gate 
82*0Sstevel@tonic-gate #ifdef	__cplusplus
83*0Sstevel@tonic-gate }
84*0Sstevel@tonic-gate #endif
85*0Sstevel@tonic-gate 
86*0Sstevel@tonic-gate #endif	/* _SYS_DKTP_ALTSCTR_H */
87