disklabel.h revision 1.2
11.2Smatt/* $NetBSD: disklabel.h,v 1.2 2013/05/02 03:56:40 matt Exp $ */ 21.1Skiyohara 31.1Skiyohara/* 41.1Skiyohara * Copyright (c) 1994 Christopher G. Demetriou 51.1Skiyohara * All rights reserved. 61.1Skiyohara * 71.1Skiyohara * Redistribution and use in source and binary forms, with or without 81.1Skiyohara * modification, are permitted provided that the following conditions 91.1Skiyohara * are met: 101.1Skiyohara * 1. Redistributions of source code must retain the above copyright 111.1Skiyohara * notice, this list of conditions and the following disclaimer. 121.1Skiyohara * 2. Redistributions in binary form must reproduce the above copyright 131.1Skiyohara * notice, this list of conditions and the following disclaimer in the 141.1Skiyohara * documentation and/or other materials provided with the distribution. 151.1Skiyohara * 3. All advertising materials mentioning features or use of this software 161.1Skiyohara * must display the following acknowledgement: 171.1Skiyohara * This product includes software developed by Christopher G. Demetriou. 181.1Skiyohara * 4. The name of the author may not be used to endorse or promote products 191.1Skiyohara * derived from this software without specific prior written permission 201.1Skiyohara * 211.1Skiyohara * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 221.1Skiyohara * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 231.1Skiyohara * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 241.1Skiyohara * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 251.1Skiyohara * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 261.1Skiyohara * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 271.1Skiyohara * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 281.1Skiyohara * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 291.1Skiyohara * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 301.1Skiyohara * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 311.1Skiyohara */ 321.1Skiyohara 331.2Smatt#ifndef _EPOC32_DISKLABEL_H_ 341.2Smatt#define _EPOC32_DISKLABEL_H_ 351.1Skiyohara 361.2Smatt#define LABELUSESMBR 1 /* use MBR partitionning */ 371.2Smatt#define LABELSECTOR 1 /* sector containing label */ 381.2Smatt#define LABELOFFSET 0 /* offset of label in sector */ 391.2Smatt#define MAXPARTITIONS 16 /* number of partitions */ 401.2Smatt#define OLDMAXPARTITIONS 8 /* number of partitions before 1.6 */ 411.2Smatt#define RAW_PART 3 /* raw partition: XX?d (XXX) */ 421.2Smatt 431.2Smatt/* 441.2Smatt * We use the highest bit of the minor number for the partition number. 451.2Smatt * This maintains backward compatibility with device nodes created before 461.2Smatt * MAXPARTITIONS was increased. 471.2Smatt */ 481.2Smatt#define __EPOC32_MAXDISKS ((1 << 20) / MAXPARTITIONS) 491.2Smatt#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __EPOC32_MAXDISKS) 501.2Smatt#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \ 511.2Smatt ((minor(dev) / (__EPOC32_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS)) 521.2Smatt#define DISKMINOR(unit, part) \ 531.2Smatt (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \ 541.2Smatt ((part) / OLDMAXPARTITIONS) * (__EPOC32_MAXDISKS * OLDMAXPARTITIONS)) 551.1Skiyohara 561.1Skiyohara/* Pull in MBR partition definitions. */ 571.1Skiyohara#if HAVE_NBTOOL_CONFIG_H 581.1Skiyohara#include <nbinclude/sys/bootblock.h> 591.1Skiyohara#else 601.1Skiyohara#include <sys/bootblock.h> 611.1Skiyohara#endif /* HAVE_NBTOOL_CONFIG_H */ 621.1Skiyohara 631.1Skiyohara#ifndef __ASSEMBLER__ 641.1Skiyohara#if HAVE_NBTOOL_CONFIG_H 651.1Skiyohara#include <nbinclude/sys/dkbad.h> 661.1Skiyohara#else 671.1Skiyohara#include <sys/dkbad.h> 681.1Skiyohara#endif /* HAVE_NBTOOL_CONFIG_H */ 691.1Skiyoharastruct cpu_disklabel { 701.1Skiyohara struct mbr_partition dosparts[MBR_PART_COUNT]; 711.1Skiyohara#define __HAVE_DISKLABEL_DKBAD 721.1Skiyohara struct dkbad bad; 731.1Skiyohara}; 741.2Smatt#endif 751.1Skiyohara 761.2Smatt#endif /* _EPOC32_DISKLABEL_H_ */ 77