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