Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / zfs / vdev_impl.h
blob9b5f0a7a861603c639a226f63d957e081208c2a2
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
5 * GRUB is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
20 * Use is subject to license terms.
23 #ifndef _SYS_VDEV_IMPL_H
24 #define _SYS_VDEV_IMPL_H
26 #define VDEV_SKIP_SIZE (8 << 10)
27 #define VDEV_BOOT_HEADER_SIZE (8 << 10)
28 #define VDEV_PHYS_SIZE (112 << 10)
29 #define VDEV_UBERBLOCK_RING (128 << 10)
31 /* ZFS boot block */
32 #define VDEV_BOOT_MAGIC 0x2f5b007b10cULL
33 #define VDEV_BOOT_VERSION 1 /* version number */
35 typedef struct vdev_boot_header {
36 grub_uint64_t vb_magic; /* VDEV_BOOT_MAGIC */
37 grub_uint64_t vb_version; /* VDEV_BOOT_VERSION */
38 grub_uint64_t vb_offset; /* start offset (bytes) */
39 grub_uint64_t vb_size; /* size (bytes) */
40 char vb_pad[VDEV_BOOT_HEADER_SIZE - 4 * sizeof (grub_uint64_t)];
41 } vdev_boot_header_t;
43 typedef struct vdev_phys {
44 char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)];
45 zio_eck_t vp_zbt;
46 } vdev_phys_t;
48 typedef struct vdev_label {
49 char vl_pad[VDEV_SKIP_SIZE]; /* 8K */
50 vdev_boot_header_t vl_boot_header; /* 8K */
51 vdev_phys_t vl_vdev_phys; /* 112K */
52 char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */
53 } vdev_label_t; /* 256K total */
56 * Size and offset of embedded boot loader region on each label.
57 * The total size of the first two labels plus the boot area is 4MB.
59 #define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t))
60 #define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */
63 * Size of label regions at the start and end of each leaf device.
65 #define VDEV_LABEL_START_SIZE (2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE)
66 #define VDEV_LABEL_END_SIZE (2 * sizeof (vdev_label_t))
67 #define VDEV_LABELS 4
69 #endif /* _SYS_VDEV_IMPL_H */