xref: /titanic_44/usr/src/uts/common/sys/dktp/altsctr.h (revision 8956713aded83a741173fcd4f9ef1c83521fbea9)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2008 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 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 /*	alternate sector partition information table			*/
44 struct	alts_parttbl {
45 	uint32_t	alts_sanity;	/* to validate correctness	*/
46 	uint32_t  	alts_version;	/* version number		*/
47 	uint32_t	alts_map_base;	/* disk offset of alts_partmap	*/
48 	uint32_t	alts_map_len;	/* byte length of alts_partmap	*/
49 	uint32_t	alts_ent_base;	/* disk offset of alts_entry	*/
50 	uint32_t	alts_ent_used;	/* number of alternate entries used */
51 	uint32_t	alts_ent_end;	/* disk offset of top of alts_entry */
52 	uint32_t	alts_resv_base;	/* disk offset of alts_reserved	*/
53 	uint32_t 	alts_pad[5];	/* reserved fields		*/
54 };
55 
56 /*	alternate sector remap entry table				*/
57 struct	alts_ent {
58 	uint32_t	bad_start;	/* starting bad sector number	*/
59 	uint32_t	bad_end;	/* ending bad sector number	*/
60 	uint32_t	good_start;	/* starting alternate sector to use */
61 };
62 
63 /*	size of alternate partition table structure			*/
64 #define	ALTS_PARTTBL_SIZE	sizeof (struct alts_parttbl)
65 /*	size of alternate entry table structure				*/
66 #define	ALTS_ENT_SIZE	sizeof (struct alts_ent)
67 
68 /*	definition for alternate sector partition sector map		*/
69 #define	ALTS_GOOD	0	/* good alternate sectors		*/
70 #define	ALTS_BAD	1	/* bad alternate sectors		*/
71 
72 /*	definition for alternate sector partition id			*/
73 #define	ALTS_SANITY	0xaabbccdd /* magic number to validate alts_part */
74 #define	ALTS_VERSION1	0x01	/* version of alts_parttbl		*/
75 
76 #define	ALTS_ENT_EMPTY	-1	/* empty alternate entry		*/
77 #define	ALTS_MAP_UP	1	/* search forward with increasing sect# */
78 #define	ALTS_MAP_DOWN	-1	/* search backward with decreasing sect# */
79 
80 #ifdef	__cplusplus
81 }
82 #endif
83 
84 #endif	/* _SYS_DKTP_ALTSCTR_H */
85