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