disklabel.h revision 1.9
11.9Sphx/* $NetBSD: disklabel.h,v 1.9 2010/12/31 21:50:28 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.9Sphx#define LABELSECTOR 0 /* sector containing label */ 371.9Sphx#define LABELOFFSET 64 /* offset of label in sector */ 381.9Sphx#define MBR_LABELSECTOR 1 /* label sector in MBR */ 391.9Sphx#define MBR_LABELOFFSET 0 /* label offset in MBR */ 401.9Sphx#define MAXPARTITIONS 16 /* number of partitions */ 411.9Sphx#define RAW_PART 2 /* raw partition: xx?c */ 421.1Sws 431.7Sgarbled#if HAVE_NBTOOL_CONFIG_H 441.9Sphx#include <nbinclude/sys/bootblock.h> /* MBR partition definitions */ 451.9Sphx#include <nbinclude/sys/disklabel_rdb.h> /* RDB partition definitions */ 461.7Sgarbled#else 471.9Sphx#include <sys/bootblock.h> /* MBR partition definitions */ 481.9Sphx#include <sys/disklabel_rdb.h> /* RDB partition definitions */ 491.7Sgarbled#endif /* HAVE_NBTOOL_CONFIG_H */ 501.7Sgarbled 511.1Swsstruct cpu_disklabel { 521.9Sphx daddr_t cd_start; /* Offset to NetBSD partition in blocks */ 531.9Sphx daddr_t cd_labelsector; /* label sector offset from cd_start */ 541.9Sphx int cd_labeloffset; /* label byte offset within label sector */ 551.9Sphx 561.9Sphx u_long rdblock; /* may be RDBNULL which invalidates */ 571.9Sphx u_long pblist[MAXPARTITIONS]; /* partblock number (RDB list order) */ 581.9Sphx int pbindex[MAXPARTITIONS]; /* index of pblock (partition order) */ 591.9Sphx int valid; /* essential that this is valid */ 601.1Sws}; 611.1Sws 621.9Sphx#endif /* _MACHINE_DISKLABEL_H_ */ 63