param.h revision 1.21 1 /* $NetBSD: param.h,v 1.21 2015/10/27 22:28:56 mrg Exp $ */
2
3 /* $OpenBSD: param.h,v 1.12 2001/07/06 02:07:41 provos Exp $ */
4
5 /*
6 * Copyright (c) 1988-1994, The University of Utah and
7 * the Computer Systems Laboratory at the University of Utah (CSL).
8 * All rights reserved.
9 *
10 * Permission to use, copy, modify and distribute this software is hereby
11 * granted provided that (1) source code retains these copyright, permission,
12 * and disclaimer notices, and (2) redistributions including binaries
13 * reproduce the notices in supporting documentation, and (3) all advertising
14 * materials mentioning features or use of this software display the following
15 * acknowledgement: ``This product includes software developed by the
16 * Computer Systems Laboratory at the University of Utah.''
17 *
18 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
19 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
20 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 *
22 * CSL requests users of this software to return to csl-dist (at) cs.utah.edu any
23 * improvements that they make and grant CSL redistribution rights.
24 *
25 * Utah $Hdr: param.h 1.18 94/12/16$
26 */
27
28 #ifdef _KERNEL
29 #include <machine/cpu.h>
30 #endif
31
32 /*
33 * Machine dependent constants for PA-RISC.
34 */
35
36 #define _MACHINE hppa
37 #define MACHINE "hppa"
38 #define _MACHINE_ARCH hppa
39 #define MACHINE_ARCH "hppa"
40 #define MID_MACHINE MID_HPPA
41
42 #define PGSHIFT 12 /* LOG2(NBPG) */
43 #define NBPG (1 << PGSHIFT) /* bytes/page */
44 #define PGOFSET (NBPG-1) /* byte offset into page */
45
46 #define SEGSHIFT (PGSHIFT + (PGSHIFT-PTESHIFT)) /* LOG2(NBSEG) */
47 #define NBSEG (1 << SEGSHIFT) /* bytes/segment (quadrant) */
48 #define SEGOFSET (NBSEG-1) /* byte offset into segment */
49
50 #define KERNBASE 0x00000000 /* start of kernel virtual */
51 #define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
52
53 #define DEV_BSIZE 512
54 #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
55 #define BLKDEV_IOSIZE 2048
56 #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
57
58 #define SSIZE (1) /* initial stack size/NBPG */
59 #define SINCR (1) /* increment of stack/NBPG */
60
61 #ifdef DIAGNOSTIC
62 #define UPAGES 5 /* pages of u-area + redzone */
63 #else
64 #define UPAGES 4 /* pages of u-area */
65 #endif
66 #define USPACE (UPAGES * NBPG) /* pages for user struct and kstack */
67
68 #ifndef MSGBUFSIZE
69 #define MSGBUFSIZE (2*NBPG) /* default message buffer size */
70 #endif
71
72 /*
73 * Constants related to network buffer management.
74 * MCLBYTES must be no larger than the software page size, and,
75 * on machines that exchange pages of input or output buffers with mbuf
76 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
77 * of the hardware page size.
78 */
79 #define MSIZE 256 /* size of an mbuf */
80 #define MCLSHIFT 11
81 #define MCLBYTES (1 << MCLSHIFT) /* large enough for ether MTU */
82 #define MCLOFSET (MCLBYTES - 1)
83
84 /*
85 * Size of kernel malloc arena in logical pages
86 */
87 #define NKMEMPAGES_MIN_DEFAULT ((16 * 1024 * 1024) >> PAGE_SHIFT)
88 #define NKMEMPAGES_MAX_DEFAULT ((256 * 1024 * 1024) >> PAGE_SHIFT)
89
90 /*
91 * Mach derived conversion macros
92 */
93
94 #define btop(x) ((unsigned long)(x) >> PGSHIFT)
95 #define ptob(x) ((unsigned long)(x) << PGSHIFT)
96