vtoc.h revision 208777
1284990Scy/*- 2284990Scy * Copyright (c) 2008 Marcel Moolenaar 3284990Scy * All rights reserved. 4284990Scy * 5284990Scy * Redistribution and use in source and binary forms, with or without 6284990Scy * modification, are permitted provided that the following conditions 7284990Scy * are met: 8284990Scy * 9284990Scy * 1. Redistributions of source code must retain the above copyright 10284990Scy * notice, this list of conditions and the following disclaimer. 11284990Scy * 2. Redistributions in binary form must reproduce the above copyright 12284990Scy * notice, this list of conditions and the following disclaimer in the 13284990Scy * documentation and/or other materials provided with the distribution. 14284990Scy * 15284990Scy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16284990Scy * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17284990Scy * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18284990Scy * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19284990Scy * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20284990Scy * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21284990Scy * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22284990Scy * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23284990Scy * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24284990Scy * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25290000Sglebius * 26290000Sglebius * $FreeBSD: head/sys/sys/vtoc.h 208777 2010-06-03 13:01:55Z marius $ 27290000Sglebius */ 28290000Sglebius 29290000Sglebius#ifndef _SYS_VTOC_H_ 30290000Sglebius#define _SYS_VTOC_H_ 31284990Scy 32284990Scy#define VTOC_TAG_UNASSIGNED 0x00 33284990Scy#define VTOC_TAG_BOOT 0x01 34284990Scy#define VTOC_TAG_ROOT 0x02 35290000Sglebius#define VTOC_TAG_SWAP 0x03 36290000Sglebius#define VTOC_TAG_USR 0x04 37290000Sglebius#define VTOC_TAG_BACKUP 0x05 /* "c" partition */ 38290000Sglebius#define VTOC_TAG_STAND 0x06 39290000Sglebius#define VTOC_TAG_VAR 0x07 40290000Sglebius#define VTOC_TAG_HOME 0x08 41290000Sglebius#define VTOC_TAG_ALTSCTR 0x09 /* alternate sector partition */ 42290000Sglebius#define VTOC_TAG_CACHE 0x0a /* Solaris cachefs partition */ 43290000Sglebius#define VTOC_TAG_VXVM_PUB 0x0e /* VxVM public region */ 44290000Sglebius#define VTOC_TAG_VXVM_PRIV 0x0f /* VxVM private region */ 45290000Sglebius 46290000Sglebius/* NetBSD/mips defines this */ 47290000Sglebius#define VTOC_TAG_NETBSD_FFS 0xff 48290000Sglebius 49290000Sglebius/* FreeBSD tags: the high byte equals ELFOSABI_FREEBSD */ 50290000Sglebius#define VTOC_TAG_FREEBSD_SWAP 0x0901 51290000Sglebius#define VTOC_TAG_FREEBSD_UFS 0x0902 52290000Sglebius#define VTOC_TAG_FREEBSD_VINUM 0x0903 53290000Sglebius#define VTOC_TAG_FREEBSD_ZFS 0x0904 54290000Sglebius 55290000Sglebius#define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ 56290000Sglebius#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ 57290000Sglebius 58290000Sglebius#define VTOC_ASCII_LEN 128 59290000Sglebius#define VTOC_BOOTSIZE 8192 /* 16 sectors */ 60290000Sglebius#define VTOC_MAGIC 0xdabe 61290000Sglebius#define VTOC_RAW_PART 2 62290000Sglebius#define VTOC_SANITY 0x600ddeee 63284990Scy#define VTOC_VERSION 1 64284990Scy#define VTOC_VOLUME_LEN 8 65284990Scy 66290000Sglebius#define VTOC8_NPARTS 8 67290000Sglebius 68284990Scystruct vtoc8 { 69284990Scy char ascii[VTOC_ASCII_LEN]; 70284990Scy uint32_t version; 71284990Scy char volume[VTOC_VOLUME_LEN]; 72284990Scy uint16_t nparts; 73290000Sglebius struct { 74284990Scy uint16_t tag; 75284990Scy uint16_t flag; 76284990Scy } part[VTOC8_NPARTS] __packed; 77284990Scy uint16_t __alignment; 78284990Scy uint32_t bootinfo[3]; 79284990Scy uint32_t sanity; 80284990Scy uint32_t reserved[10]; 81293894Sglebius uint32_t timestamp[VTOC8_NPARTS]; 82293894Sglebius uint16_t wskip; 83293894Sglebius uint16_t rskip; 84293894Sglebius char padding[152]; 85293894Sglebius uint16_t rpm; 86293894Sglebius uint16_t physcyls; 87293894Sglebius uint16_t sparesecs; 88293894Sglebius uint16_t spare1[2]; 89293894Sglebius uint16_t interleave; 90293894Sglebius uint16_t ncyls; 91293894Sglebius uint16_t altcyls; 92293894Sglebius uint16_t nheads; 93293894Sglebius uint16_t nsecs; 94293894Sglebius uint16_t spare2[2]; 95293894Sglebius struct { 96293894Sglebius uint32_t cyl; 97293894Sglebius uint32_t nblks; 98293894Sglebius } map[VTOC8_NPARTS]; 99293894Sglebius uint16_t magic; 100293894Sglebius uint16_t cksum; 101293894Sglebius} __packed; 102293894Sglebius 103293894Sglebius#ifdef CTASSERT 104293894SglebiusCTASSERT(sizeof(struct vtoc8) == 512); 105293894Sglebius#endif 106293894Sglebius 107293894Sglebius#endif /* _SYS_VTOC_H_ */ 108293894Sglebius