]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /* $NetBSD: disklabel.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */\r |
2 | \r | |
3 | /*\r | |
4 | * Copyright (c) 1994 Christopher G. Demetriou\r | |
5 | * All rights reserved.\r | |
6 | *\r | |
7 | * Redistribution and use in source and binary forms, with or without\r | |
8 | * modification, are permitted provided that the following conditions\r | |
9 | * are met:\r | |
10 | * 1. Redistributions of source code must retain the above copyright\r | |
11 | * notice, this list of conditions and the following disclaimer.\r | |
12 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
13 | * notice, this list of conditions and the following disclaimer in the\r | |
14 | * documentation and/or other materials provided with the distribution.\r | |
15 | * 3. All advertising materials mentioning features or use of this software\r | |
16 | * must display the following acknowledgement:\r | |
17 | * This product includes software developed by Christopher G. Demetriou.\r | |
18 | * 4. The name of the author may not be used to endorse or promote products\r | |
19 | * derived from this software without specific prior written permission\r | |
20 | *\r | |
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r | |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r | |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r | |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r | |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r | |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r | |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r | |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r | |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r | |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r | |
31 | */\r | |
32 | \r | |
33 | #ifndef _MACHINE_DISKLABEL_H_\r | |
34 | #define _MACHINE_DISKLABEL_H_\r | |
35 | \r | |
36 | #define LABELSECTOR 1 /* sector containing label */\r | |
37 | #define LABELOFFSET 0 /* offset of label in sector */\r | |
38 | #define MAXPARTITIONS 16 /* number of partitions */\r | |
39 | #define OLDMAXPARTITIONS 8 /* number of partitions before 1.6 */\r | |
40 | #define RAW_PART 3 /* raw partition: XX?d (XXX) */\r | |
41 | \r | |
42 | /*\r | |
43 | * We use the highest bit of the minor number for the partition number.\r | |
44 | * This maintains backward compatibility with device nodes created before\r | |
45 | * MAXPARTITIONS was increased.\r | |
46 | */\r | |
47 | #define __I386_MAXDISKS ((1 << 20) / MAXPARTITIONS)\r | |
48 | #define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __I386_MAXDISKS)\r | |
49 | #define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \\r | |
50 | ((minor(dev) / (__I386_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))\r | |
51 | #define DISKMINOR(unit, part) \\r | |
52 | (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \\r | |
53 | ((part) / OLDMAXPARTITIONS) * (__I386_MAXDISKS * OLDMAXPARTITIONS))\r | |
54 | \r | |
55 | /* Pull in MBR partition definitions. */\r | |
56 | #if HAVE_NBTOOL_CONFIG_H\r | |
57 | #include <nbinclude/sys/bootblock.h>\r | |
58 | #else\r | |
59 | #include <sys/bootblock.h>\r | |
60 | #endif /* HAVE_NBTOOL_CONFIG_H */\r | |
61 | \r | |
62 | #ifndef __ASSEMBLER__\r | |
63 | #if HAVE_NBTOOL_CONFIG_H\r | |
64 | #include <nbinclude/sys/dkbad.h>\r | |
65 | #else\r | |
66 | #include <sys/dkbad.h>\r | |
67 | #endif /* HAVE_NBTOOL_CONFIG_H */\r | |
68 | struct cpu_disklabel {\r | |
69 | struct dkbad bad;\r | |
70 | };\r | |
71 | #endif\r | |
72 | \r | |
73 | #endif /* _MACHINE_DISKLABEL_H_ */\r |