param.h revision 1.7 1 1.7 agc /* $NetBSD: param.h,v 1.7 2003/08/07 16:26:47 agc Exp $ */
2 1.1 is
3 1.1 is /*
4 1.1 is * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
5 1.1 is * All rights reserved.
6 1.7 agc *
7 1.7 agc * This code is derived from software contributed to Berkeley by
8 1.7 agc * the Systems Programming Group of the University of Utah Computer
9 1.7 agc * Science Department.
10 1.7 agc *
11 1.7 agc * Redistribution and use in source and binary forms, with or without
12 1.7 agc * modification, are permitted provided that the following conditions
13 1.7 agc * are met:
14 1.7 agc * 1. Redistributions of source code must retain the above copyright
15 1.7 agc * notice, this list of conditions and the following disclaimer.
16 1.7 agc * 2. Redistributions in binary form must reproduce the above copyright
17 1.7 agc * notice, this list of conditions and the following disclaimer in the
18 1.7 agc * documentation and/or other materials provided with the distribution.
19 1.7 agc * 3. Neither the name of the University nor the names of its contributors
20 1.7 agc * may be used to endorse or promote products derived from this software
21 1.7 agc * without specific prior written permission.
22 1.7 agc *
23 1.7 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.7 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.7 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.7 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.7 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.7 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.7 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.7 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.7 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.7 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.7 agc * SUCH DAMAGE.
34 1.7 agc *
35 1.7 agc * from: Utah $Hdr: machparam.h 1.11 89/08/14$
36 1.7 agc *
37 1.7 agc * @(#)param.h 7.8 (Berkeley) 6/28/91
38 1.7 agc */
39 1.7 agc /*
40 1.7 agc * Copyright (c) 1988 University of Utah.
41 1.1 is *
42 1.1 is * This code is derived from software contributed to Berkeley by
43 1.1 is * the Systems Programming Group of the University of Utah Computer
44 1.1 is * Science Department.
45 1.1 is *
46 1.1 is * Redistribution and use in source and binary forms, with or without
47 1.1 is * modification, are permitted provided that the following conditions
48 1.1 is * are met:
49 1.1 is * 1. Redistributions of source code must retain the above copyright
50 1.1 is * notice, this list of conditions and the following disclaimer.
51 1.1 is * 2. Redistributions in binary form must reproduce the above copyright
52 1.1 is * notice, this list of conditions and the following disclaimer in the
53 1.1 is * documentation and/or other materials provided with the distribution.
54 1.1 is * 3. All advertising materials mentioning features or use of this software
55 1.1 is * must display the following acknowledgement:
56 1.1 is * This product includes software developed by the University of
57 1.1 is * California, Berkeley and its contributors.
58 1.1 is * 4. Neither the name of the University nor the names of its contributors
59 1.1 is * may be used to endorse or promote products derived from this software
60 1.1 is * without specific prior written permission.
61 1.1 is *
62 1.1 is * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 1.1 is * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 1.1 is * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 1.1 is * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 1.1 is * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 1.1 is * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 1.1 is * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 1.1 is * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 1.1 is * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 1.1 is * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 1.1 is * SUCH DAMAGE.
73 1.1 is *
74 1.1 is * from: Utah $Hdr: machparam.h 1.11 89/08/14$
75 1.1 is *
76 1.1 is * @(#)param.h 7.8 (Berkeley) 6/28/91
77 1.1 is */
78 1.1 is
79 1.1 is #ifndef _MACHINE_PARAM_H_
80 1.1 is #define _MACHINE_PARAM_H_
81 1.1 is
82 1.1 is #ifdef _KERNEL
83 1.1 is #ifndef _LOCORE
84 1.1 is #include <machine/cpu.h>
85 1.1 is #endif /* _LOCORE */
86 1.1 is #endif
87 1.1 is
88 1.1 is /*
89 1.1 is * Machine dependent constants for Amiga PowerPC (32-bit only currently)
90 1.1 is */
91 1.1 is #define MACHINE "amigappc"
92 1.4 lukem #define MACHINE_ARCH "powerpc"
93 1.1 is #define MID_MACHINE MID_POWERPC
94 1.1 is
95 1.1 is #define ALIGNBYTES (sizeof(double) - 1)
96 1.1 is #define ALIGN(p) (((u_int)(p) + ALIGNBYTES) & ~ALIGNBYTES)
97 1.4 lukem #define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)
98 1.1 is
99 1.1 is #define PGSHIFT 12
100 1.1 is #define NBPG (1 << PGSHIFT) /* Page size */
101 1.1 is #define PGOFSET (NBPG - 1)
102 1.1 is
103 1.1 is #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
104 1.1 is #define DEV_BSIZE (1 << DEV_BSHIFT)
105 1.1 is #define BLKDEV_IOSIZE NBPG
106 1.1 is #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
107 1.1 is
108 1.1 is #define UPAGES 4
109 1.1 is #define USPACE (UPAGES * NBPG)
110 1.1 is
111 1.1 is #ifndef MSGBUFSIZE
112 1.1 is #define MSGBUFSIZE NBPG /* default message buffer size */
113 1.1 is #endif
114 1.1 is
115 1.1 is #define KERNBASE 0x00000000 /* start of kernel virtual */
116 1.1 is
117 1.1 is /*
118 1.1 is * Constants related to network buffer management.
119 1.1 is * MCLBYTES must be no larger than NBPG (the software page size), and,
120 1.1 is * on machines that exchange pages of input or output buffers with mbuf
121 1.1 is * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
122 1.1 is * of the hardware page size.
123 1.1 is */
124 1.2 itojun #define MSIZE 256 /* size of an mbuf */
125 1.1 is #define MCLSHIFT 11 /* convert bytes to m_buf clusters */
126 1.1 is #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
127 1.1 is
128 1.1 is #ifndef NMBCLUSTERS
129 1.1 is
130 1.3 mrg #if defined(_KERNEL_OPT)
131 1.1 is #include "opt_gateway.h"
132 1.3 mrg #endif
133 1.1 is
134 1.1 is #ifdef GATEWAY
135 1.1 is #define NMBCLUSTERS 512 /* map size, max cluster allocation */
136 1.1 is #else
137 1.1 is #define NMBCLUSTERS 256 /* map size, max cluster allocation */
138 1.1 is #endif
139 1.1 is #endif
140 1.1 is
141 1.1 is /*
142 1.1 is * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
143 1.1 is * logical pages.
144 1.1 is */
145 1.4 lukem #define NKMEMPAGES_MIN_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
146 1.4 lukem #define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
147 1.1 is
148 1.1 is /*
149 1.1 is * pages ("clicks") to disk blocks
150 1.1 is */
151 1.1 is #define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
152 1.1 is #define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
153 1.1 is /*
154 1.1 is * bytes to pages
155 1.1 is */
156 1.1 is #define ctob(x) ((x) << PGSHIFT)
157 1.1 is #define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
158 1.1 is
159 1.1 is /*
160 1.1 is * bytes to disk blocks
161 1.1 is */
162 1.1 is #define dbtob(x) ((x) << DEV_BSHIFT)
163 1.1 is #define btodb(x) ((x) >> DEV_BSHIFT)
164 1.1 is
165 1.1 is /*
166 1.1 is * Segment handling stuff
167 1.1 is */
168 1.1 is #define SEGMENT_LENGTH 0x10000000
169 1.1 is #define SEGMENT_MASK 0xf0000000
170 1.1 is
171 1.1 is /*
172 1.1 is * Fixed segments
173 1.1 is */
174 1.1 is #define USER_SR 13
175 1.1 is #define KERNEL_SR 14
176 1.1 is #define KERNEL_SEGMENT (0xf0000 + KERNEL_SR)
177 1.1 is #define EMPTY_SEGMENT 0xfffff0
178 1.1 is #define USER_ADDR ((void *)(USER_SR << ADDR_SR_SHFT))
179 1.1 is
180 1.1 is /*
181 1.1 is * Some system constants
182 1.1 is */
183 1.1 is #ifndef NPMAPS
184 1.1 is #define NPMAPS 32768 /* Number of pmaps in system */
185 1.1 is #endif
186 1.1 is
187 1.1 is #ifdef _KERNEL
188 1.1 is /*
189 1.1 is * point to the custom.intenar and custom.intenaw respectively.
190 1.1 is extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
191 1.1 is */
192 1.1 is
193 1.1 is /* ADAM: redefiniton of cpu.h */
194 1.6 bjh21 #if 0
195 1.1 is #ifndef _LOCORE
196 1.1 is void delay __P((int));
197 1.1 is void DELAY __P((int));
198 1.5 wiz #endif /* !_LOCORE */
199 1.6 bjh21 #endif /* 0 */
200 1.1 is #endif /* _KERNEL */
201 1.1 is
202 1.1 is #endif /* def _MACHINE_PARAM_H_ */
203