1261287Sdes/* $FreeBSD$ */
2261287Sdes/* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */
3261287Sdes
4261287Sdes/*-
5261287Sdes * Copyright (c) 1988 University of Utah.
6261287Sdes * Copyright (c) 1992, 1993
7261287Sdes *	The Regents of the University of California.  All rights reserved.
8261287Sdes *
9261287Sdes * This code is derived from software contributed to Berkeley by
10261287Sdes * the Systems Programming Group of the University of Utah Computer
11261287Sdes * Science Department and Ralph Campbell.
12261287Sdes *
13261287Sdes * Redistribution and use in source and binary forms, with or without
14261287Sdes * modification, are permitted provided that the following conditions
15261287Sdes * are met:
16261287Sdes * 1. Redistributions of source code must retain the above copyright
17261287Sdes *    notice, this list of conditions and the following disclaimer.
18261287Sdes * 2. Redistributions in binary form must reproduce the above copyright
19261287Sdes *    notice, this list of conditions and the following disclaimer in the
20261287Sdes *    documentation and/or other materials provided with the distribution.
21261287Sdes * 4. Neither the name of the University nor the names of its contributors
22261287Sdes *    may be used to endorse or promote products derived from this software
23261287Sdes *    without specific prior written permission.
24261287Sdes *
25261287Sdes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26261287Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27261287Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28261287Sdes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29261287Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30261287Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31261287Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32261287Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33261287Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34261287Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35261287Sdes * SUCH DAMAGE.
36261287Sdes *
37261287Sdes * from: Utah $Hdr: machparam.h 1.11 89/08/14$
38261287Sdes *
39261287Sdes *	@(#)param.h	8.1 (Berkeley) 6/10/93
40261287Sdes */
41261287Sdes
42261287Sdes#ifndef _IA64_INCLUDE_PARAM_H_
43261287Sdes#define	_IA64_INCLUDE_PARAM_H_
44261287Sdes
45261287Sdes/*
46261287Sdes * Machine dependent constants for the IA64.
47261287Sdes */
48261287Sdes
49261287Sdes#include <machine/_align.h>
50261287Sdes
51261287Sdes#define __HAVE_ACPI
52261287Sdes#define __PCI_REROUTE_INTERRUPT
53261287Sdes
54261287Sdes#ifndef MACHINE
55261287Sdes#define	MACHINE		"ia64"
56261287Sdes#endif
57261287Sdes#ifndef MACHINE_ARCH
58261287Sdes#define	MACHINE_ARCH	"ia64"
59261287Sdes#endif
60261287Sdes#ifndef MACHINE_ARCH32
61261287Sdes#define	MACHINE_ARCH32	"i386"
62261287Sdes#endif
63261287Sdes
64261287Sdes#if defined(SMP) || defined(KLD_MODULE)
65261287Sdes#ifndef MAXCPU
66261287Sdes#define	MAXCPU		64
67261287Sdes#endif
68261287Sdes#else
69261287Sdes#define MAXCPU		1
70261287Sdes#endif
71261287Sdes
72261287Sdes#ifndef MAXMEMDOM
73261287Sdes#define	MAXMEMDOM	1
74261287Sdes#endif
75261287Sdes
76261287Sdes#define	ALIGNBYTES		_ALIGNBYTES
77261287Sdes#define	ALIGN(p)		_ALIGN(p)
78261287Sdes/*
79261287Sdes * ALIGNED_POINTER is a boolean macro that checks whether an address
80261287Sdes * is valid to fetch data elements of type t from on this architecture.
81261287Sdes * This does not reflect the optimal alignment, just the possibility
82261287Sdes * (within reasonable limits).
83261287Sdes */
84261287Sdes#define	ALIGNED_POINTER(p,t)	((((u_long)(p)) & (sizeof(t)-1)) == 0)
85261287Sdes
86261287Sdes/*
87261287Sdes * CACHE_LINE_SIZE is the compile-time maximum cache line size for an
88261287Sdes * architecture.  It should be used with appropriate caution.
89261287Sdes */
90261287Sdes#define	CACHE_LINE_SHIFT	7
91261287Sdes#define	CACHE_LINE_SIZE		(1 << CACHE_LINE_SHIFT)
92261287Sdes
93261287Sdes#ifndef LOG2_PAGE_SIZE
94261287Sdes#define	LOG2_PAGE_SIZE		13		/* 8K pages by default. */
95261287Sdes#endif
96261287Sdes#define	PAGE_SHIFT	(LOG2_PAGE_SIZE)
97261287Sdes#define	PAGE_SIZE	(1<<(LOG2_PAGE_SIZE))
98261287Sdes#define PAGE_MASK	(PAGE_SIZE-1)
99261287Sdes#define NPTEPG		(PAGE_SIZE/(sizeof (pt_entry_t)))
100261287Sdes
101261287Sdes#define	MAXPAGESIZES	1		/* maximum number of supported page sizes */
102261287Sdes
103261287Sdes#ifndef	KSTACK_PAGES
104261287Sdes#define	KSTACK_PAGES	4		/* pages of kernel stack */
105261287Sdes#endif
106261287Sdes#define	KSTACK_GUARD_PAGES 0		/* pages of kstack guard; 0 disables */
107261287Sdes
108261287Sdes/* The default size of identity mappings in region 6 & 7. */
109261287Sdes#ifndef LOG2_ID_PAGE_SIZE
110261287Sdes#define	LOG2_ID_PAGE_SIZE	16
111261287Sdes#endif
112261287Sdes
113261287Sdes/*
114261287Sdes * Mach derived conversion macros
115261287Sdes */
116261287Sdes#define	round_page(x)	((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
117261287Sdes#define	trunc_page(x)	((unsigned long)(x) & ~(PAGE_MASK))
118261287Sdes
119261287Sdes#define atop(x)			((unsigned long)(x) >> PAGE_SHIFT)
120261287Sdes#define ptoa(x)			((unsigned long)(x) << PAGE_SHIFT)
121261287Sdes
122261287Sdes#define pgtok(x)                ((x) * (PAGE_SIZE / 1024))
123261287Sdes
124261287Sdes#ifdef _KERNEL
125261287Sdes#define	NO_FUEWORD	1
126261287Sdes#endif
127261287Sdes
128261287Sdes#endif	/* !_IA64_INCLUDE_PARAM_H_ */
129261287Sdes