11.11Sphx/*	$NetBSD: disklabel.h,v 1.11 2012/02/02 21:54:34 phx 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.11Sphx#define	LABELSECTOR	1			/* sector containing label */
381.11Sphx#define	LABELOFFSET	0			/* offset of label in sector */
391.9Sphx#define	MAXPARTITIONS	16			/* number of partitions */
401.9Sphx#define	RAW_PART	2			/* raw partition: xx?c */
411.1Sws
421.7Sgarbled#if HAVE_NBTOOL_CONFIG_H
431.9Sphx#include <nbinclude/sys/bootblock.h>		/* MBR partition definitions */
441.9Sphx#include <nbinclude/sys/disklabel_rdb.h>	/* RDB partition definitions */
451.7Sgarbled#else
461.9Sphx#include <sys/bootblock.h>			/* MBR partition definitions */
471.9Sphx#include <sys/disklabel_rdb.h>			/* RDB partition definitions */
481.7Sgarbled#endif /* HAVE_NBTOOL_CONFIG_H */
491.7Sgarbled
501.1Swsstruct cpu_disklabel {
511.9Sphx	daddr_t cd_start;	/* Offset to NetBSD partition in blocks */
521.9Sphx	daddr_t cd_labelsector; /* label sector offset from cd_start */
531.9Sphx	int cd_labeloffset;     /* label byte offset within label sector */
541.9Sphx
551.9Sphx	u_long rdblock;			/* may be RDBNULL which invalidates */
561.9Sphx	u_long pblist[MAXPARTITIONS];	/* partblock number (RDB list order) */
571.9Sphx	int pbindex[MAXPARTITIONS];	/* index of pblock (partition order) */
581.9Sphx	int valid;			/* essential that this is valid */
591.1Sws};
601.1Sws
611.9Sphx#endif /* _MACHINE_DISKLABEL_H_ */
62