xref: /onnv-gate/usr/src/cmd/boot/common/mboot_extra.h (revision 12947:f5f96e09bf49)
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	_MBOOT_EXTRA_H
26*12947SEnrico.Perla@Sun.COM #define	_MBOOT_EXTRA_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 <stdarg.h>
33*12947SEnrico.Perla@Sun.COM #include <sys/types.h>
34*12947SEnrico.Perla@Sun.COM #include "bblk_einfo.h"
35*12947SEnrico.Perla@Sun.COM 
36*12947SEnrico.Perla@Sun.COM /* multiboot header needs to be located in the first 32KB. */
37*12947SEnrico.Perla@Sun.COM #define	MBOOT_SCAN_SIZE		(32 * 1024 * 1024)
38*12947SEnrico.Perla@Sun.COM 
39*12947SEnrico.Perla@Sun.COM /* multiboot header AOUT_KLUDGE flag. */
40*12947SEnrico.Perla@Sun.COM #define	BB_MBOOT_AOUT_FLAG	(0x00010000)
41*12947SEnrico.Perla@Sun.COM 
42*12947SEnrico.Perla@Sun.COM /* Extra header preceeding the payloads at the end of the bootblock. */
43*12947SEnrico.Perla@Sun.COM typedef struct _bb_extra_header {
44*12947SEnrico.Perla@Sun.COM 	uint32_t	size;
45*12947SEnrico.Perla@Sun.COM 	uint32_t	checksum;
46*12947SEnrico.Perla@Sun.COM } bb_header_ext_t;
47*12947SEnrico.Perla@Sun.COM 
48*12947SEnrico.Perla@Sun.COM uint32_t compute_checksum(char *, uint32_t);
49*12947SEnrico.Perla@Sun.COM bblk_einfo_t *find_einfo(char *);
50*12947SEnrico.Perla@Sun.COM int find_multiboot(char *, uint32_t, uint32_t *);
51*12947SEnrico.Perla@Sun.COM void add_einfo(char *, char *, bblk_hs_t *, uint32_t);
52*12947SEnrico.Perla@Sun.COM int compare_bootblocks(char *, char *, char **);
53*12947SEnrico.Perla@Sun.COM 
54*12947SEnrico.Perla@Sun.COM #ifdef	__cplusplus
55*12947SEnrico.Perla@Sun.COM }
56*12947SEnrico.Perla@Sun.COM #endif
57*12947SEnrico.Perla@Sun.COM 
58*12947SEnrico.Perla@Sun.COM #endif /* _MBOOT_EXTRA_H */
59