Home | History | Annotate | Line # | Download | only in include
disklabel.h revision 1.1
      1 /*	$NetBSD: disklabel.h,v 1.1 2000/08/12 22:58:13 wdk Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2000 Wayne Knowles.     All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *      This product includes software developed by Christopher G. Demetriou.
     17  * 4. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 #if 0
     33 
     34 #define	LABELSECTOR	0			/* sector containing label */
     35 #define	LABELOFFSET	64			/* offset of label in sector */
     36 #define	MAXPARTITIONS	8			/* number of partitions */
     37 #define	RAW_PART	2			/* raw partition: xx?c */
     38 #define NUMBOOT		2			/* bootxx + xxboot... */
     39 
     40 /* Just a dummy */
     41 struct cpu_disklabel {
     42 	int	cd_dummy;			/* must have one element. */
     43 };
     44 
     45 #endif /* _MACHINE_DISKLABEL_H_ */
     46 
     47 
     48 #ifndef _MACHINE_DISKLABEL_H_
     49 #define _MACHINE_DISKLABEL_H_
     50 
     51 /*
     52  * MIPS partition conventions:
     53  *
     54  * Partition 0 - root
     55  * Partition 1 - swap
     56  * Partition 6 - usr
     57  * Partition 7 - volume body
     58  * Partition 8 - volume header
     59  * Partition 10 - whole disk
     60  */
     61 
     62 #define MAXPARTITIONS	8
     63 #define RAW_PART	2
     64 
     65 #define LABELSECTOR	0
     66 #define LABELOFFSET	128
     67 
     68 struct cpu_disklabel {
     69 	int	cd_dummy;
     70 };
     71 
     72 struct mips_volheader {
     73 	u_int32_t	vh_magic;
     74 #define MIPS_VH_MAGIC	0xbe5a941
     75 	int16_t		root;	/* Root partition number */
     76 	int16_t		swap;	/* Swap partition number */
     77 	char		bootfile[16]; /* Path of default file to boot */
     78 	char		_devparms[48]; /* disk device parameters */
     79 	struct {		/* Disk volume directory */
     80 		char 		name[8];
     81 		int32_t		block;
     82 		int32_t		bytes;
     83 	} voldir[15];
     84 	struct {
     85 		int32_t 	blocks;
     86 		int32_t 	first;
     87 		int32_t 	type;
     88 	} partitions[16];
     89 	int32_t		checksum;
     90 	int32_t		_pad;
     91 } __attribute__((__packed__));
     92 
     93 #define MIPS_PTYPE_VOLHDR	0
     94 #define MIPS_PTYPE_TRKREPL      1
     95 #define MIPS_PTYPE_SECREPL      2
     96 #define MIPS_PTYPE_RAW		3
     97 #define MIPS_PTYPE_BSD          4
     98 #define MIPS_PTYPE_BSD42        4
     99 #define MIPS_PTYPE_SYSV         5
    100 #define MIPS_PTYPE_VOLUME	6 /* Entire volume */
    101 
    102 #endif /* _MACHINE_DISKLABEL_H_ */
    103