xref: /titanic_44/usr/src/uts/i86pc/dboot/dboot_xboot.h (revision 843e19887f64dde75055cf8842fc4db2171eff45)
1*ae115bc7Smrj /*
2*ae115bc7Smrj  * CDDL HEADER START
3*ae115bc7Smrj  *
4*ae115bc7Smrj  * The contents of this file are subject to the terms of the
5*ae115bc7Smrj  * Common Development and Distribution License (the "License").
6*ae115bc7Smrj  * You may not use this file except in compliance with the License.
7*ae115bc7Smrj  *
8*ae115bc7Smrj  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*ae115bc7Smrj  * or http://www.opensolaris.org/os/licensing.
10*ae115bc7Smrj  * See the License for the specific language governing permissions
11*ae115bc7Smrj  * and limitations under the License.
12*ae115bc7Smrj  *
13*ae115bc7Smrj  * When distributing Covered Code, include this CDDL HEADER in each
14*ae115bc7Smrj  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*ae115bc7Smrj  * If applicable, add the following below this CDDL HEADER, with the
16*ae115bc7Smrj  * fields enclosed by brackets "[]" replaced with your own identifying
17*ae115bc7Smrj  * information: Portions Copyright [yyyy] [name of copyright owner]
18*ae115bc7Smrj  *
19*ae115bc7Smrj  * CDDL HEADER END
20*ae115bc7Smrj  */
21*ae115bc7Smrj 
22*ae115bc7Smrj /*
23*ae115bc7Smrj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*ae115bc7Smrj  * Use is subject to license terms.
25*ae115bc7Smrj  */
26*ae115bc7Smrj 
27*ae115bc7Smrj #ifndef	_DBOOT_XBOOT_H
28*ae115bc7Smrj #define	_DBOOT_XBOOT_H
29*ae115bc7Smrj 
30*ae115bc7Smrj #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*ae115bc7Smrj 
32*ae115bc7Smrj #include <sys/mach_mmu.h>
33*ae115bc7Smrj 
34*ae115bc7Smrj #ifdef	__cplusplus
35*ae115bc7Smrj extern "C" {
36*ae115bc7Smrj #endif
37*ae115bc7Smrj 
38*ae115bc7Smrj #include <sys/note.h>
39*ae115bc7Smrj 
40*ae115bc7Smrj /*
41*ae115bc7Smrj  * Stack used by xboot
42*ae115bc7Smrj  */
43*ae115bc7Smrj #define	STACK_SIZE	0x8000
44*ae115bc7Smrj 
45*ae115bc7Smrj #ifndef _ASM
46*ae115bc7Smrj 
47*ae115bc7Smrj extern paddr_t ktext_phys;
48*ae115bc7Smrj extern struct xboot_info *bi;
49*ae115bc7Smrj 
50*ae115bc7Smrj /*
51*ae115bc7Smrj  * Debugging macros
52*ae115bc7Smrj  */
53*ae115bc7Smrj extern uint_t prom_debug;
54*ae115bc7Smrj 
55*ae115bc7Smrj #define	DBG_MSG(s)	do { if (prom_debug)	\
56*ae115bc7Smrj 	dboot_printf(s);			\
57*ae115bc7Smrj 	_NOTE(CONSTANTCONDITION)		\
58*ae115bc7Smrj 	} while (0)
59*ae115bc7Smrj 
60*ae115bc7Smrj #define	DBG(x)	do { if (prom_debug) {					\
61*ae115bc7Smrj 	dboot_printf("%s is 0x%" PRIx64 "\n", #x, (uint64_t)(x));	\
62*ae115bc7Smrj 	_NOTE(CONSTANTCONDITION)					\
63*ae115bc7Smrj 	} } while (0)
64*ae115bc7Smrj 
65*ae115bc7Smrj extern void dboot_halt(void);
66*ae115bc7Smrj extern void *mem_alloc(uint32_t size);
67*ae115bc7Smrj 
68*ae115bc7Smrj #define	RNDUP(x, y)	((x) + ((y) - 1ul) & ~((y) - 1ul))
69*ae115bc7Smrj 
70*ae115bc7Smrj #endif /* _ASM */
71*ae115bc7Smrj 
72*ae115bc7Smrj 
73*ae115bc7Smrj #ifdef	__cplusplus
74*ae115bc7Smrj }
75*ae115bc7Smrj #endif
76*ae115bc7Smrj 
77*ae115bc7Smrj #endif	/* _DBOOT_XBOOT_H */
78