disklabel.h revision 1.10
11.10Sbouyer/*	$NetBSD: disklabel.h,v 1.10 2011/08/30 12:39:57 bouyer Exp $	*/
21.1Sws
31.1Sws/*-
41.1Sws * Copyright (C) 1995, 1996 Wolfgang Solfrank.
51.1Sws * Copyright (C) 1995, 1996 TooLs GmbH.
61.1Sws * All rights reserved.
71.1Sws *
81.1Sws * Redistribution and use in source and binary forms, with or without
91.1Sws * modification, are permitted provided that the following conditions
101.1Sws * are met:
111.1Sws * 1. Redistributions of source code must retain the above copyright
121.1Sws *    notice, this list of conditions and the following disclaimer.
131.1Sws * 2. Redistributions in binary form must reproduce the above copyright
141.1Sws *    notice, this list of conditions and the following disclaimer in the
151.1Sws *    documentation and/or other materials provided with the distribution.
161.1Sws * 3. All advertising materials mentioning features or use of this software
171.1Sws *    must display the following acknowledgement:
181.1Sws *	This product includes software developed by TooLs GmbH.
191.1Sws * 4. The name of TooLs GmbH may not be used to endorse or promote products
201.1Sws *    derived from this software without specific prior written permission.
211.1Sws *
221.1Sws * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
231.1Sws * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1Sws * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1Sws * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
261.1Sws * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
271.1Sws * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
281.1Sws * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
291.1Sws * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
301.1Sws * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
311.1Sws * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321.1Sws */
331.9Sphx#ifndef _MACHINE_DISKLABEL_H_
341.9Sphx#define _MACHINE_DISKLABEL_H_
351.1Sws
361.10Sbouyer#define LABELUSESMBR	0			/* no MBR partitionning */
371.9Sphx#define	LABELSECTOR	0			/* sector containing label */
381.9Sphx#define	LABELOFFSET	64			/* offset of label in sector */
391.9Sphx#define MBR_LABELSECTOR 1			/* label sector in MBR */
401.9Sphx#define MBR_LABELOFFSET 0			/* label offset in MBR */
411.9Sphx#define	MAXPARTITIONS	16			/* number of partitions */
421.9Sphx#define	RAW_PART	2			/* raw partition: xx?c */
431.1Sws
441.7Sgarbled#if HAVE_NBTOOL_CONFIG_H
451.9Sphx#include <nbinclude/sys/bootblock.h>		/* MBR partition definitions */
461.9Sphx#include <nbinclude/sys/disklabel_rdb.h>	/* RDB partition definitions */
471.7Sgarbled#else
481.9Sphx#include <sys/bootblock.h>			/* MBR partition definitions */
491.9Sphx#include <sys/disklabel_rdb.h>			/* RDB partition definitions */
501.7Sgarbled#endif /* HAVE_NBTOOL_CONFIG_H */
511.7Sgarbled
521.1Swsstruct cpu_disklabel {
531.9Sphx	daddr_t cd_start;	/* Offset to NetBSD partition in blocks */
541.9Sphx	daddr_t cd_labelsector; /* label sector offset from cd_start */
551.9Sphx	int cd_labeloffset;     /* label byte offset within label sector */
561.9Sphx
571.9Sphx	u_long rdblock;			/* may be RDBNULL which invalidates */
581.9Sphx	u_long pblist[MAXPARTITIONS];	/* partblock number (RDB list order) */
591.9Sphx	int pbindex[MAXPARTITIONS];	/* index of pblock (partition order) */
601.9Sphx	int valid;			/* essential that this is valid */
611.1Sws};
621.1Sws
631.9Sphx#endif /* _MACHINE_DISKLABEL_H_ */
64