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