/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DKLABEL_H
#define _SYS_DKLABEL_H
#include <sys/isa_defs.h>
#include <sys/isa_defs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Miscellaneous defines
*/
#if defined(_SUNOS_VTOC_16)
#elif defined(_SUNOS_VTOC_8)
#else
#error "No VTOC format defined."
#endif
/*
* Reserve two cylinders on SCSI disks.
* One is for the backup disk label and the other is for the deviceid.
*
* IPI disks only reserve one cylinder, but they will go away soon.
* CDROMs do not reserve any cylinders.
*/
/*
* Format of a Sun disk label.
* Resides in cylinder 0, head 0, sector 0.
*
* sizeof (struct dk_label) should be 512 (the current sector size),
* but should the sector size increase, this structure should remain
* at the beginning of the sector.
*/
#if !defined(BLKADDR_TYPE)
#define BLKADDR_TYPE
#if defined(_EXTVTOC)
typedef unsigned long blkaddr_t;
typedef unsigned int blkaddr32_t;
#else
#endif
#endif
/*
* partition headers: section 1
* Returned in struct dk_allmap by ioctl DKIOC[SG]APART (dkio(7I))
*/
struct dk_map {
/* partition is undefined */
};
/*
* partition headers: section 1
* Fixed size for on-disk dk_label
*/
struct dk_map32 {
/* partition is undefined */
};
/*
* partition headers: section 2,
* brought over from AT&T SVr4 vtoc structure.
*/
struct dk_map2 {
};
struct dkl_partition {
};
/*
* VTOC inclusions from AT&T SVr4
* Fixed sized types for on-disk VTOC
*/
struct dk_vtoc {
#if defined(_SUNOS_VTOC_16)
#elif defined(_SUNOS_VTOC_8)
#else
#error "No VTOC format defined."
#endif
};
/*
* define the amount of disk label padding needed to make
* the entire structure occupy 512 bytes.
*/
#if defined(_SUNOS_VTOC_16)
((sizeof (struct dk_vtoc) + \
(4 * sizeof (uint32_t)) + \
(12 * sizeof (uint16_t)) + \
(2 * (sizeof (uint16_t))))))
#elif defined(_SUNOS_VTOC_8)
- ((LEN_DKL_ASCII) + \
(sizeof (struct dk_vtoc)) + \
(14 * (sizeof (uint16_t))) + \
(2 * (sizeof (uint16_t)))))
#else
#error "No VTOC format defined."
#endif
struct dk_label {
#if defined(_SUNOS_VTOC_16)
#elif defined(_SUNOS_VTOC_8)
#else
#error "No VTOC format defined."
#endif
};
#if defined(_SUNOS_VTOC_16)
#elif defined(_SUNOS_VTOC_8)
/*
* These defines are for historic compatibility with old drivers.
*/
#else
#error "No VTOC format defined."
#endif
};
/*
* Layout of stored fabricated device id (on-disk)
*/
#define DK_DEVID_REV_MSB (0)
struct dk_devid {
};
((dkd)->dkd_checksum0)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DKLABEL_H */