]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/Ipf/machine/param.h
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLib / Include / Ipf / machine / param.h
CommitLineData
2aa62f2b 1/* $NetBSD: param.h,v 1.2 2006/08/28 13:43:35 yamt Exp $ */\r
2\r
3/*-\r
4 * Copyright (c) 1990 The Regents of the University of California.\r
5 * All rights reserved.\r
6 *\r
7 * This code is derived from software contributed to Berkeley by\r
8 * William Jolitz.\r
9 *\r
10 * Redistribution and use in source and binary forms, with or without\r
11 * modification, are permitted provided that the following conditions\r
12 * are met:\r
13 * 1. Redistributions of source code must retain the above copyright\r
14 * notice, this list of conditions and the following disclaimer.\r
15 * 2. Redistributions in binary form must reproduce the above copyright\r
16 * notice, this list of conditions and the following disclaimer in the\r
17 * documentation and/or other materials provided with the distribution.\r
18 * 3. Neither the name of the University nor the names of its contributors\r
19 * may be used to endorse or promote products derived from this software\r
20 * without specific prior written permission.\r
21 *\r
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
32 * SUCH DAMAGE.\r
33 *\r
34 * @(#)param.h 5.8 (Berkeley) 6/28/91\r
35 */\r
36\r
37#ifndef _IA64_PARAM_H_\r
38#define _IA64_PARAM_H_\r
39\r
40/*\r
41 * Machine dependent constants for Intel Itanium.\r
42 */\r
43\r
44#define _MACHINE ia64\r
45#define MACHINE "ia64"\r
46#define _MACHINE_ARCH ia64\r
47#define MACHINE_ARCH "ia64"\r
48#define MID_MACHINE MID_IA64\r
49\r
50#ifdef SMP\r
51#define MAXCPU 16\r
52#else\r
53#define MAXCPU 1\r
54#endif\r
55\r
56#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */\r
57#define DEV_BSIZE (1<<DEV_BSHIFT)\r
58#define BLKDEV_IOSIZE 2048\r
59\r
60#ifndef MAXPHYS\r
61#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */\r
62#endif\r
63\r
64#define UPAGES 4\r
65#define USPACE (UPAGES * NBPG) /* total size of u-area */\r
66\r
67#ifndef MSGBUFSIZE\r
68#define MSGBUFSIZE NBPG /* default message buffer size */\r
69#endif\r
70\r
71#ifndef KSTACK_PAGES\r
72#define KSTACK_PAGES 4 /* pages of kernel stack */\r
73#endif\r
74#define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */\r
75\r
76/*\r
77 * Round p (pointer or byte index) up to a correctly-aligned value\r
78 * for all data types (int, long, ...). The result is u_int and\r
79 * must be cast to any desired pointer type.\r
80 *\r
81 * ALIGNED_POINTER is a boolean macro that checks whether an address\r
82 * is valid to fetch data elements of type t from on this architecture.\r
83 * This does not reflect the optimal alignment, just the possibility\r
84 * (within reasonable limits). \r
85 *\r
86 */\r
87\r
88#define ALIGNBYTES 15\r
89#define ALIGN(p) (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES)\r
90#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)\r
91\r
92#define ALIGNBYTES32 (sizeof(int) - 1)\r
93#define ALIGN32(p) (((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)\r
94\r
95#define PGSHIFT 14 /* LOG2(NBPG) */\r
96#define NBPG (1 << PGSHIFT) /* bytes/page */\r
97#define PGOFSET (NBPG-1) /* byte offset into page */\r
98#define NPTEPG (NBPG/(sizeof (pt_entry_t)))\r
99/*\r
100 * Constants related to network buffer management.\r
101 * MCLBYTES must be no larger than NBPG (the software page size), and,\r
102 * on machines that exchange pages of input or output buffers with mbuf\r
103 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple\r
104 * of the hardware page size.\r
105 */\r
106#define MSIZE 256 /* size of an mbuf */\r
107\r
108#ifndef MCLSHIFT\r
109#define MCLSHIFT 11 /* convert bytes to m_buf clusters */\r
110 /* 2K cluster can hold Ether frame */\r
111#endif /* MCLSHIFT */\r
112\r
113#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */\r
114\r
115#ifndef NMBCLUSTERS\r
116#if defined(_KERNEL_OPT)\r
117#include "opt_gateway.h"\r
118#endif\r
119\r
120#ifdef GATEWAY\r
121#define NMBCLUSTERS 2048 /* map size, max cluster allocation */\r
122#else\r
123#define NMBCLUSTERS 1024 /* map size, max cluster allocation */\r
124#endif\r
125#endif\r
126\r
127/*\r
128 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized\r
129 * logical pages.\r
130 */\r
131#define NKMEMPAGES_MIN_DEFAULT ((12 * 1024 * 1024) >> PAGE_SHIFT)\r
132#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)\r
133\r
134/*\r
135 * Mach derived conversion macros\r
136 */\r
137\r
138#define ia64_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG - 1))\r
139#define ia64_trunc_page(x) ((unsigned long)(x) & ~(NBPG - 1))\r
140 \r
141#define ia64_btop(x) ((unsigned long)(x) >> PGSHIFT)\r
142#define ia64_ptob(x) ((unsigned long)(x) << PGSHIFT) \r
143 \r
144#ifdef _KERNEL\r
145#ifndef _LOCORE\r
146\r
147#include <machine/intr.h>\r
148\r
149#endif /* _LOCORE */\r
150#endif /* _KERNEL */\r
151\r
152#endif /* _IA64_PARAM_H_ */\r