1*2ec4fd84Schristos /* $NetBSD: disklabel.h,v 1.8 2013/05/16 19:06:44 christos Exp $ */ 25448df2eSscw 35448df2eSscw /* 45448df2eSscw * Copyright (c) 1994 Christopher G. Demetriou 55448df2eSscw * All rights reserved. 65448df2eSscw * 75448df2eSscw * Redistribution and use in source and binary forms, with or without 85448df2eSscw * modification, are permitted provided that the following conditions 95448df2eSscw * are met: 105448df2eSscw * 1. Redistributions of source code must retain the above copyright 115448df2eSscw * notice, this list of conditions and the following disclaimer. 125448df2eSscw * 2. Redistributions in binary form must reproduce the above copyright 135448df2eSscw * notice, this list of conditions and the following disclaimer in the 145448df2eSscw * documentation and/or other materials provided with the distribution. 155448df2eSscw * 3. All advertising materials mentioning features or use of this software 165448df2eSscw * must display the following acknowledgement: 175448df2eSscw * This product includes software developed by Christopher G. Demetriou. 185448df2eSscw * 4. The name of the author may not be used to endorse or promote products 195448df2eSscw * derived from this software without specific prior written permission 205448df2eSscw * 215448df2eSscw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 225448df2eSscw * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 235448df2eSscw * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 245448df2eSscw * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 255448df2eSscw * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 265448df2eSscw * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 275448df2eSscw * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 285448df2eSscw * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 295448df2eSscw * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 305448df2eSscw * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 315448df2eSscw */ 325448df2eSscw 335448df2eSscw #ifndef _MACHINE_DISKLABEL_H_ 345448df2eSscw #define _MACHINE_DISKLABEL_H_ 355448df2eSscw 365448df2eSscw #define MAXPARTITIONS 16 /* number of partitions */ 375448df2eSscw #define RAW_PART 2 /* raw partition: XX?c */ 385448df2eSscw 39c16a38a4Sscw #ifdef EVBPPC_HAS_MBR 40a47e2eb7Sbouyer #define LABELUSESMBR 1 /* use MBR partitionning */ 41c16a38a4Sscw #define LABELSECTOR 1 /* sector containing label */ 42c16a38a4Sscw #define LABELOFFSET 0 /* offset of label in sector */ 43c16a38a4Sscw /* Pull in MBR partition definitions. */ 44a37289dbSdyoung #if HAVE_NBTOOL_CONFIG_H 45a37289dbSdyoung #include <nbinclude/sys/bootblock.h> 46a37289dbSdyoung #else 47c16a38a4Sscw #include <sys/bootblock.h> 48a37289dbSdyoung #endif /* HAVE_NBTOOL_CONFIG_H */ 49c16a38a4Sscw #else 50a47e2eb7Sbouyer #define LABELUSESMBR 0 /* no MBR partitionning */ 51c16a38a4Sscw #define LABELSECTOR 0 /* sector containing label */ 52c16a38a4Sscw #define LABELOFFSET 64 /* offset of label in sector */ 53c16a38a4Sscw #endif /* EVBPPC_HAS_MBR */ 54c16a38a4Sscw 55a37289dbSdyoung #if HAVE_NBTOOL_CONFIG_H 56a37289dbSdyoung #include <nbinclude/sys/dkbad.h> 57a37289dbSdyoung #else 585448df2eSscw #include <sys/dkbad.h> 59a37289dbSdyoung #endif /* HAVE_NBTOOL_CONFIG_H */ 605448df2eSscw 615448df2eSscw struct cpu_disklabel { 62c16a38a4Sscw #ifdef EVBPPC_HAS_MBR 63*2ec4fd84Schristos struct mbr_partition mbrparts[MBR_PART_COUNT]; 64c16a38a4Sscw #endif 6509dbb89bSpooka #define __HAVE_DISKLABEL_DKBAD 665448df2eSscw struct dkbad bad; /* bad-sector information */ 675448df2eSscw }; 685448df2eSscw 695448df2eSscw #endif /* _MACHINE_DISKLABEL_H_ */ 70