xref: /netbsd/sys/arch/news68k/include/param.h (revision 2f5e95ec)
1*2f5e95ecStsutsui /*	$NetBSD: param.h,v 1.11 2007/03/04 10:02:42 tsutsui Exp $	*/
2a1099430Stsutsui 
3a1099430Stsutsui /*
4a1099430Stsutsui  * Copyright (c) 1982, 1986, 1990, 1993
5a1099430Stsutsui  *	The Regents of the University of California.  All rights reserved.
6a1099430Stsutsui  *
7a1099430Stsutsui  * This code is derived from software contributed to Berkeley by
8a1099430Stsutsui  * the Systems Programming Group of the University of Utah Computer
9a1099430Stsutsui  * Science Department.
10a1099430Stsutsui  *
11a1099430Stsutsui  * Redistribution and use in source and binary forms, with or without
12a1099430Stsutsui  * modification, are permitted provided that the following conditions
13a1099430Stsutsui  * are met:
14a1099430Stsutsui  * 1. Redistributions of source code must retain the above copyright
15a1099430Stsutsui  *    notice, this list of conditions and the following disclaimer.
16a1099430Stsutsui  * 2. Redistributions in binary form must reproduce the above copyright
17a1099430Stsutsui  *    notice, this list of conditions and the following disclaimer in the
18a1099430Stsutsui  *    documentation and/or other materials provided with the distribution.
19aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
20aad01611Sagc  *    may be used to endorse or promote products derived from this software
21aad01611Sagc  *    without specific prior written permission.
22aad01611Sagc  *
23aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33aad01611Sagc  * SUCH DAMAGE.
34aad01611Sagc  *
35aad01611Sagc  * from: Utah $Hdr: machparam.h 1.16 92/12/20$
36aad01611Sagc  *
37aad01611Sagc  *	@(#)param.h	8.1 (Berkeley) 6/10/93
38aad01611Sagc  */
39aad01611Sagc /*
40aad01611Sagc  * Copyright (c) 1988 University of Utah.
41aad01611Sagc  *
42aad01611Sagc  * This code is derived from software contributed to Berkeley by
43aad01611Sagc  * the Systems Programming Group of the University of Utah Computer
44aad01611Sagc  * Science Department.
45aad01611Sagc  *
46aad01611Sagc  * Redistribution and use in source and binary forms, with or without
47aad01611Sagc  * modification, are permitted provided that the following conditions
48aad01611Sagc  * are met:
49aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
50aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
51aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
52aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
53aad01611Sagc  *    documentation and/or other materials provided with the distribution.
54a1099430Stsutsui  * 3. All advertising materials mentioning features or use of this software
55a1099430Stsutsui  *    must display the following acknowledgement:
56a1099430Stsutsui  *	This product includes software developed by the University of
57a1099430Stsutsui  *	California, Berkeley and its contributors.
58a1099430Stsutsui  * 4. Neither the name of the University nor the names of its contributors
59a1099430Stsutsui  *    may be used to endorse or promote products derived from this software
60a1099430Stsutsui  *    without specific prior written permission.
61a1099430Stsutsui  *
62a1099430Stsutsui  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63a1099430Stsutsui  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64a1099430Stsutsui  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65a1099430Stsutsui  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66a1099430Stsutsui  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67a1099430Stsutsui  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68a1099430Stsutsui  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69a1099430Stsutsui  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70a1099430Stsutsui  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71a1099430Stsutsui  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72a1099430Stsutsui  * SUCH DAMAGE.
73a1099430Stsutsui  *
74a1099430Stsutsui  * from: Utah $Hdr: machparam.h 1.16 92/12/20$
75a1099430Stsutsui  *
76a1099430Stsutsui  *	@(#)param.h	8.1 (Berkeley) 6/10/93
77a1099430Stsutsui  */
78a1099430Stsutsui 
795fc2d9d9Stsutsui #ifndef	_NEWS68K_PARAM_H_
805fc2d9d9Stsutsui #define	_NEWS68K_PARAM_H_
81a1099430Stsutsui 
82a1099430Stsutsui /*
83a1099430Stsutsui  * Machine dependent constants for m68k NEWS.
84a1099430Stsutsui  */
85a1099430Stsutsui #define	_MACHINE	news68k
86a1099430Stsutsui #define	MACHINE		"news68k"
87a1099430Stsutsui 
88a1099430Stsutsui 
89a1099430Stsutsui #define	PGSHIFT		12		/* LOG2(NBPG) */
90a1099430Stsutsui #define	KERNBASE	0x00000000	/* start of kernel virtual */
91a1099430Stsutsui 
92a1099430Stsutsui #define	SEGSHIFT	22		/* LOG2(NBSEG) */
9363486740Schs #if defined(M68030) && !defined(M68040) && !defined(M68060)
94a1099430Stsutsui #define NBSEG		(1 << SEGSHIFT)	/* bytes/segment */
9563486740Schs #elif (defined(M68040) || defined(M68060)) && !defined(M68030)
9663486740Schs #define	NBSEG		(32 * (1 << PGSHIFT))
9763486740Schs #else
9863486740Schs #define	NBSEG		((mmutype == MMU_68040) ? \
9963486740Schs 				(32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT)))
10063486740Schs #endif
101a1099430Stsutsui #define	SEGOFSET	(NBSEG-1)	/* byte offset into segment */
102a1099430Stsutsui 
1037dc077e6Stsutsui #define	UPAGES		2		/* pages of u-area */
104a1099430Stsutsui 
105a1099430Stsutsui #include <m68k/param.h>
106a1099430Stsutsui 
107a1099430Stsutsui #define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
108a1099430Stsutsui 
109a1099430Stsutsui /*
110dded044fSthorpej  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
111dded044fSthorpej  * logical pages.
112a1099430Stsutsui  */
11396deb058Stsutsui #define	NKMEMPAGES_MIN_DEFAULT	((3 * 1024 * 1024) >> PAGE_SHIFT)
114dded044fSthorpej #define	NKMEMPAGES_MAX_DEFAULT	((4 * 1024 * 1024) >> PAGE_SHIFT)
115a1099430Stsutsui 
116a1099430Stsutsui #if defined(_KERNEL) && !defined(_LOCORE)
117*2f5e95ecStsutsui #include <machine/intr.h>
118*2f5e95ecStsutsui 
119a1099430Stsutsui #define	delay(us)	_delay((us) << 8)
120a1099430Stsutsui #define DELAY(us)	delay(us)
121a1099430Stsutsui 
1222cac3aaeStsutsui void	_delay(u_int);
123a1099430Stsutsui #endif /* _KERNEL && !_LOCORE */
124a1099430Stsutsui 
12567afbd62Smrg #if defined(_KERNEL_OPT)
126a1099430Stsutsui #include "opt_compat_hpux.h"
127a1099430Stsutsui #endif
128a1099430Stsutsui 
129a1099430Stsutsui #ifdef COMPAT_HPUX
130a1099430Stsutsui /*
131a1099430Stsutsui  * Constants/macros for HPUX multiple mapping of user address space.
132a1099430Stsutsui  * Pages in the first 256Mb are mapped in at every 256Mb segment.
133a1099430Stsutsui  */
134a1099430Stsutsui #define HPMMMASK	0xF0000000
135a1099430Stsutsui #define ISHPMMADDR(v) \
136a1099430Stsutsui 	((curproc->p_md.md_flags & MDP_HPUXMMAP) && \
137a1099430Stsutsui 	 ((unsigned)(v) & HPMMMASK) && \
138a1099430Stsutsui 	 ((unsigned)(v) & HPMMMASK) != HPMMMASK)
139a1099430Stsutsui #define HPMMBASEADDR(v) \
140a1099430Stsutsui 	((unsigned)(v) & ~HPMMMASK)
141a1099430Stsutsui #endif
142a1099430Stsutsui 
1435fc2d9d9Stsutsui #endif	/* !_NEWS68K_PARAM_H_ */
144