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