1*d24234c2SJerry Gilliam /*
2*d24234c2SJerry Gilliam  * CDDL HEADER START
3*d24234c2SJerry Gilliam  *
4*d24234c2SJerry Gilliam  * The contents of this file are subject to the terms of the
5*d24234c2SJerry Gilliam  * Common Development and Distribution License (the "License").
6*d24234c2SJerry Gilliam  * You may not use this file except in compliance with the License.
7*d24234c2SJerry Gilliam  *
8*d24234c2SJerry Gilliam  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*d24234c2SJerry Gilliam  * or http://www.opensolaris.org/os/licensing.
10*d24234c2SJerry Gilliam  * See the License for the specific language governing permissions
11*d24234c2SJerry Gilliam  * and limitations under the License.
12*d24234c2SJerry Gilliam  *
13*d24234c2SJerry Gilliam  * When distributing Covered Code, include this CDDL HEADER in each
14*d24234c2SJerry Gilliam  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*d24234c2SJerry Gilliam  * If applicable, add the following below this CDDL HEADER, with the
16*d24234c2SJerry Gilliam  * fields enclosed by brackets "[]" replaced with your own identifying
17*d24234c2SJerry Gilliam  * information: Portions Copyright [yyyy] [name of copyright owner]
18*d24234c2SJerry Gilliam  *
19*d24234c2SJerry Gilliam  * CDDL HEADER END
20*d24234c2SJerry Gilliam  */
21*d24234c2SJerry Gilliam /*
22*d24234c2SJerry Gilliam  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23*d24234c2SJerry Gilliam  * Use is subject to license terms.
24*d24234c2SJerry Gilliam  */
25*d24234c2SJerry Gilliam 
26*d24234c2SJerry Gilliam #ifndef _SYS_MACHPARAM_H
27*d24234c2SJerry Gilliam #define	_SYS_MACHPARAM_H
28*d24234c2SJerry Gilliam 
29*d24234c2SJerry Gilliam #ifdef	__cplusplus
30*d24234c2SJerry Gilliam extern "C" {
31*d24234c2SJerry Gilliam #endif
32*d24234c2SJerry Gilliam 
33*d24234c2SJerry Gilliam #ifndef _ASM
34*d24234c2SJerry Gilliam #define	ADDRESS_C(c)    c ## ul
35*d24234c2SJerry Gilliam #else   /* _ASM */
36*d24234c2SJerry Gilliam #define	ADDRESS_C(c)    (c)
37*d24234c2SJerry Gilliam #endif	/* _ASM */
38*d24234c2SJerry Gilliam 
39*d24234c2SJerry Gilliam /*
40*d24234c2SJerry Gilliam  * Common subset of sun4 machine dependent parameters and limits
41*d24234c2SJerry Gilliam  */
42*d24234c2SJerry Gilliam 
43*d24234c2SJerry Gilliam /*
44*d24234c2SJerry Gilliam  * MMU_PAGES* describes the physical page size used by the mapping hardware.
45*d24234c2SJerry Gilliam  * PAGES* describes the logical page size used by the system.
46*d24234c2SJerry Gilliam  */
47*d24234c2SJerry Gilliam #define	MMU_PAGE_SIZES		6	/* max mmu-supported page sizes */
48*d24234c2SJerry Gilliam #define	DEFAULT_MMU_PAGE_SIZES	4	/* default supported page sizes */
49*d24234c2SJerry Gilliam 
50*d24234c2SJerry Gilliam /*
51*d24234c2SJerry Gilliam  * XXX make sure the MMU_PAGESHIFT definition here is
52*d24234c2SJerry Gilliam  * consistent with the one in param.h
53*d24234c2SJerry Gilliam  */
54*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT		13
55*d24234c2SJerry Gilliam #define	MMU_PAGESIZE		(1<<MMU_PAGESHIFT)
56*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET		(MMU_PAGESIZE - 1)
57*d24234c2SJerry Gilliam #define	MMU_PAGEMASK		(~MMU_PAGEOFFSET)
58*d24234c2SJerry Gilliam 
59*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT64K	16
60*d24234c2SJerry Gilliam #define	MMU_PAGESIZE64K		(1 << MMU_PAGESHIFT64K)
61*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET64K	(MMU_PAGESIZE64K - 1)
62*d24234c2SJerry Gilliam #define	MMU_PAGEMASK64K		(~MMU_PAGEOFFSET64K)
63*d24234c2SJerry Gilliam 
64*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT512K	19
65*d24234c2SJerry Gilliam #define	MMU_PAGESIZE512K	(1 << MMU_PAGESHIFT512K)
66*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET512K	(MMU_PAGESIZE512K - 1)
67*d24234c2SJerry Gilliam #define	MMU_PAGEMASK512K	(~MMU_PAGEOFFSET512K)
68*d24234c2SJerry Gilliam 
69*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT4M		22
70*d24234c2SJerry Gilliam #define	MMU_PAGESIZE4M		(1 << MMU_PAGESHIFT4M)
71*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET4M	(MMU_PAGESIZE4M - 1)
72*d24234c2SJerry Gilliam #define	MMU_PAGEMASK4M		(~MMU_PAGEOFFSET4M)
73*d24234c2SJerry Gilliam 
74*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT32M	25
75*d24234c2SJerry Gilliam #define	MMU_PAGESIZE32M		(1 << MMU_PAGESHIFT32M)
76*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET32M	(MMU_PAGESIZE32M - 1)
77*d24234c2SJerry Gilliam #define	MMU_PAGEMASK32M		(~MMU_PAGEOFFSET32M)
78*d24234c2SJerry Gilliam 
79*d24234c2SJerry Gilliam #define	MMU_PAGESHIFT256M	28
80*d24234c2SJerry Gilliam #define	MMU_PAGESIZE256M	(1 << MMU_PAGESHIFT256M)
81*d24234c2SJerry Gilliam #define	MMU_PAGEOFFSET256M	(MMU_PAGESIZE256M - 1)
82*d24234c2SJerry Gilliam #define	MMU_PAGEMASK256M	(~MMU_PAGEOFFSET256M)
83*d24234c2SJerry Gilliam 
84*d24234c2SJerry Gilliam #define	PAGESHIFT	13
85*d24234c2SJerry Gilliam #define	PAGESIZE	(1<<PAGESHIFT)
86*d24234c2SJerry Gilliam #define	PAGEOFFSET	(PAGESIZE - 1)
87*d24234c2SJerry Gilliam #define	PAGEMASK	(~PAGEOFFSET)
88*d24234c2SJerry Gilliam 
89*d24234c2SJerry Gilliam #ifdef	__cplusplus
90*d24234c2SJerry Gilliam }
91*d24234c2SJerry Gilliam #endif
92*d24234c2SJerry Gilliam 
93*d24234c2SJerry Gilliam #endif	/* _SYS_MACHPARAM_H */