dklabel.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 1990-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DKLABEL_H
#define _SYS_DKLABEL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#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)
#define DK_LABEL_LOC 0 /* location of disk label */
#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.
*/
#define DK_ACYL 2
/*
* 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.
*/
/*
* 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)
#define LEN_DKL_PAD (DK_LABEL_SIZE - \
((sizeof (struct dk_vtoc) + \
(4 * sizeof (uint32_t)) + \
(12 * sizeof (uint16_t)) + \
(2 * (sizeof (uint16_t))))))
#elif defined(_SUNOS_VTOC_8)
#define LEN_DKL_PAD (DK_LABEL_SIZE \
- ((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)
#define v_timestamp timestamp
#elif defined(_SUNOS_VTOC_8)
/*
* These defines are for historic compatibility with old drivers.
*/
#else
#error "No VTOC format defined."
#endif
struct fk_label { /* DOS floppy label */
};
/*
* Layout of stored fabricated device id (on-disk)
*/
#define DK_DEVID_BLKSIZE (512)
#define DK_DEVID_REV_MSB (0)
#define DK_DEVID_REV_LSB (1)
struct dk_devid {
};
((dkd)->dkd_checksum0)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DKLABEL_H */