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