machparam.h revision bfa1c0bcb81a1b79aeda2ce1950b6218cfbd99f6
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _SYS_MACHPARAM_H
#define _SYS_MACHPARAM_H
#if !defined(_ASM)
#if defined(__xpv)
#include <sys/xpv_impl.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#else /* _ASM */
#define ADDRESS_C(c) (c)
#endif /* _ASM */
/*
* Machine dependent parameters and limits.
*/
#if defined(__amd64)
#define NCPU 256
#define NCPU 32
#endif
/*
* The value defined below could grow to 16. hat structure and
* page_t have room for 16 nodes.
*/
#define MAXNODES 4
#define NUMA_NODEMASK 0x0f
/*
* Define the FPU symbol if we could run on a machine with an external
* FPU (i.e. not integrated with the normal machine state like the vax).
*
* The fpu is defined in the architecture manual, and the kernel hides
* its absence if it is not present, that's pretty integrated, no?
*/
/* supported page sizes */
#define MMU_PAGE_SIZES 3
/*
* MMU_PAGES* describes the physical page size used by the mapping hardware.
* PAGES* describes the logical page size used by the system.
*/
#if !defined(_ASM)
#else /* _ASM */
#endif /* _ASM */
#define MMU_PAGEMASK (~MMU_PAGEOFFSET)
#define PAGESHIFT 12
#define PAGEMASK (~PAGEOFFSET)
/*
* DATA_ALIGN is used to define the alignment of the Unix data segment.
*/
#define DATA_ALIGN PAGESIZE
/*
* DEFAULT KERNEL THREAD stack size (in pages).
*/
#if defined(__amd64)
#define DEFAULTSTKSZ_NPGS 5
#define DEFAULTSTKSZ_NPGS 3
#endif
#if !defined(_ASM)
#else /* !_ASM */
#endif /* !_ASM */
/*
* KERNELBASE is the virtual address at which the kernel segments start in
* all contexts.
*
* KERNELBASE is not fixed. The value of KERNELBASE can change with
* installed memory or on 32 bit systems the eprom variable 'eprom_kernelbase'.
*
* This value is save in the variable _kernelbase. _kernelbase may then be
*
* Most code should be using kernelbase, which resolves to a reference to
* _kernelbase.
*/
#ifdef __i386
/*
* We don't use HYPERVISOR_VIRT_START, as we need both the PAE and non-PAE
* versions in our code. We always compile based on the lower PAE address.
*/
#define KERNEL_TEXT_i386_xpv \
#endif /* __i386 */
#if defined(__amd64)
/*
* Size of the unmapped "red zone" at the very bottom of the kernel's
* address space. Corresponds to 1 slot in the toplevel pagetable.
*/
/*
* that must be within a 2GB range to allow for rip-relative addressing.
*/
/*
* Beginning of the segkpm window. A lower value than this is used if
*/
/*
* This is valloc_base, above seg_kpm, but below everything else.
* A lower value than this may be used if SEGKPM_BASE is adjusted.
*/
/*
* default and boundary sizes for segkp
*/
/*
* minimum size for segzio
*/
/*
* During intial boot we limit heap to the top 4Gig.
*/
/*
* VMWare works best if we don't use the top 64Meg of memory for amd64.
* Set KERNEL_TEXT to top_o_memory - 64Meg - 8 Meg for 8Meg of nucleus pages.
*/
#define KERNEL_TEXT KERNEL_TEXT_amd64
/*
* Virtual address range available to the debugger
*/
/*
* Define upper limit on user address space
*
* In amd64, the upper limit on a 64-bit user address space is 1 large page
* (2MB) below kernelbase. The upper limit for a 32-bit user address space
* is 1 small page (4KB) below the top of the 32-bit range. The 64-bit
* limit give dtrace the red zone it needs below kernelbase. The 32-bit
* limit gives us a small red zone to detect address-space overruns in a
* user program.
*
* On the hypervisor, we limit the user to memory below the VA hole.
* Subtract 1 large page for a red zone.
*/
#if defined(__xpv)
#else
#endif
#ifdef bug_5074717_is_fixed
#else
#endif
#ifdef DEBUG
#else
#endif
/*
* The i386 ABI requires that the user address space be at least 3Gb
* in size. KERNELBASE_ABI_MIN is used as the default KERNELBASE for
* physical memory configurations > 4gb.
*/
/*
* Size of the unmapped "red zone" at the very bottom of the kernel's
* address space. Since segmap start immediately above the red zone, this
* needs to be MAXBSIZE aligned.
*/
#define KERNEL_REDZONE_SIZE MAXBSIZE
/*
* This is the last 4MB of the 4G address space. Some psm modules
* need this region of virtual address space mapped 1-1
* The top 64MB of the address space is reserved for the hypervisor.
*/
#ifdef __xpv
#define KERNEL_TEXT KERNEL_TEXT_i386_xpv
#else
#define KERNEL_TEXT KERNEL_TEXT_i386
#endif
/*
* Virtual address range available to the debugger
* We place it just above the kernel text (4M) and kernel data (4M).
*/
/*
* Define upper limit on user address space
*/
#define USERLIMIT KERNELBASE
#define USERLIMIT32 USERLIMIT
#endif /* __i386 */
/*
* Reserve pages just below KERNEL_TEXT for the GDT, IDT, TSS and debug info.
*
* For now, DEBUG_INFO_VA must be first in this list for "xm" initiated dumps
* of solaris domUs to be usable with mdb. Relying on a fixed VA is not viable
* long term, but it's the best we've got for now.
*/
#if !defined(_ASM)
#define MISC_VA_BASE (DFTSS_VA)
#endif /* !_ASM */
#endif
/*
* ARGSBASE is the base virtual address of the range which
* the kernel uses to map the arguments for exec.
*/
/*
* reserve space for modules
*/
/*
* The heap has a region allocated from it of HEAPTEXT_SIZE bytes specifically
* for module text.
*/
/*
* Size of a kernel threads stack. It must be a whole number of pages
* since the segment it comes from will only allocate space in pages.
*/
/*
* Size of a cpu startup thread stack. (It must be a whole number of pages
* since the containing segment only allocates space in pages.)
*/
/*
* Bus types
*/
#define BTISA 1
#define BTEISA 2
#define BTMCA 3
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MACHPARAM_H */