xref: /netbsd-src/sys/arch/amd64/include/disklabel.h (revision a47e2eb75818146a02ebb0a41df61c325b8d3935)
1*a47e2eb7Sbouyer /*	$NetBSD: disklabel.h,v 1.10 2011/08/30 12:39:52 bouyer Exp $	*/
281918bf8Sfvdl 
381918bf8Sfvdl /*
481918bf8Sfvdl  * Copyright (c) 1994 Christopher G. Demetriou
581918bf8Sfvdl  * All rights reserved.
681918bf8Sfvdl  *
781918bf8Sfvdl  * Redistribution and use in source and binary forms, with or without
881918bf8Sfvdl  * modification, are permitted provided that the following conditions
981918bf8Sfvdl  * are met:
1081918bf8Sfvdl  * 1. Redistributions of source code must retain the above copyright
1181918bf8Sfvdl  *    notice, this list of conditions and the following disclaimer.
1281918bf8Sfvdl  * 2. Redistributions in binary form must reproduce the above copyright
1381918bf8Sfvdl  *    notice, this list of conditions and the following disclaimer in the
1481918bf8Sfvdl  *    documentation and/or other materials provided with the distribution.
1581918bf8Sfvdl  * 3. All advertising materials mentioning features or use of this software
1681918bf8Sfvdl  *    must display the following acknowledgement:
1781918bf8Sfvdl  *      This product includes software developed by Christopher G. Demetriou.
1881918bf8Sfvdl  * 4. The name of the author may not be used to endorse or promote products
1981918bf8Sfvdl  *    derived from this software without specific prior written permission
2081918bf8Sfvdl  *
2181918bf8Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2281918bf8Sfvdl  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2381918bf8Sfvdl  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2481918bf8Sfvdl  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2581918bf8Sfvdl  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2681918bf8Sfvdl  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2781918bf8Sfvdl  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2881918bf8Sfvdl  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2981918bf8Sfvdl  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3081918bf8Sfvdl  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3181918bf8Sfvdl  */
3281918bf8Sfvdl 
33433b5ddeSmrg #ifndef _X86_64_DISKLABEL_H_
34433b5ddeSmrg #define _X86_64_DISKLABEL_H_
35433b5ddeSmrg 
3660383d27Smrg #if defined(__x86_64__) || defined(HAVE_NBTOOL_CONFIG_H)
3781918bf8Sfvdl 
38*a47e2eb7Sbouyer #define LABELUSESMBR		1	/* use MBR partitionning */
3981918bf8Sfvdl #define	LABELSECTOR		1	/* sector containing label */
4081918bf8Sfvdl #define	LABELOFFSET		0	/* offset of label in sector */
4181918bf8Sfvdl #define	MAXPARTITIONS		16	/* number of partitions */
4281918bf8Sfvdl #define	RAW_PART		3	/* raw partition: XX?d (XXX) */
4381918bf8Sfvdl 
4481918bf8Sfvdl /*
4581918bf8Sfvdl  * We use the highest bit of the minor number for the partition number.
4681918bf8Sfvdl  * This maintains backward compatibility with device nodes created before
4781918bf8Sfvdl  * MAXPARTITIONS was increased.
4881918bf8Sfvdl  */
4981918bf8Sfvdl /* Pull in MBR partition definitions. */
50a37289dbSdyoung #if HAVE_NBTOOL_CONFIG_H
51a37289dbSdyoung #include <nbinclude/sys/bootblock.h>
52a37289dbSdyoung #else
531c33b4e6Slukem #include <sys/bootblock.h>
54a37289dbSdyoung #endif /* HAVE_NBTOOL_CONFIG_H */
5581918bf8Sfvdl 
5681918bf8Sfvdl #ifndef __ASSEMBLER__
57a37289dbSdyoung #if HAVE_NBTOOL_CONFIG_H
58a37289dbSdyoung #include <nbinclude/sys/dkbad.h>
59a37289dbSdyoung #else
6081918bf8Sfvdl #include <sys/dkbad.h>
61a37289dbSdyoung #endif /* HAVE_NBTOOL_CONFIG_H */
6281918bf8Sfvdl struct cpu_disklabel {
6309dbb89bSpooka #define __HAVE_DISKLABEL_DKBAD
6481918bf8Sfvdl 	struct dkbad bad;
6581918bf8Sfvdl };
6681918bf8Sfvdl #endif
6781918bf8Sfvdl 
68433b5ddeSmrg #else	/*	__x86_64__	*/
69433b5ddeSmrg 
70433b5ddeSmrg #include <i386/disklabel.h>
71433b5ddeSmrg 
72433b5ddeSmrg #endif	/*	__x86_64__	*/
73433b5ddeSmrg 
74433b5ddeSmrg #endif /* _X86_64_DISKLABEL_H_ */
75