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