xref: /titanic_51/usr/src/cmd/boot/common/boot_utils.h (revision af28f636873b7156cfd73ceffa927658cca33fd0)
1*af28f636SEnrico Perla - Sun Microsystems /*
2*af28f636SEnrico Perla - Sun Microsystems  * CDDL HEADER START
3*af28f636SEnrico Perla - Sun Microsystems  *
4*af28f636SEnrico Perla - Sun Microsystems  * The contents of this file are subject to the terms of the
5*af28f636SEnrico Perla - Sun Microsystems  * Common Development and Distribution License (the "License").
6*af28f636SEnrico Perla - Sun Microsystems  * You may not use this file except in compliance with the License.
7*af28f636SEnrico Perla - Sun Microsystems  *
8*af28f636SEnrico Perla - Sun Microsystems  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*af28f636SEnrico Perla - Sun Microsystems  * or http://www.opensolaris.org/os/licensing.
10*af28f636SEnrico Perla - Sun Microsystems  * See the License for the specific language governing permissions
11*af28f636SEnrico Perla - Sun Microsystems  * and limitations under the License.
12*af28f636SEnrico Perla - Sun Microsystems  *
13*af28f636SEnrico Perla - Sun Microsystems  * When distributing Covered Code, include this CDDL HEADER in each
14*af28f636SEnrico Perla - Sun Microsystems  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*af28f636SEnrico Perla - Sun Microsystems  * If applicable, add the following below this CDDL HEADER, with the
16*af28f636SEnrico Perla - Sun Microsystems  * fields enclosed by brackets "[]" replaced with your own identifying
17*af28f636SEnrico Perla - Sun Microsystems  * information: Portions Copyright [yyyy] [name of copyright owner]
18*af28f636SEnrico Perla - Sun Microsystems  *
19*af28f636SEnrico Perla - Sun Microsystems  * CDDL HEADER END
20*af28f636SEnrico Perla - Sun Microsystems  */
21*af28f636SEnrico Perla - Sun Microsystems /*
22*af28f636SEnrico Perla - Sun Microsystems  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23*af28f636SEnrico Perla - Sun Microsystems  */
24*af28f636SEnrico Perla - Sun Microsystems 
25*af28f636SEnrico Perla - Sun Microsystems #ifndef	_BOOT_UTILS_H
26*af28f636SEnrico Perla - Sun Microsystems #define	_BOOT_UTILS_H
27*af28f636SEnrico Perla - Sun Microsystems 
28*af28f636SEnrico Perla - Sun Microsystems #ifdef	__cplusplus
29*af28f636SEnrico Perla - Sun Microsystems extern "C" {
30*af28f636SEnrico Perla - Sun Microsystems #endif
31*af28f636SEnrico Perla - Sun Microsystems 
32*af28f636SEnrico Perla - Sun Microsystems #include <stdarg.h>
33*af28f636SEnrico Perla - Sun Microsystems #include <sys/types.h>
34*af28f636SEnrico Perla - Sun Microsystems #include "bblk_einfo.h"
35*af28f636SEnrico Perla - Sun Microsystems 
36*af28f636SEnrico Perla - Sun Microsystems /* Common return values for various operations. */
37*af28f636SEnrico Perla - Sun Microsystems #define	BC_SUCCESS		(0)
38*af28f636SEnrico Perla - Sun Microsystems #define	BC_ERROR		(1)
39*af28f636SEnrico Perla - Sun Microsystems #define	BC_NOUPDT		(4)
40*af28f636SEnrico Perla - Sun Microsystems #define	BC_NOEXTRA		(5)
41*af28f636SEnrico Perla - Sun Microsystems #define	BC_NOEINFO		(6)
42*af28f636SEnrico Perla - Sun Microsystems 
43*af28f636SEnrico Perla - Sun Microsystems #define	SECTOR_SIZE		(512)
44*af28f636SEnrico Perla - Sun Microsystems 
45*af28f636SEnrico Perla - Sun Microsystems extern boolean_t boot_debug;
46*af28f636SEnrico Perla - Sun Microsystems extern boolean_t nowrite;
47*af28f636SEnrico Perla - Sun Microsystems 
48*af28f636SEnrico Perla - Sun Microsystems #define	BOOT_DEBUG(...)	boot_gdebug(__func__, __VA_ARGS__)
49*af28f636SEnrico Perla - Sun Microsystems 
50*af28f636SEnrico Perla - Sun Microsystems void boot_gdebug(const char *, char *, ...);
51*af28f636SEnrico Perla - Sun Microsystems 
52*af28f636SEnrico Perla - Sun Microsystems int write_out(int, void *, size_t, off_t);
53*af28f636SEnrico Perla - Sun Microsystems int read_in(int, void *, size_t, off_t);
54*af28f636SEnrico Perla - Sun Microsystems 
55*af28f636SEnrico Perla - Sun Microsystems #ifdef	__cplusplus
56*af28f636SEnrico Perla - Sun Microsystems }
57*af28f636SEnrico Perla - Sun Microsystems #endif
58*af28f636SEnrico Perla - Sun Microsystems 
59*af28f636SEnrico Perla - Sun Microsystems #endif /* _BOOT_UTILS_H */
60