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