disklabel.h revision 1.8
11.8Sdsl/*	$NetBSD: disklabel.h,v 1.8 2009/03/14 14:45:55 dsl Exp $	*/
21.1Sbjh21
31.1Sbjh21/*
41.1Sbjh21 * Copyright (c) 1994 Mark Brinicombe.
51.1Sbjh21 * Copyright (c) 1994 Brini.
61.1Sbjh21 * All rights reserved.
71.1Sbjh21 *
81.1Sbjh21 * This code is derived from software written for Brini by Mark Brinicombe
91.1Sbjh21 *
101.1Sbjh21 * Redistribution and use in source and binary forms, with or without
111.1Sbjh21 * modification, are permitted provided that the following conditions
121.1Sbjh21 * are met:
131.1Sbjh21 * 1. Redistributions of source code must retain the above copyright
141.1Sbjh21 *    notice, this list of conditions and the following disclaimer.
151.1Sbjh21 * 2. Redistributions in binary form must reproduce the above copyright
161.1Sbjh21 *    notice, this list of conditions and the following disclaimer in the
171.1Sbjh21 *    documentation and/or other materials provided with the distribution.
181.1Sbjh21 * 3. All advertising materials mentioning features or use of this software
191.1Sbjh21 *    must display the following acknowledgement:
201.1Sbjh21 *	This product includes software developed by Brini.
211.1Sbjh21 * 4. The name of the company nor the name of the author may be used to
221.1Sbjh21 *    endorse or promote products derived from this software without specific
231.1Sbjh21 *    prior written permission.
241.1Sbjh21 *
251.1Sbjh21 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
261.1Sbjh21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
271.1Sbjh21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
281.1Sbjh21 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
291.1Sbjh21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
301.1Sbjh21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
311.1Sbjh21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
321.1Sbjh21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
331.1Sbjh21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
341.1Sbjh21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
351.1Sbjh21 * SUCH DAMAGE.
361.1Sbjh21 *
371.1Sbjh21 * RiscBSD kernel project
381.1Sbjh21 *
391.1Sbjh21 * disklabel.h
401.1Sbjh21 *
411.1Sbjh21 * machine specific disk label info
421.1Sbjh21 *
431.1Sbjh21 * Created      : 04/10/94
441.1Sbjh21 */
451.1Sbjh21
461.2Sthorpej#ifndef _ARM_DISKLABEL_H_
471.2Sthorpej#define _ARM_DISKLABEL_H_
481.1Sbjh21
491.1Sbjh21#define LABELSECTOR	1		/* sector containing label */
501.1Sbjh21#define LABELOFFSET	0		/* offset of label in sector */
511.1Sbjh21#define MAXPARTITIONS	8		/* number of partitions */
521.1Sbjh21#define RAW_PART	2		/* raw partition: XX?c */
531.1Sbjh21
541.6Sdyoung#if HAVE_NBTOOL_CONFIG_H
551.6Sdyoung#include <nbinclude/sys/dkbad.h>
561.6Sdyoung#include <nbinclude/sys/disklabel_acorn.h>
571.6Sdyoung#include <nbinclude/sys/bootblock.h>
581.6Sdyoung#else
591.1Sbjh21#include <sys/dkbad.h>
601.2Sthorpej#include <sys/disklabel_acorn.h>
611.4Slukem#include <sys/bootblock.h>
621.6Sdyoung#endif /* HAVE_NBTOOL_CONFIG_H */
631.1Sbjh21
641.1Sbjh21struct cpu_disklabel {
651.4Slukem	struct mbr_partition mbrparts[MBR_PART_COUNT];
661.1Sbjh21	struct dkbad bad;
671.1Sbjh21};
681.1Sbjh21
691.1Sbjh21#ifdef _KERNEL
701.1Sbjh21struct buf;
711.1Sbjh21struct disklabel;
721.1Sbjh21
731.1Sbjh21/* for readdisklabel.  rv != 0 -> matches, msg == NULL -> success */
741.8Sdslint	mbr_label_read(dev_t, void (*)(struct buf *), struct disklabel *,
751.8Sdsl	    struct cpu_disklabel *, const char **, int *, int *);
761.1Sbjh21
771.1Sbjh21/* for writedisklabel.  rv == 0 -> dosen't match, rv > 0 -> success */
781.8Sdslint	mbr_label_locate(dev_t, void (*)(struct buf *),
791.8Sdsl	    struct disklabel *, struct cpu_disklabel *, int *, int *);
801.1Sbjh21#endif /* _KERNEL */
811.1Sbjh21
821.2Sthorpej#endif /* _ARM_DISKLABEL_H_ */
83