param.h revision 1.9 1 1.9 scole /* $NetBSD: param.h,v 1.9 2017/04/08 18:03:33 scole Exp $ */
2 1.1 cherry
3 1.1 cherry /*-
4 1.1 cherry * Copyright (c) 1990 The Regents of the University of California.
5 1.1 cherry * All rights reserved.
6 1.1 cherry *
7 1.1 cherry * This code is derived from software contributed to Berkeley by
8 1.1 cherry * William Jolitz.
9 1.1 cherry *
10 1.1 cherry * Redistribution and use in source and binary forms, with or without
11 1.1 cherry * modification, are permitted provided that the following conditions
12 1.1 cherry * are met:
13 1.1 cherry * 1. Redistributions of source code must retain the above copyright
14 1.1 cherry * notice, this list of conditions and the following disclaimer.
15 1.1 cherry * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 cherry * notice, this list of conditions and the following disclaimer in the
17 1.1 cherry * documentation and/or other materials provided with the distribution.
18 1.1 cherry * 3. Neither the name of the University nor the names of its contributors
19 1.1 cherry * may be used to endorse or promote products derived from this software
20 1.1 cherry * without specific prior written permission.
21 1.1 cherry *
22 1.1 cherry * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.1 cherry * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 cherry * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 cherry * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.1 cherry * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1 cherry * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1 cherry * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1 cherry * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1 cherry * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1 cherry * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 cherry * SUCH DAMAGE.
33 1.1 cherry *
34 1.1 cherry * @(#)param.h 5.8 (Berkeley) 6/28/91
35 1.1 cherry */
36 1.1 cherry
37 1.1 cherry #ifndef _IA64_PARAM_H_
38 1.1 cherry #define _IA64_PARAM_H_
39 1.1 cherry
40 1.1 cherry /*
41 1.1 cherry * Machine dependent constants for Intel Itanium.
42 1.1 cherry */
43 1.1 cherry
44 1.5 chs #ifdef _KERNEL
45 1.5 chs #include <machine/cpu.h>
46 1.5 chs #endif
47 1.5 chs
48 1.1 cherry #define _MACHINE ia64
49 1.1 cherry #define MACHINE "ia64"
50 1.1 cherry #define _MACHINE_ARCH ia64
51 1.1 cherry #define MACHINE_ARCH "ia64"
52 1.1 cherry #define MID_MACHINE MID_IA64
53 1.1 cherry
54 1.5 chs #ifdef MULTIPROCESSOR
55 1.1 cherry #define MAXCPU 16
56 1.1 cherry #else
57 1.1 cherry #define MAXCPU 1
58 1.1 cherry #endif
59 1.1 cherry
60 1.1 cherry #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
61 1.1 cherry #define DEV_BSIZE (1<<DEV_BSHIFT)
62 1.1 cherry #define BLKDEV_IOSIZE 2048
63 1.1 cherry
64 1.1 cherry #ifndef MAXPHYS
65 1.1 cherry #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
66 1.1 cherry #endif
67 1.1 cherry
68 1.1 cherry #define UPAGES 4
69 1.1 cherry #define USPACE (UPAGES * NBPG) /* total size of u-area */
70 1.1 cherry
71 1.1 cherry #ifndef MSGBUFSIZE
72 1.1 cherry #define MSGBUFSIZE NBPG /* default message buffer size */
73 1.1 cherry #endif
74 1.1 cherry
75 1.1 cherry #ifndef KSTACK_PAGES
76 1.1 cherry #define KSTACK_PAGES 4 /* pages of kernel stack */
77 1.1 cherry #endif
78 1.1 cherry #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */
79 1.1 cherry
80 1.1 cherry #define ALIGNBYTES32 (sizeof(int) - 1)
81 1.1 cherry #define ALIGN32(p) (((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
82 1.1 cherry
83 1.9 scole #ifndef LOG2_PAGE_SIZE
84 1.9 scole #define LOG2_PAGE_SIZE 14 /* 16K pages by default. */
85 1.9 scole #endif
86 1.1 cherry #define PGSHIFT 14 /* LOG2(NBPG) */
87 1.1 cherry #define NBPG (1 << PGSHIFT) /* bytes/page */
88 1.1 cherry #define PGOFSET (NBPG-1) /* byte offset into page */
89 1.1 cherry #define NPTEPG (NBPG/(sizeof (pt_entry_t)))
90 1.1 cherry /*
91 1.1 cherry * Constants related to network buffer management.
92 1.1 cherry * MCLBYTES must be no larger than NBPG (the software page size), and,
93 1.1 cherry * on machines that exchange pages of input or output buffers with mbuf
94 1.1 cherry * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
95 1.1 cherry * of the hardware page size.
96 1.1 cherry */
97 1.1 cherry #define MSIZE 256 /* size of an mbuf */
98 1.1 cherry
99 1.1 cherry #ifndef MCLSHIFT
100 1.1 cherry #define MCLSHIFT 11 /* convert bytes to m_buf clusters */
101 1.1 cherry /* 2K cluster can hold Ether frame */
102 1.1 cherry #endif /* MCLSHIFT */
103 1.1 cherry
104 1.1 cherry #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
105 1.1 cherry
106 1.1 cherry /*
107 1.1 cherry * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
108 1.1 cherry * logical pages.
109 1.8 para * No enforced maxmimum an ia64
110 1.1 cherry */
111 1.8 para #define NKMEMPAGES_MIN_DEFAULT ((32 * 1024 * 1024) >> PAGE_SHIFT)
112 1.8 para #define NKMEMPAGES_MAX_UNLIMITED 1
113 1.1 cherry
114 1.9 scole /* The default size of identity mappings in region 6 & 7. */
115 1.9 scole #ifndef LOG2_ID_PAGE_SIZE
116 1.9 scole #define LOG2_ID_PAGE_SIZE 16
117 1.9 scole #endif
118 1.9 scole
119 1.1 cherry /*
120 1.1 cherry * Mach derived conversion macros
121 1.1 cherry */
122 1.1 cherry
123 1.1 cherry #define ia64_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG - 1))
124 1.1 cherry #define ia64_trunc_page(x) ((unsigned long)(x) & ~(NBPG - 1))
125 1.1 cherry
126 1.1 cherry #define ia64_btop(x) ((unsigned long)(x) >> PGSHIFT)
127 1.1 cherry #define ia64_ptob(x) ((unsigned long)(x) << PGSHIFT)
128 1.1 cherry
129 1.1 cherry #ifdef _KERNEL
130 1.1 cherry #ifndef _LOCORE
131 1.1 cherry
132 1.1 cherry #include <machine/intr.h>
133 1.1 cherry
134 1.3 kiyohara static __inline void delay(unsigned int us) {} /* XXXXX */
135 1.3 kiyohara
136 1.1 cherry #endif /* _LOCORE */
137 1.1 cherry #endif /* _KERNEL */
138 1.1 cherry
139 1.1 cherry #endif /* _IA64_PARAM_H_ */
140