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