xref: /openbsd-src/sys/arch/m88k/include/param.h (revision 4c1e55dc91edd6e69ccc60ce855900fbc12cf34f)
1 /*	$OpenBSD: param.h,v 1.14 2011/09/08 03:40:32 guenther Exp $ */
2 /*
3  * Copyright (c) 1999 Steve Murphree, Jr.
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. Neither the name of the University nor the names of its contributors
21  *    may be used to endorse or promote products derived from this software
22  *    without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
37  *
38  *	@(#)param.h	7.8 (Berkeley) 6/28/91
39  */
40 #ifndef _M88K_PARAM_H_
41 #define _M88K_PARAM_H_
42 
43 #ifdef _KERNEL
44 #ifndef _LOCORE
45 #include <machine/cpu.h>
46 #endif	/* _LOCORE */
47 #endif
48 
49 #define  _MACHINE_ARCH  m88k
50 #define  MACHINE_ARCH   "m88k"
51 #define  MID_MACHINE    MID_M88K
52 
53 #define	ALIGNBYTES		_ALIGNBYTES
54 #define	ALIGN(p)		_ALIGN(p)
55 #define	ALIGNED_POINTER(p,t)	_ALIGNED_POINTER(p,t)
56 
57 #define NBPG		(1 << PGSHIFT)	/* bytes/page */
58 #define PGOFSET		(NBPG-1)	/* byte offset into page */
59 #define PGSHIFT		12		/* LOG2(NBPG) */
60 
61 #define	PAGE_SHIFT	12
62 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
63 #define	PAGE_MASK	(PAGE_SIZE - 1)
64 
65 #define NPTEPG		(PAGE_SIZE / (sizeof(pt_entry_t)))
66 
67 #define DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
68 #define DEV_BSIZE	(1 << DEV_BSHIFT)
69 #define BLKDEV_IOSIZE	2048
70 #define MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
71 
72 #define UPAGES		2		/* pages of u-area */
73 #define USPACE		(UPAGES * NBPG)
74 #define	USPACE_ALIGN	(0)		/* u-area alignment 0-none */
75 
76 /*
77  * Constants related to network buffer management.
78  */
79 #define NMBCLUSTERS	2048		/* map size, max cluster allocation */
80 
81 /*
82  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
83  * logical pages.
84  */
85 #define	NKMEMPAGES_MIN_DEFAULT	((4 * 1024 * 1024) >> PAGE_SHIFT)
86 #define	NKMEMPAGES_MAX_DEFAULT	((64 * 1024 * 1024) >> PAGE_SHIFT)
87 
88 #define MSGBUFSIZE	PAGE_SIZE
89 
90 /* pages ("clicks") to disk blocks */
91 #define ctod(x)			((x) << (PGSHIFT - DEV_BSHIFT))
92 #define dtoc(x)			((x) >> (PGSHIFT - DEV_BSHIFT))
93 
94 /* bytes to disk blocks */
95 #define btodb(x)		((x) >> DEV_BSHIFT)
96 #define dbtob(x)		((x) << DEV_BSHIFT)
97 
98 /*
99  * Get interrupt glue.
100  */
101 #include <machine/intr.h>
102 
103 #ifdef   _KERNEL
104 
105 #define  DELAY(x)             delay(x)
106 
107 #if !defined(_LOCORE)
108 extern void delay(int);
109 extern int cputyp;
110 #endif
111 
112 /*
113  * Values for the cputyp variable.
114  */
115 #define CPU_88100	0x00
116 #define CPU_88110	0x01
117 
118 #ifdef M88100
119 #ifdef M88110
120 #define	CPU_IS88100	(cputyp == CPU_88100)
121 #define	CPU_IS88110	(cputyp != CPU_88100)
122 #else
123 #define	CPU_IS88100	1
124 #define	CPU_IS88110	0
125 #endif
126 #else
127 #define	CPU_IS88100	0
128 #define	CPU_IS88110	1
129 #endif
130 
131 #endif	/* _KERNEL */
132 #endif	/* !_M88K_PARAM_H_ */
133