]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/Ia32/machine/param.h
EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release.
[mirror_edk2.git] / StdLib / Include / Ia32 / machine / param.h
CommitLineData
d78fab6b 1/** @file\r
2 Machine dependent constants for Intel IA32 Architecture.\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.61 2006/08/28 13:43:35 yamt Exp\r
2aa62f2b 45 */\r
2aa62f2b 46#ifndef _I386_PARAM_H_\r
47#define _I386_PARAM_H_\r
48\r
d78fab6b 49#define _MACHINE i386\r
50#define MACHINE "i386"\r
51#define _MACHINE_ARCH i386\r
52#define MACHINE_ARCH "i386"\r
53#define MID_MACHINE MID_I386\r
2aa62f2b 54\r
55/*\r
56 * Round p (pointer or byte index) up to a correctly-aligned value\r
57 * for all data types (int, long, ...). The result is u_int and\r
58 * must be cast to any desired pointer type.\r
59 *\r
60 * ALIGNED_POINTER is a boolean macro that checks whether an address\r
61 * is valid to fetch data elements of type t from on this architecture.\r
62 * This does not reflect the optimal alignment, just the possibility\r
d78fab6b 63 * (within reasonable limits).\r
2aa62f2b 64 *\r
65 */\r
d78fab6b 66#define ALIGNBYTES (sizeof(int) - 1)\r
67#define ALIGN(p) (((EFI_ULONG_T)(p) + ALIGNBYTES) & ~ALIGNBYTES)\r
68#define ALIGNED_POINTER(p,t) 1\r
69\r
70#define PGSHIFT 12 /* LOG2(NBPG) */\r
71#define NBPG (1 << PGSHIFT) /* bytes/page */\r
72#define PGOFSET (NBPG-1) /* byte offset into page */\r
73#define NPTEPG (NBPG/(sizeof (pt_entry_t)))\r
74\r
75#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */\r
76#define DEV_BSIZE (1 << DEV_BSHIFT)\r
77#define BLKDEV_IOSIZE 2048\r
78#ifndef MAXPHYS\r
79 #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */\r
2aa62f2b 80#endif\r
81\r
d78fab6b 82#define SSIZE 1 /* initial stack size/NBPG */\r
83#define SINCR 1 /* increment of stack/NBPG */\r
2aa62f2b 84\r
2aa62f2b 85#ifndef UPAGES\r
d78fab6b 86 #ifdef NOREDZONE\r
87 #define UPAGES 2 /* pages of u-area */\r
88 #else\r
89 #define UPAGES 3\r
90 #endif /*NOREDZONE */\r
2aa62f2b 91#endif /* !defined(UPAGES) */\r
d78fab6b 92#define USPACE (UPAGES * NBPG) /* total size of u-area */\r
2aa62f2b 93\r
94#ifndef MSGBUFSIZE\r
d78fab6b 95 #define MSGBUFSIZE 4*NBPG /* default message buffer size */\r
2aa62f2b 96#endif\r
97\r
98/*\r
99 * Constants related to network buffer management.\r
100 * MCLBYTES must be no larger than NBPG (the software page size), and,\r
101 * on machines that exchange pages of input or output buffers with mbuf\r
102 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple\r
103 * of the hardware page size.\r
104 */\r
d78fab6b 105#define MSIZE 256 /* size of an mbuf */\r
2aa62f2b 106\r
107#ifndef MCLSHIFT\r
d78fab6b 108 #define MCLSHIFT 11 /* convert bytes to m_buf clusters */\r
109 /* 2K cluster can hold Ether frame */\r
110#endif /* MCLSHIFT */\r
2aa62f2b 111\r
d78fab6b 112#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */\r
2aa62f2b 113\r
114#ifndef NMBCLUSTERS\r
d78fab6b 115 #ifdef GATEWAY\r
116 #define NMBCLUSTERS 2048 /* map size, max cluster allocation */\r
117 #else\r
118 #define NMBCLUSTERS 1024 /* map size, max cluster allocation */\r
119 #endif\r
2aa62f2b 120#endif\r
121\r
122#ifndef NFS_RSIZE\r
d78fab6b 123 #define NFS_RSIZE 32768\r
2aa62f2b 124#endif\r
125#ifndef NFS_WSIZE\r
d78fab6b 126 #define NFS_WSIZE 32768\r
2aa62f2b 127#endif\r
128\r
129/*\r
130 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized\r
131 * logical pages.\r
132 */\r
d78fab6b 133#define NKMEMPAGES_MIN_DEFAULT ((8 * 1024 * 1024) >> PAGE_SHIFT)\r
134#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)\r
2aa62f2b 135\r
136/*\r
137 * Mach derived conversion macros\r
138 */\r
d78fab6b 139#define x86_round_pdr(x) ((((EFI_ULONG_T)(x)) + PDOFSET) & ~PDOFSET)\r
140#define x86_trunc_pdr(x) ((EFI_ULONG_T)(x) & ~PDOFSET)\r
141#define x86_btod(x) ((EFI_ULONG_T)(x) >> PDSHIFT)\r
142#define x86_dtob(x) ((EFI_ULONG_T)(x) << PDSHIFT)\r
143#define x86_round_page(x) ((((EFI_ULONG_T)(x)) + PGOFSET) & ~PGOFSET)\r
144#define x86_trunc_page(x) ((EFI_ULONG_T)(x) & ~PGOFSET)\r
145#define x86_btop(x) ((EFI_ULONG_T)(x) >> PGSHIFT)\r
146#define x86_ptob(x) ((EFI_ULONG_T)(x) << PGSHIFT)\r
2aa62f2b 147\r
148#endif /* _I386_PARAM_H_ */\r