17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*342440ecSPrasad Singamsetty * Common Development and Distribution License (the "License"). 6*342440ecSPrasad Singamsetty * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21*342440ecSPrasad Singamsetty 227c478bd9Sstevel@tonic-gate /* 23*342440ecSPrasad Singamsetty * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ 287c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */ 297c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate /* 327c478bd9Sstevel@tonic-gate * (c) Copyright INTERACTIVE Systems Corporation 1986, 1988, 1990 337c478bd9Sstevel@tonic-gate * All rights reserved. 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifndef _SYS_DKTP_ALTSCTR_H 377c478bd9Sstevel@tonic-gate #define _SYS_DKTP_ALTSCTR_H 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate #ifdef __cplusplus 407c478bd9Sstevel@tonic-gate extern "C" { 417c478bd9Sstevel@tonic-gate #endif 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate /* alternate sector partition information table */ 447c478bd9Sstevel@tonic-gate struct alts_parttbl { 453ccda647Slclee uint32_t alts_sanity; /* to validate correctness */ 463ccda647Slclee uint32_t alts_version; /* version number */ 47*342440ecSPrasad Singamsetty uint32_t alts_map_base; /* disk offset of alts_partmap */ 483ccda647Slclee uint32_t alts_map_len; /* byte length of alts_partmap */ 49*342440ecSPrasad Singamsetty uint32_t alts_ent_base; /* disk offset of alts_entry */ 503ccda647Slclee uint32_t alts_ent_used; /* number of alternate entries used */ 51*342440ecSPrasad Singamsetty uint32_t alts_ent_end; /* disk offset of top of alts_entry */ 52*342440ecSPrasad Singamsetty uint32_t alts_resv_base; /* disk offset of alts_reserved */ 533ccda647Slclee uint32_t alts_pad[5]; /* reserved fields */ 547c478bd9Sstevel@tonic-gate }; 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate /* alternate sector remap entry table */ 577c478bd9Sstevel@tonic-gate struct alts_ent { 58*342440ecSPrasad Singamsetty uint32_t bad_start; /* starting bad sector number */ 59*342440ecSPrasad Singamsetty uint32_t bad_end; /* ending bad sector number */ 60*342440ecSPrasad Singamsetty uint32_t good_start; /* starting alternate sector to use */ 617c478bd9Sstevel@tonic-gate }; 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* size of alternate partition table structure */ 647c478bd9Sstevel@tonic-gate #define ALTS_PARTTBL_SIZE sizeof (struct alts_parttbl) 657c478bd9Sstevel@tonic-gate /* size of alternate entry table structure */ 667c478bd9Sstevel@tonic-gate #define ALTS_ENT_SIZE sizeof (struct alts_ent) 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate /* definition for alternate sector partition sector map */ 697c478bd9Sstevel@tonic-gate #define ALTS_GOOD 0 /* good alternate sectors */ 707c478bd9Sstevel@tonic-gate #define ALTS_BAD 1 /* bad alternate sectors */ 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate /* definition for alternate sector partition id */ 737c478bd9Sstevel@tonic-gate #define ALTS_SANITY 0xaabbccdd /* magic number to validate alts_part */ 747c478bd9Sstevel@tonic-gate #define ALTS_VERSION1 0x01 /* version of alts_parttbl */ 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #define ALTS_ENT_EMPTY -1 /* empty alternate entry */ 777c478bd9Sstevel@tonic-gate #define ALTS_MAP_UP 1 /* search forward with increasing sect# */ 787c478bd9Sstevel@tonic-gate #define ALTS_MAP_DOWN -1 /* search backward with decreasing sect# */ 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate #ifdef __cplusplus 817c478bd9Sstevel@tonic-gate } 827c478bd9Sstevel@tonic-gate #endif 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate #endif /* _SYS_DKTP_ALTSCTR_H */ 85