xref: /onnv-gate/usr/src/uts/common/sys/dktp/altsctr.h (revision 7563:84ec90ffc3f7)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7563SPrasad.Singamsetty@Sun.COM  * Common Development and Distribution License (the "License").
6*7563SPrasad.Singamsetty@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*7563SPrasad.Singamsetty@Sun.COM 
220Sstevel@tonic-gate /*
23*7563SPrasad.Singamsetty@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
280Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
290Sstevel@tonic-gate /* All Rights Reserved */
300Sstevel@tonic-gate 
310Sstevel@tonic-gate /*
320Sstevel@tonic-gate  * (c) Copyright INTERACTIVE Systems Corporation 1986, 1988, 1990
330Sstevel@tonic-gate  * All rights reserved.
340Sstevel@tonic-gate  */
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #ifndef _SYS_DKTP_ALTSCTR_H
370Sstevel@tonic-gate #define	_SYS_DKTP_ALTSCTR_H
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifdef	__cplusplus
400Sstevel@tonic-gate extern "C" {
410Sstevel@tonic-gate #endif
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*	alternate sector partition information table			*/
440Sstevel@tonic-gate struct	alts_parttbl {
45786Slclee 	uint32_t	alts_sanity;	/* to validate correctness	*/
46786Slclee 	uint32_t  	alts_version;	/* version number		*/
47*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	alts_map_base;	/* disk offset of alts_partmap	*/
48786Slclee 	uint32_t	alts_map_len;	/* byte length of alts_partmap	*/
49*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	alts_ent_base;	/* disk offset of alts_entry	*/
50786Slclee 	uint32_t	alts_ent_used;	/* number of alternate entries used */
51*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	alts_ent_end;	/* disk offset of top of alts_entry */
52*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	alts_resv_base;	/* disk offset of alts_reserved	*/
53786Slclee 	uint32_t 	alts_pad[5];	/* reserved fields		*/
540Sstevel@tonic-gate };
550Sstevel@tonic-gate 
560Sstevel@tonic-gate /*	alternate sector remap entry table				*/
570Sstevel@tonic-gate struct	alts_ent {
58*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	bad_start;	/* starting bad sector number	*/
59*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	bad_end;	/* ending bad sector number	*/
60*7563SPrasad.Singamsetty@Sun.COM 	uint32_t	good_start;	/* starting alternate sector to use */
610Sstevel@tonic-gate };
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*	size of alternate partition table structure			*/
640Sstevel@tonic-gate #define	ALTS_PARTTBL_SIZE	sizeof (struct alts_parttbl)
650Sstevel@tonic-gate /*	size of alternate entry table structure				*/
660Sstevel@tonic-gate #define	ALTS_ENT_SIZE	sizeof (struct alts_ent)
670Sstevel@tonic-gate 
680Sstevel@tonic-gate /*	definition for alternate sector partition sector map		*/
690Sstevel@tonic-gate #define	ALTS_GOOD	0	/* good alternate sectors		*/
700Sstevel@tonic-gate #define	ALTS_BAD	1	/* bad alternate sectors		*/
710Sstevel@tonic-gate 
720Sstevel@tonic-gate /*	definition for alternate sector partition id			*/
730Sstevel@tonic-gate #define	ALTS_SANITY	0xaabbccdd /* magic number to validate alts_part */
740Sstevel@tonic-gate #define	ALTS_VERSION1	0x01	/* version of alts_parttbl		*/
750Sstevel@tonic-gate 
760Sstevel@tonic-gate #define	ALTS_ENT_EMPTY	-1	/* empty alternate entry		*/
770Sstevel@tonic-gate #define	ALTS_MAP_UP	1	/* search forward with increasing sect# */
780Sstevel@tonic-gate #define	ALTS_MAP_DOWN	-1	/* search backward with decreasing sect# */
790Sstevel@tonic-gate 
800Sstevel@tonic-gate #ifdef	__cplusplus
810Sstevel@tonic-gate }
820Sstevel@tonic-gate #endif
830Sstevel@tonic-gate 
840Sstevel@tonic-gate #endif	/* _SYS_DKTP_ALTSCTR_H */
85