8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libbc / inc / include / sun4 / param.h
blob75327f65b43edf6e04196118a1b461f4c8b45b8b
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 1989 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _sun4_param_h
28 #define _sun4_param_h
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * This file is intended to contain the basic
34 * specific details of a given architecture.
38 * Machine dependent constants for Sun4.
42 * Define the VAC symbol if we could run on a machine
43 * which has a Virtual Address Cache (e.g. SUN4_260)
45 #if defined(SUN4_260) || defined(SUN4_470) || defined(SUN4_330)
46 #define VAC
47 #else
48 #undef VAC
49 #endif /* SUN4_260 || SUN4_470 || SUN4_330 */
52 * Define the FPU symbol if we could run on a machine with an external
53 * FPU (i.e. not integrated with the normal machine state like the vax).
55 #define FPU
58 * Define the MMU_3LEVEL symbol if we could run on a machine with
59 * a three level mmu. We also assume these machines have region
60 * and user cache flush operations.
62 #ifdef SUN4_470
63 #define MMU_3LEVEL
64 #else
65 #undef MMU_3LEVEL
66 #endif /* SUN4_470 */
69 * Define IOC if we could run on machines that have an I/O cache.
71 #ifdef SUN4_470
72 #define IOC
73 #else
74 #undef IOC
75 #endif /* SUN4_470 */
78 * Define BCOPY_BUF if we could run on machines that have a bcopy buffer.
80 #ifdef SUN4_470
81 #define BCOPY_BUF
82 #else
83 #undef BCOPY_BUF
84 #endif /* SUN4_470 */
87 * Define VA_HOLE for machines that have a hole in the virtual address space.
89 #if defined(SUN4_260) || defined(SUN4_110) || defined(SUN4_330)
90 #define VA_HOLE
91 #else
92 #undef VA_HOLE
93 #endif /* SUN4_260 || SUN4_110 || SUN4_330 */
96 * MMU_PAGES* describes the physical page size used by the mapping hardware.
97 * PAGES* describes the logical page size used by the system.
100 #define MMU_PAGESIZE 0x2000 /* 8192 bytes */
101 #define MMU_PAGESHIFT 13 /* log2(MMU_PAGESIZE) */
102 #define MMU_PAGEOFFSET (MMU_PAGESIZE-1)/* Mask of address bits in page */
103 #define MMU_PAGEMASK (~MMU_PAGEOFFSET)
105 #define PAGESIZE 0x2000 /* All of the above, for logical */
106 #define PAGESHIFT 13
107 #define PAGEOFFSET (PAGESIZE - 1)
108 #define PAGEMASK (~PAGEOFFSET)
111 * DATA_ALIGN is used to define the alignment of the Unix data segment.
113 #define DATA_ALIGN 0x2000
116 * Some random macros for units conversion.
120 * MMU pages to bytes, and back (with and without rounding)
122 #define mmu_ptob(x) ((x) << MMU_PAGESHIFT)
123 #define mmu_btop(x) (((unsigned)(x)) >> MMU_PAGESHIFT)
124 #define mmu_btopr(x) ((((unsigned)(x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
127 * pages to bytes, and back (with and without rounding)
129 #define ptob(x) ((x) << PAGESHIFT)
130 #define btop(x) (((unsigned)(x)) >> PAGESHIFT)
131 #define btopr(x) ((((unsigned)(x) + PAGEOFFSET) >> PAGESHIFT))
134 * 2 versions of pages to disk blocks
136 #define mmu_ptod(x) ((x) << (MMU_PAGESHIFT - DEV_BSHIFT))
137 #define ptod(x) ((x) << (PAGESHIFT - DEV_BSHIFT))
140 * Delay units are in microseconds.
142 #define DELAY(n) usec_delay(n)
143 #define CDELAY(c, n) \
145 register int N = n; \
146 while (--N > 0) { \
147 if (c) \
148 break; \
149 usec_delay(1); \
153 #define UPAGES 2 /* pages of u-area, NOT including red zone */
154 #define KERNSTACK 0x3000 /* size of kernel stack in u-area */
157 * KERNSIZE the amount of vitual address space the kernel
158 * uses in all contexts.
160 #define KERNELSIZE (128*1024*1024)
163 * KERNELBASE is the virtual address which
164 * the kernel text/data mapping starts in all contexts.
166 #define KERNELBASE (0-KERNELSIZE)
169 * SYSBASE is the virtual address which
170 * the kernel allocated memory mapping starts in all contexts.
172 #define SYSBASE (0-(16*1024*1024))
175 * Msgbuf size.
177 #define MSG_BSIZE ((7 * 1024) - sizeof (struct msgbuf_hd))
180 * XXX - Macros for compatibility
182 /* Clicks (MMU PAGES) to disk blocks */
183 #define ctod(x) mmu_ptod(x)
185 /* Clicks (MMU PAGES) to bytes, and back (with rounding) */
186 #define ctob(x) mmu_ptob(x)
187 #define btoc(x) mmu_btopr(x)
190 * XXX - Old names for some backwards compatibility
192 #define NBPG MMU_PAGESIZE
193 #define PGOFSET MMU_PAGEOFFSET
194 #define PGSHIFT MMU_PAGESHIFT
196 #define CLSIZE 1
197 #define CLSIZELOG2 0
198 #define CLBYTES PAGESIZE
199 #define CLOFSET PAGEOFFSET
200 #define CLSHIFT PAGESHIFT
201 #define clrnd(i) (i)
203 #endif /* !_sun4_param_h */