xref: /titanic_44/usr/src/uts/common/sys/dktp/altsctr.h (revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
29 /* All Rights Reserved */
30 
31 /*
32  * (c) Copyright INTERACTIVE Systems Corporation 1986, 1988, 1990
33  * All rights reserved.
34  */
35 
36 #ifndef _SYS_DKTP_ALTSCTR_H
37 #define	_SYS_DKTP_ALTSCTR_H
38 
39 #pragma ident	"%Z%%M%	%I%	%E% SMI"
40 
41 #ifdef	__cplusplus
42 extern "C" {
43 #endif
44 
45 /*	alternate sector partition information table			*/
46 struct	alts_parttbl {
47 	uint32_t	alts_sanity;	/* to validate correctness	*/
48 	uint32_t  	alts_version;	/* version number		*/
49 	daddr32_t	alts_map_base;	/* disk offset of alts_partmap	*/
50 	uint32_t	alts_map_len;	/* byte length of alts_partmap	*/
51 	daddr32_t	alts_ent_base;	/* disk offset of alts_entry	*/
52 	uint32_t	alts_ent_used;	/* number of alternate entries used */
53 	daddr32_t	alts_ent_end;	/* disk offset of top of alts_entry */
54 	daddr32_t	alts_resv_base;	/* disk offset of alts_reserved	*/
55 	uint32_t 	alts_pad[5];	/* reserved fields		*/
56 };
57 
58 /*	alternate sector remap entry table				*/
59 struct	alts_ent {
60 	daddr32_t	bad_start;	/* starting bad sector number	*/
61 	daddr32_t	bad_end;	/* ending bad sector number	*/
62 	daddr32_t	good_start;	/* starting alternate sector to use */
63 };
64 
65 /*	size of alternate partition table structure			*/
66 #define	ALTS_PARTTBL_SIZE	sizeof (struct alts_parttbl)
67 /*	size of alternate entry table structure				*/
68 #define	ALTS_ENT_SIZE	sizeof (struct alts_ent)
69 
70 /*	definition for alternate sector partition sector map		*/
71 #define	ALTS_GOOD	0	/* good alternate sectors		*/
72 #define	ALTS_BAD	1	/* bad alternate sectors		*/
73 
74 /*	definition for alternate sector partition id			*/
75 #define	ALTS_SANITY	0xaabbccdd /* magic number to validate alts_part */
76 #define	ALTS_VERSION1	0x01	/* version of alts_parttbl		*/
77 
78 #define	ALTS_ENT_EMPTY	-1	/* empty alternate entry		*/
79 #define	ALTS_MAP_UP	1	/* search forward with increasing sect# */
80 #define	ALTS_MAP_DOWN	-1	/* search backward with decreasing sect# */
81 
82 #ifdef	__cplusplus
83 }
84 #endif
85 
86 #endif	/* _SYS_DKTP_ALTSCTR_H */
87