xref: /openbsd-src/sys/arch/hppa/include/param.h (revision 4c1e55dc91edd6e69ccc60ce855900fbc12cf34f)
1 /*	$OpenBSD: param.h,v 1.42 2012/06/26 16:18:14 deraadt Exp $	*/
2 
3 /*
4  * Copyright (c) 1988-1994, The University of Utah and
5  * the Computer Systems Laboratory at the University of Utah (CSL).
6  * All rights reserved.
7  *
8  * Permission to use, copy, modify and distribute this software is hereby
9  * granted provided that (1) source code retains these copyright, permission,
10  * and disclaimer notices, and (2) redistributions including binaries
11  * reproduce the notices in supporting documentation, and (3) all advertising
12  * materials mentioning features or use of this software display the following
13  * acknowledgement: ``This product includes software developed by the
14  * Computer Systems Laboratory at the University of Utah.''
15  *
16  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
17  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
18  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19  *
20  * CSL requests users of this software to return to csl-dist@cs.utah.edu any
21  * improvements that they make and grant CSL redistribution rights.
22  *
23  * 	Utah $Hdr: param.h 1.18 94/12/16$
24  */
25 
26 #ifdef _KERNEL
27 #include <machine/cpu.h>
28 #include <machine/intr.h>
29 #endif
30 
31 /*
32  * Machine dependent constants for PA-RISC.
33  */
34 
35 #define	_MACHINE	hppa
36 #define	MACHINE		"hppa"
37 #define	_MACHINE_ARCH	hppa
38 #define	MACHINE_ARCH	"hppa"
39 #define	MID_MACHINE	MID_HPUX800
40 
41 #define	ALIGNBYTES		_ALIGNBYTES
42 #define	ALIGN(p)		_ALIGN(p)
43 #define	ALIGNED_POINTER(p,t)	_ALIGNED_POINTER(p,t)
44 
45 #define	PAGE_SIZE	4096
46 #define	PAGE_MASK	(PAGE_SIZE-1)
47 #define	PAGE_SHIFT	12
48 
49 #define	NBPG		4096		/* bytes/page */
50 #define	PGOFSET		(NBPG-1)	/* byte offset into page */
51 #define	PGSHIFT		12		/* LOG2(NBPG) */
52 
53 #define	KERNBASE	0x00000000	/* start of kernel virtual */
54 
55 #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
56 #define	DEV_BSIZE	(1 << DEV_BSHIFT)
57 #define BLKDEV_IOSIZE	2048
58 #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
59 
60 #define	MACHINE_STACK_GROWS_UP	1	/* stack grows to higher addresses */
61 
62 #define	USPACE		(4 * NBPG)	/* pages for user struct and kstack */
63 #define	USPACE_ALIGN	(0)		/* u-area alignment 0-none */
64 
65 #ifndef	MSGBUFSIZE
66 #define	MSGBUFSIZE	2*NBPG		/* default message buffer size */
67 #endif
68 
69 /*
70  * Constants related to network buffer management.
71  */
72 #define	NMBCLUSTERS	4096		/* map size, max cluster allocation */
73 
74 /*
75  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
76  * logical pages.
77  */
78 #define	NKMEMPAGES_MIN_DEFAULT	((4 * 1024 * 1024) >> PAGE_SHIFT)
79 #define	NKMEMPAGES_MAX_DEFAULT	((128 * 1024 * 1024) >> PAGE_SHIFT)
80 
81 /* pages ("clicks") (4096 bytes) to disk blocks */
82 #define	ctod(x)		((x) << (PGSHIFT - DEV_BSHIFT))
83 #define	dtoc(x)		((x) >> (PGSHIFT - DEV_BSHIFT))
84 
85 #define	btodb(x)	((x) >> DEV_BSHIFT)
86 #define	dbtob(x)	((x) << DEV_BSHIFT)
87 
88 #define	__SWAP_BROKEN
89