xref: /onnv-gate/usr/src/uts/common/sys/dktp/altsctr.h (revision 786:5c0d97122ae6)
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
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*786Slclee  * Copyright 2005 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
400Sstevel@tonic-gate 
410Sstevel@tonic-gate #ifdef	__cplusplus
420Sstevel@tonic-gate extern "C" {
430Sstevel@tonic-gate #endif
440Sstevel@tonic-gate 
450Sstevel@tonic-gate /*	alternate sector partition information table			*/
460Sstevel@tonic-gate struct	alts_parttbl {
47*786Slclee 	uint32_t	alts_sanity;	/* to validate correctness	*/
48*786Slclee 	uint32_t  	alts_version;	/* version number		*/
49*786Slclee 	daddr32_t	alts_map_base;	/* disk offset of alts_partmap	*/
50*786Slclee 	uint32_t	alts_map_len;	/* byte length of alts_partmap	*/
51*786Slclee 	daddr32_t	alts_ent_base;	/* disk offset of alts_entry	*/
52*786Slclee 	uint32_t	alts_ent_used;	/* number of alternate entries used */
53*786Slclee 	daddr32_t	alts_ent_end;	/* disk offset of top of alts_entry */
54*786Slclee 	daddr32_t	alts_resv_base;	/* disk offset of alts_reserved	*/
55*786Slclee 	uint32_t 	alts_pad[5];	/* reserved fields		*/
560Sstevel@tonic-gate };
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /*	alternate sector remap entry table				*/
590Sstevel@tonic-gate struct	alts_ent {
60*786Slclee 	daddr32_t	bad_start;	/* starting bad sector number	*/
61*786Slclee 	daddr32_t	bad_end;	/* ending bad sector number	*/
62*786Slclee 	daddr32_t	good_start;	/* starting alternate sector to use */
630Sstevel@tonic-gate };
640Sstevel@tonic-gate 
650Sstevel@tonic-gate /*	size of alternate partition table structure			*/
660Sstevel@tonic-gate #define	ALTS_PARTTBL_SIZE	sizeof (struct alts_parttbl)
670Sstevel@tonic-gate /*	size of alternate entry table structure				*/
680Sstevel@tonic-gate #define	ALTS_ENT_SIZE	sizeof (struct alts_ent)
690Sstevel@tonic-gate 
700Sstevel@tonic-gate /*	definition for alternate sector partition sector map		*/
710Sstevel@tonic-gate #define	ALTS_GOOD	0	/* good alternate sectors		*/
720Sstevel@tonic-gate #define	ALTS_BAD	1	/* bad alternate sectors		*/
730Sstevel@tonic-gate 
740Sstevel@tonic-gate /*	definition for alternate sector partition id			*/
750Sstevel@tonic-gate #define	ALTS_SANITY	0xaabbccdd /* magic number to validate alts_part */
760Sstevel@tonic-gate #define	ALTS_VERSION1	0x01	/* version of alts_parttbl		*/
770Sstevel@tonic-gate 
780Sstevel@tonic-gate #define	ALTS_ENT_EMPTY	-1	/* empty alternate entry		*/
790Sstevel@tonic-gate #define	ALTS_MAP_UP	1	/* search forward with increasing sect# */
800Sstevel@tonic-gate #define	ALTS_MAP_DOWN	-1	/* search backward with decreasing sect# */
810Sstevel@tonic-gate 
820Sstevel@tonic-gate #ifdef	__cplusplus
830Sstevel@tonic-gate }
840Sstevel@tonic-gate #endif
850Sstevel@tonic-gate 
860Sstevel@tonic-gate #endif	/* _SYS_DKTP_ALTSCTR_H */
87