2 * Copyright (c) 2008 Marcel Moolenaar
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #define VTOC_TAG_UNASSIGNED 0x00
33 #define VTOC_TAG_BOOT 0x01
34 #define VTOC_TAG_ROOT 0x02
35 #define VTOC_TAG_SWAP 0x03
36 #define VTOC_TAG_USR 0x04
37 #define VTOC_TAG_BACKUP 0x05 /* "c" partition */
38 #define VTOC_TAG_STAND 0x06
39 #define VTOC_TAG_VAR 0x07
40 #define VTOC_TAG_HOME 0x08
41 #define VTOC_TAG_ALTSCTR 0x09 /* alternate sector partition */
42 #define VTOC_TAG_CACHE 0x0a /* Solaris cachefs partition */
43 #define VTOC_TAG_VXVM_PUB 0x0e /* VxVM public region */
44 #define VTOC_TAG_VXVM_PRIV 0x0f /* VxVM private region */
46 /* NetBSD/mips defines this */
47 #define VTOC_TAG_NETBSD_FFS 0xff
49 /* FreeBSD tags: the high byte equals ELFOSABI_FREEBSD */
50 #define VTOC_TAG_FREEBSD_SWAP 0x0901
51 #define VTOC_TAG_FREEBSD_UFS 0x0902
52 #define VTOC_TAG_FREEBSD_VINUM 0x0903
53 #define VTOC_TAG_FREEBSD_ZFS 0x0904
54 #define VTOC_TAG_FREEBSD_NANDFS 0x0905
56 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */
57 #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */
59 #define VTOC_ASCII_LEN 128
60 #define VTOC_BOOTSIZE 8192 /* 16 sectors */
61 #define VTOC_MAGIC 0xdabe
62 #define VTOC_RAW_PART 2
63 #define VTOC_SANITY 0x600ddeee
64 #define VTOC_VERSION 1
65 #define VTOC_VOLUME_LEN 8
67 #define VTOC8_NPARTS 8
70 char ascii[VTOC_ASCII_LEN];
72 char volume[VTOC_VOLUME_LEN];
77 } part[VTOC8_NPARTS] __packed;
81 uint32_t reserved[10];
82 uint32_t timestamp[VTOC8_NPARTS];
105 CTASSERT(sizeof(struct vtoc8) == 512);
108 #endif /* _SYS_VTOC_H_ */