1af28f636SEnrico Perla - Sun Microsystems /* 2af28f636SEnrico Perla - Sun Microsystems * CDDL HEADER START 3af28f636SEnrico Perla - Sun Microsystems * 4af28f636SEnrico Perla - Sun Microsystems * The contents of this file are subject to the terms of the 5af28f636SEnrico Perla - Sun Microsystems * Common Development and Distribution License (the "License"). 6af28f636SEnrico Perla - Sun Microsystems * You may not use this file except in compliance with the License. 7af28f636SEnrico Perla - Sun Microsystems * 8af28f636SEnrico Perla - Sun Microsystems * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9af28f636SEnrico Perla - Sun Microsystems * or http://www.opensolaris.org/os/licensing. 10af28f636SEnrico Perla - Sun Microsystems * See the License for the specific language governing permissions 11af28f636SEnrico Perla - Sun Microsystems * and limitations under the License. 12af28f636SEnrico Perla - Sun Microsystems * 13af28f636SEnrico Perla - Sun Microsystems * When distributing Covered Code, include this CDDL HEADER in each 14af28f636SEnrico Perla - Sun Microsystems * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15af28f636SEnrico Perla - Sun Microsystems * If applicable, add the following below this CDDL HEADER, with the 16af28f636SEnrico Perla - Sun Microsystems * fields enclosed by brackets "[]" replaced with your own identifying 17af28f636SEnrico Perla - Sun Microsystems * information: Portions Copyright [yyyy] [name of copyright owner] 18af28f636SEnrico Perla - Sun Microsystems * 19af28f636SEnrico Perla - Sun Microsystems * CDDL HEADER END 20af28f636SEnrico Perla - Sun Microsystems */ 21af28f636SEnrico Perla - Sun Microsystems /* 22af28f636SEnrico Perla - Sun Microsystems * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2314d44f22SHans Rosenfeld * Copyright 2012 Nexenta Systems, Inc. All rights reserved. 24af28f636SEnrico Perla - Sun Microsystems */ 25af28f636SEnrico Perla - Sun Microsystems 26af28f636SEnrico Perla - Sun Microsystems #ifndef _INSTALLBOOT_H 27af28f636SEnrico Perla - Sun Microsystems #define _INSTALLBOOT_H 28af28f636SEnrico Perla - Sun Microsystems 29af28f636SEnrico Perla - Sun Microsystems #ifdef __cplusplus 30af28f636SEnrico Perla - Sun Microsystems extern "C" { 31af28f636SEnrico Perla - Sun Microsystems #endif 32af28f636SEnrico Perla - Sun Microsystems 33af28f636SEnrico Perla - Sun Microsystems #include <sys/multiboot.h> 34af28f636SEnrico Perla - Sun Microsystems #include <sys/types.h> 35af28f636SEnrico Perla - Sun Microsystems 36af28f636SEnrico Perla - Sun Microsystems enum ib_fs_types { 37af28f636SEnrico Perla - Sun Microsystems TARGET_IS_UFS = 0, 38af28f636SEnrico Perla - Sun Microsystems TARGET_IS_HSFS, 39af28f636SEnrico Perla - Sun Microsystems TARGET_IS_ZFS 40af28f636SEnrico Perla - Sun Microsystems }; 41af28f636SEnrico Perla - Sun Microsystems 42af28f636SEnrico Perla - Sun Microsystems typedef struct _ib_device { 43af28f636SEnrico Perla - Sun Microsystems char *path; 44af28f636SEnrico Perla - Sun Microsystems int fd; 45af28f636SEnrico Perla - Sun Microsystems uint8_t type; 46af28f636SEnrico Perla - Sun Microsystems } ib_device_t; 47af28f636SEnrico Perla - Sun Microsystems 48af28f636SEnrico Perla - Sun Microsystems typedef struct _ib_bootblock { 49af28f636SEnrico Perla - Sun Microsystems char *buf; 50af28f636SEnrico Perla - Sun Microsystems char *file; 51af28f636SEnrico Perla - Sun Microsystems char *extra; 52af28f636SEnrico Perla - Sun Microsystems multiboot_header_t *mboot; 53af28f636SEnrico Perla - Sun Microsystems uint32_t mboot_off; 54af28f636SEnrico Perla - Sun Microsystems uint32_t buf_size; 55af28f636SEnrico Perla - Sun Microsystems uint32_t file_size; 5614d44f22SHans Rosenfeld uint32_t extra_size; 57af28f636SEnrico Perla - Sun Microsystems } ib_bootblock_t; 58af28f636SEnrico Perla - Sun Microsystems 59af28f636SEnrico Perla - Sun Microsystems typedef struct _ib_data { 60af28f636SEnrico Perla - Sun Microsystems ib_device_t device; 61af28f636SEnrico Perla - Sun Microsystems ib_bootblock_t bootblock; 62af28f636SEnrico Perla - Sun Microsystems } ib_data_t; 63af28f636SEnrico Perla - Sun Microsystems 64af28f636SEnrico Perla - Sun Microsystems #define is_zfs(type) (type == TARGET_IS_ZFS) 65af28f636SEnrico Perla - Sun Microsystems 66af28f636SEnrico Perla - Sun Microsystems #define BBLK_DATA_RSVD_SIZE (15 * SECTOR_SIZE) 67af28f636SEnrico Perla - Sun Microsystems #define BBLK_ZFS_EXTRA_OFF (SECTOR_SIZE * 1024) 68af28f636SEnrico Perla - Sun Microsystems 69af28f636SEnrico Perla - Sun Microsystems #ifdef __cplusplus 70af28f636SEnrico Perla - Sun Microsystems } 71af28f636SEnrico Perla - Sun Microsystems #endif 72af28f636SEnrico Perla - Sun Microsystems 73af28f636SEnrico Perla - Sun Microsystems #endif /* _INSTALLBOOT_H */ 74