xref: /openbsd/sys/arch/m88k/include/param.h (revision 569905a9)
1 /*	$OpenBSD: param.h,v 1.22 2023/12/14 13:26:49 claudio Exp $ */
2 
3 /*
4  * Copyright (c) 1999 Steve Murphree, Jr.
5  * Copyright (c) 1988 University of Utah.
6  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
7  * All rights reserved.
8  *
9  * This code is derived from software contributed to Berkeley by
10  * the Systems Programming Group of the University of Utah Computer
11  * Science Department.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  */
37 
38 #ifndef	_M88K_PARAM_H_
39 #define	_M88K_PARAM_H_
40 
41 #ifdef _KERNEL
42 #ifndef _LOCORE
43 #include <machine/cpu.h>
44 #endif	/* _LOCORE */
45 #endif
46 
47 #define	_MACHINE_ARCH  m88k
48 #define	MACHINE_ARCH   "m88k"
49 #define	MID_MACHINE    MID_M88K
50 
51 #define	PAGE_SHIFT	12
52 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
53 #define	PAGE_MASK	(PAGE_SIZE - 1)
54 
55 #define	NPTEPG		(PAGE_SIZE / (sizeof(pt_entry_t)))
56 
57 #ifdef _KERNEL
58 
59 #define	NBPG		PAGE_SIZE
60 #define	PGSHIFT		PAGE_SHIFT
61 #define	PGOFSET		PAGE_MASK
62 
63 #define	UPAGES		2			/* pages of u-area */
64 #define	USPACE		(UPAGES * PAGE_SIZE)	/* total size of u-area */
65 #define	USPACE_ALIGN	0			/* u-area alignment 0-none */
66 
67 #define	NMBCLUSTERS	(8 * 1024)		/* max cluster allocation */
68 
69 #ifndef MSGBUFSIZE
70 #define	MSGBUFSIZE	PAGE_SIZE
71 #endif
72 
73 /*
74  * Get interrupt glue.
75  */
76 #include <machine/intr.h>
77 
78 #define	DELAY(x)	delay(x)
79 
80 #if !defined(_LOCORE)
81 extern void delay(int);
82 extern int cputyp;
83 #endif
84 
85 /*
86  * Values for the cputyp variable.
87  */
88 #define CPU_88100	0x00
89 #define CPU_88110	0x01
90 
91 #ifdef M88100
92 #ifdef M88110
93 #define	CPU_IS88100	(cputyp == CPU_88100)
94 #define	CPU_IS88110	(cputyp != CPU_88100)
95 #else
96 #define	CPU_IS88100	1
97 #define	CPU_IS88110	0
98 #endif
99 #else
100 #define	CPU_IS88100	0
101 #define	CPU_IS88110	1
102 #endif
103 
104 #endif	/* _KERNEL */
105 
106 #endif /* _M88K_PARAM_H_ */
107