xref: /titanic_51/usr/src/uts/sun4u/sys/machparam.h (revision cb15d5d96b3b2730714c28bfe06cfe7421758b8c)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
525cf1a30Sjl139090  * Common Development and Distribution License (the "License").
625cf1a30Sjl139090  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
2223d9e5acSMichael Corcoran  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
267c478bd9Sstevel@tonic-gate /*	All Rights Reserved	*/
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef _SYS_MACHPARAM_H
297c478bd9Sstevel@tonic-gate #define	_SYS_MACHPARAM_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifndef _ASM
367c478bd9Sstevel@tonic-gate #define	ADDRESS_C(c)    c ## ul
377c478bd9Sstevel@tonic-gate #else   /* _ASM */
387c478bd9Sstevel@tonic-gate #define	ADDRESS_C(c)    (c)
397c478bd9Sstevel@tonic-gate #endif	/* _ASM */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * Machine dependent parameters and limits - sun4u version.
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate /*
467c478bd9Sstevel@tonic-gate  * Define the VAC symbol (etc.) if we could run on a machine
477c478bd9Sstevel@tonic-gate  * which has a Virtual Address Cache
487c478bd9Sstevel@tonic-gate  *
497c478bd9Sstevel@tonic-gate  * This stuff gotta go.
507c478bd9Sstevel@tonic-gate  */
517c478bd9Sstevel@tonic-gate #define	VAC			/* support virtual addressed caches */
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * The maximum possible number of UPA devices in a system.
557c478bd9Sstevel@tonic-gate  * MAX_UPA maybe defined in a platform's makefile.
567c478bd9Sstevel@tonic-gate  */
577c478bd9Sstevel@tonic-gate #ifdef	_STARFIRE
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * We have a 7 bit id space for UPA devices in Xfire
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #define	MAX_UPA			128
627c478bd9Sstevel@tonic-gate #else
637c478bd9Sstevel@tonic-gate #ifndef MAX_UPA
647c478bd9Sstevel@tonic-gate #define	MAX_UPA			32
657c478bd9Sstevel@tonic-gate #endif
667c478bd9Sstevel@tonic-gate #endif	/* _STARFIRE */
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /*
697c478bd9Sstevel@tonic-gate  * Maximum cpuid value that we support.  NCPU can be defined in a platform's
707c478bd9Sstevel@tonic-gate  * makefile.
717c478bd9Sstevel@tonic-gate  */
727c478bd9Sstevel@tonic-gate #if	(defined(_STARFIRE) && !defined(lint))
737c478bd9Sstevel@tonic-gate #define	NCPU	64
747c478bd9Sstevel@tonic-gate #else
757c478bd9Sstevel@tonic-gate #ifndef NCPU
767c478bd9Sstevel@tonic-gate #define	NCPU	32
777c478bd9Sstevel@tonic-gate #endif
787c478bd9Sstevel@tonic-gate #endif	/* _STARFIRE && !lint */
797c478bd9Sstevel@tonic-gate 
8023d9e5acSMichael Corcoran #if	(NCPU <= 1)
8123d9e5acSMichael Corcoran #define	NCPU_LOG2	0
8223d9e5acSMichael Corcoran #elif	(NCPU <= 2)
8323d9e5acSMichael Corcoran #define	NCPU_LOG2	1
8423d9e5acSMichael Corcoran #elif	(NCPU <= 4)
8523d9e5acSMichael Corcoran #define	NCPU_LOG2	2
8623d9e5acSMichael Corcoran #elif	(NCPU <= 8)
8723d9e5acSMichael Corcoran #define	NCPU_LOG2	3
8823d9e5acSMichael Corcoran #elif	(NCPU <= 16)
8923d9e5acSMichael Corcoran #define	NCPU_LOG2	4
9023d9e5acSMichael Corcoran #elif	(NCPU <= 32)
9123d9e5acSMichael Corcoran #define	NCPU_LOG2	5
9223d9e5acSMichael Corcoran #elif	(NCPU <= 64)
9323d9e5acSMichael Corcoran #define	NCPU_LOG2	6
9423d9e5acSMichael Corcoran #elif	(NCPU <= 128)
9523d9e5acSMichael Corcoran #define	NCPU_LOG2	7
9623d9e5acSMichael Corcoran #elif	(NCPU <= 256)
9723d9e5acSMichael Corcoran #define	NCPU_LOG2	8
9823d9e5acSMichael Corcoran #elif	(NCPU <= 512)
9923d9e5acSMichael Corcoran #define	NCPU_LOG2	9
10023d9e5acSMichael Corcoran #elif	(NCPU <= 1024)
10123d9e5acSMichael Corcoran #define	NCPU_LOG2	10
10223d9e5acSMichael Corcoran #else
10323d9e5acSMichael Corcoran #error	"add test for larger NCPU"
10423d9e5acSMichael Corcoran #endif
10523d9e5acSMichael Corcoran 
106*cb15d5d9SPeter Rival /* NCPU_P2 is NCPU rounded to a power of 2 */
107*cb15d5d9SPeter Rival #define	NCPU_P2	(1 << NCPU_LOG2)
108*cb15d5d9SPeter Rival 
1097c478bd9Sstevel@tonic-gate /*
1107c478bd9Sstevel@tonic-gate  * Maximum number of processors that we support.  With CMP processors, the
1117c478bd9Sstevel@tonic-gate  * portid may not be equal to cpuid.  MAX_CPU_CHIPID can be defined in a
1127c478bd9Sstevel@tonic-gate  * platform's makefile.
1137c478bd9Sstevel@tonic-gate  */
1147c478bd9Sstevel@tonic-gate #ifndef	MAX_CPU_CHIPID
1157c478bd9Sstevel@tonic-gate #define	MAX_CPU_CHIPID	NCPU
1167c478bd9Sstevel@tonic-gate #endif
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * Define the FPU symbol if we could run on a machine with an external
1207c478bd9Sstevel@tonic-gate  * FPU (i.e. not integrated with the normal machine state like the vax).
1217c478bd9Sstevel@tonic-gate  *
1227c478bd9Sstevel@tonic-gate  * The fpu is defined in the architecture manual, and the kernel hides
1237c478bd9Sstevel@tonic-gate  * its absence if it is not present, that's pretty integrated, no?
1247c478bd9Sstevel@tonic-gate  */
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
1277c478bd9Sstevel@tonic-gate  * MMU_PAGES* describes the physical page size used by the mapping hardware.
1287c478bd9Sstevel@tonic-gate  * PAGES* describes the logical page size used by the system.
1297c478bd9Sstevel@tonic-gate  */
1307c478bd9Sstevel@tonic-gate #define	MMU_PAGE_SIZES		6	/* max sun4u mmu-supported page sizes */
1317c478bd9Sstevel@tonic-gate #define	DEFAULT_MMU_PAGE_SIZES	4	/* default sun4u supported page sizes */
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate /*
1347c478bd9Sstevel@tonic-gate  * XXX make sure the MMU_PAGESHIFT definition here is
1357c478bd9Sstevel@tonic-gate  * consistent with the one in param.h
1367c478bd9Sstevel@tonic-gate  */
1377c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT		13
1387c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE		(1<<MMU_PAGESHIFT)
1397c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET		(MMU_PAGESIZE - 1)
1407c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK		(~MMU_PAGEOFFSET)
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT64K	16
1437c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE64K		(1 << MMU_PAGESHIFT64K)
1447c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET64K	(MMU_PAGESIZE64K - 1)
1457c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK64K		(~MMU_PAGEOFFSET64K)
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT512K	19
1487c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE512K	(1 << MMU_PAGESHIFT512K)
1497c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET512K	(MMU_PAGESIZE512K - 1)
1507c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK512K	(~MMU_PAGEOFFSET512K)
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT4M		22
1537c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE4M		(1 << MMU_PAGESHIFT4M)
1547c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET4M	(MMU_PAGESIZE4M - 1)
1557c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK4M		(~MMU_PAGEOFFSET4M)
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT32M	25
1587c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE32M		(1 << MMU_PAGESHIFT32M)
1597c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET32M	(MMU_PAGESIZE32M - 1)
1607c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK32M		(~MMU_PAGEOFFSET32M)
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate #define	MMU_PAGESHIFT256M	28
1637c478bd9Sstevel@tonic-gate #define	MMU_PAGESIZE256M	(1 << MMU_PAGESHIFT256M)
1647c478bd9Sstevel@tonic-gate #define	MMU_PAGEOFFSET256M	(MMU_PAGESIZE256M - 1)
1657c478bd9Sstevel@tonic-gate #define	MMU_PAGEMASK256M	(~MMU_PAGEOFFSET256M)
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate #define	PAGESHIFT	13
1687c478bd9Sstevel@tonic-gate #define	PAGESIZE	(1<<PAGESHIFT)
1697c478bd9Sstevel@tonic-gate #define	PAGEOFFSET	(PAGESIZE - 1)
1707c478bd9Sstevel@tonic-gate #define	PAGEMASK	(~PAGEOFFSET)
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate /*
1737c478bd9Sstevel@tonic-gate  * DATA_ALIGN is used to define the alignment of the Unix data segment.
1747c478bd9Sstevel@tonic-gate  */
1757c478bd9Sstevel@tonic-gate #define	DATA_ALIGN	ADDRESS_C(0x2000)
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate /*
1787c478bd9Sstevel@tonic-gate  * DEFAULT KERNEL THREAD stack size.
1797c478bd9Sstevel@tonic-gate  */
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #define	DEFAULTSTKSZ	(3*PAGESIZE)
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate /*
1847c478bd9Sstevel@tonic-gate  * DEFAULT initial thread stack size.
1857c478bd9Sstevel@tonic-gate  */
1867c478bd9Sstevel@tonic-gate #define	T0STKSZ		(2 * DEFAULTSTKSZ)
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate /*
1897c478bd9Sstevel@tonic-gate  * KERNELBASE is the virtual address which
1907c478bd9Sstevel@tonic-gate  * the kernel text/data mapping starts in all contexts.
1917c478bd9Sstevel@tonic-gate  */
1927c478bd9Sstevel@tonic-gate #define	KERNELBASE	ADDRESS_C(0x01000000)
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate /*
195ae115bc7Smrj  * Virtual address range available to the debugger
196ae115bc7Smrj  */
197ae115bc7Smrj #define	SEGDEBUGBASE	ADDRESS_C(0xedd00000)
198ae115bc7Smrj #define	SEGDEBUGSIZE	(ADDRESS_C(0xf0000000) - SEGDEBUGBASE)
199ae115bc7Smrj 
200ae115bc7Smrj /*
2017c478bd9Sstevel@tonic-gate  * Define the userlimits
2027c478bd9Sstevel@tonic-gate  */
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate #define	USERLIMIT	ADDRESS_C(0xFFFFFFFF80000000)
2057c478bd9Sstevel@tonic-gate #define	USERLIMIT32	ADDRESS_C(0xFFC00000)
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate /*
2087c478bd9Sstevel@tonic-gate  * Define SEGKPBASE, start of the segkp segment.
2097c478bd9Sstevel@tonic-gate  */
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate #define	SEGKPBASE	ADDRESS_C(0x2a100000000)
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate /*
2147c478bd9Sstevel@tonic-gate  * Define SEGMAPBASE, start of the segmap segment.
2157c478bd9Sstevel@tonic-gate  */
2167c478bd9Sstevel@tonic-gate 
2177c478bd9Sstevel@tonic-gate #define	SEGMAPBASE	ADDRESS_C(0x2a750000000)
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate /*
2207c478bd9Sstevel@tonic-gate  * SYSBASE is the virtual address which the kernel allocated memory
2217c478bd9Sstevel@tonic-gate  * mapping starts in all contexts.  SYSLIMIT is the end of the Sysbase segment.
2227c478bd9Sstevel@tonic-gate  */
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate #define	SYSBASE		ADDRESS_C(0x30000000000)
2257c478bd9Sstevel@tonic-gate #define	SYSLIMIT	ADDRESS_C(0x70000000000)
2267c478bd9Sstevel@tonic-gate #define	SYSBASE32	ADDRESS_C(0x70000000)
2277c478bd9Sstevel@tonic-gate #define	SYSLIMIT32	ADDRESS_C(0x80000000)
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate /*
230986fd29aSsetje  * BOOTTMPBASE is the base of a space that can be reclaimed
231986fd29aSsetje  * after the kernel takes over the machine.  It contains the
232986fd29aSsetje  * boot archive and memory allocated by krtld before kmem_alloc
233986fd29aSsetje  * is brought online.
234986fd29aSsetje  */
235986fd29aSsetje #define	BOOTTMPBASE	ADDRESS_C(0x4C000000)
236986fd29aSsetje 
237986fd29aSsetje /*
2387c478bd9Sstevel@tonic-gate  * MEMSCRUBBASE is the base virtual address for the memory scrubber
2397c478bd9Sstevel@tonic-gate  * to read large pages.  It MUST be 4MB page aligned.
2407c478bd9Sstevel@tonic-gate  */
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate #define	MEMSCRUBBASE	0x2a000000000
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate /*
2457c478bd9Sstevel@tonic-gate  * Define the kernel address space range allocated to Open Firmware
2467c478bd9Sstevel@tonic-gate  */
2477c478bd9Sstevel@tonic-gate #define	OFW_START_ADDR	0xf0000000
2487c478bd9Sstevel@tonic-gate #define	OFW_END_ADDR	0xffffffff
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate /*
2517c478bd9Sstevel@tonic-gate  * ARGSBASE is the base virtual address of the range which
2527c478bd9Sstevel@tonic-gate  * the kernel uses to map the arguments for exec.
2537c478bd9Sstevel@tonic-gate  */
2547c478bd9Sstevel@tonic-gate #define	ARGSBASE	(MEMSCRUBBASE - NCARGS)
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate /*
2577c478bd9Sstevel@tonic-gate  * PPMAPBASE is the base virtual address of the range which
2587c478bd9Sstevel@tonic-gate  * the kernel uses to quickly map pages for operations such
2597c478bd9Sstevel@tonic-gate  * as ppcopy, pagecopy, pagezero, and pagesum.
2607c478bd9Sstevel@tonic-gate  */
2617c478bd9Sstevel@tonic-gate #define	PPMAPSIZE	(512 * 1024)
2627c478bd9Sstevel@tonic-gate #define	PPMAPBASE	(ARGSBASE - PPMAPSIZE)
2637c478bd9Sstevel@tonic-gate 
2647c478bd9Sstevel@tonic-gate #define	MAXPP_SLOTS	ADDRESS_C(16)
2657c478bd9Sstevel@tonic-gate #define	PPMAP_FAST_SIZE	(MAXPP_SLOTS * PAGESIZE * NCPU)
2667c478bd9Sstevel@tonic-gate #define	PPMAP_FAST_BASE	(PPMAPBASE - PPMAP_FAST_SIZE)
2677c478bd9Sstevel@tonic-gate 
2687c478bd9Sstevel@tonic-gate /*
2697c478bd9Sstevel@tonic-gate  * PIOMAPBASE is the base virtual address at which programmable I/O registers
2707c478bd9Sstevel@tonic-gate  * are mapped.  This allows such memory -- which may induce side effects when
2717c478bd9Sstevel@tonic-gate  * read -- to be cordoned off from the system at-large.
2727c478bd9Sstevel@tonic-gate  */
2737c478bd9Sstevel@tonic-gate #define	PIOMAPSIZE	(1024 * 1024 * 1024 * (uintptr_t)5)
2747c478bd9Sstevel@tonic-gate #define	PIOMAPBASE	(PPMAP_FAST_BASE - PIOMAPSIZE)
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate /*
2777c478bd9Sstevel@tonic-gate  * Allocate space for kernel modules on nucleus pages
2787c478bd9Sstevel@tonic-gate  */
279986fd29aSsetje #define	MODDATA	1024 * 512
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate /*
2827c478bd9Sstevel@tonic-gate  * The heap has a region allocated from it specifically for module text that
2837c478bd9Sstevel@tonic-gate  * cannot fit on the nucleus page.  This region -- which starts at address
2847c478bd9Sstevel@tonic-gate  * HEAPTEXT_BASE and runs for HEAPTEXT_SIZE bytes -- has virtual holes
2857c478bd9Sstevel@tonic-gate  * punched in it: for every HEAPTEXT_MAPPED bytes of available virtual, there
2867c478bd9Sstevel@tonic-gate  * is a virtual hole of size HEAPTEXT_UNMAPPED bytes sitting beneath it.  This
2877c478bd9Sstevel@tonic-gate  * assures that any text address is within HEAPTEXT_MAPPED of an unmapped
2887c478bd9Sstevel@tonic-gate  * region.  The unmapped regions themselves are managed with the routines
2897c478bd9Sstevel@tonic-gate  * kobj_texthole_alloc() and kobj_texthole_free().
2907c478bd9Sstevel@tonic-gate  */
2917c478bd9Sstevel@tonic-gate #define	HEAPTEXT_SIZE		(128 * 1024 * 1024)	/* bytes */
2927c478bd9Sstevel@tonic-gate #define	HEAPTEXT_OVERSIZE	(64 * 1024 * 1024)	/* bytes */
2937c478bd9Sstevel@tonic-gate #define	HEAPTEXT_BASE		(SYSLIMIT32 - HEAPTEXT_SIZE)
2947c478bd9Sstevel@tonic-gate #define	HEAPTEXT_MAPPED		(2 * 1024 * 1024)
2957c478bd9Sstevel@tonic-gate #define	HEAPTEXT_UNMAPPED	(2 * 1024 * 1024)
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate #define	HEAPTEXT_NARENAS	\
2987c478bd9Sstevel@tonic-gate 	(HEAPTEXT_SIZE / (HEAPTEXT_MAPPED + HEAPTEXT_UNMAPPED) + 2)
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate /*
3017c478bd9Sstevel@tonic-gate  * Preallocate an area for setting up the user stack during
3027c478bd9Sstevel@tonic-gate  * the exec(). This way we have a faster allocator and also
3037c478bd9Sstevel@tonic-gate  * make sure the stack is always VAC aligned correctly. see
3047c478bd9Sstevel@tonic-gate  * get_arg_base() in startup.c.
3057c478bd9Sstevel@tonic-gate  */
3067c478bd9Sstevel@tonic-gate #define	ARG_SLOT_SIZE	(0x8000)
3077c478bd9Sstevel@tonic-gate #define	ARG_SLOT_SHIFT	(15)
3087c478bd9Sstevel@tonic-gate #define	N_ARG_SLOT	(0x80)
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate #define	NARG_BASE	(PIOMAPBASE - (ARG_SLOT_SIZE * N_ARG_SLOT))
3117c478bd9Sstevel@tonic-gate 
3127c478bd9Sstevel@tonic-gate /*
3137c478bd9Sstevel@tonic-gate  * ktextseg+kvalloc should not use space beyond KERNEL_LIMIT32.
3147c478bd9Sstevel@tonic-gate  */
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate /*
3177c478bd9Sstevel@tonic-gate  * For 64-bit kernels, rename KERNEL_LIMIT to KERNEL_LIMIT32 to more accurately
3187c478bd9Sstevel@tonic-gate  * reflect the fact that it's actually the limit for 32-bit kernel virtual
3197c478bd9Sstevel@tonic-gate  * addresses.
3207c478bd9Sstevel@tonic-gate  */
321986fd29aSsetje #define	KERNEL_LIMIT32	BOOTTMPBASE
3227c478bd9Sstevel@tonic-gate 
3237c478bd9Sstevel@tonic-gate #define	PFN_TO_BUSTYPE(pfn)	(((pfn) >> 19) & 0x1FF)
3247c478bd9Sstevel@tonic-gate #define	IO_BUSTYPE(pfn)	((PFN_TO_BUSTYPE(pfn) & 0x100) >> 8)
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate #ifdef	_STARFIRE
3277c478bd9Sstevel@tonic-gate #define	PFN_TO_UPAID(pfn)	BUSTYPE_TO_UPAID(PFN_TO_BUSTYPE(pfn))
3287c478bd9Sstevel@tonic-gate #else
3297c478bd9Sstevel@tonic-gate #define	PFN_TO_UPAID(pfn)	(((pfn) >> 20) & 0x1F)
3307c478bd9Sstevel@tonic-gate #endif	/* _STARFIRE */
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate /*
3337c478bd9Sstevel@tonic-gate  * Defines used for the ptl1_panic parameter, which is passed to the
3347c478bd9Sstevel@tonic-gate  * ptl1_panic assembly routine in %g1.  These #defines have string
3357c478bd9Sstevel@tonic-gate  * names defined in sun4u/os/mach_cpu_states.c which should be kept up to
3367c478bd9Sstevel@tonic-gate  * date if new #defines are added.
3377c478bd9Sstevel@tonic-gate  */
3387c478bd9Sstevel@tonic-gate #define	PTL1_BAD_DEBUG		0
3397c478bd9Sstevel@tonic-gate #define	PTL1_BAD_WTRAP		1
3407c478bd9Sstevel@tonic-gate #define	PTL1_BAD_KMISS		2
3417c478bd9Sstevel@tonic-gate #define	PTL1_BAD_KPROT_FAULT	3
3427c478bd9Sstevel@tonic-gate #define	PTL1_BAD_ISM		4
3437c478bd9Sstevel@tonic-gate #define	PTL1_BAD_MMUTRAP	5
3447c478bd9Sstevel@tonic-gate #define	PTL1_BAD_TRAP		6
3457c478bd9Sstevel@tonic-gate #define	PTL1_BAD_FPTRAP		7
346b0fc0e77Sgovinda #define	PTL1_BAD_INTR_VEC	8
3477c478bd9Sstevel@tonic-gate #define	PTL1_BAD_TRACE_PTR	9
3487c478bd9Sstevel@tonic-gate #define	PTL1_BAD_STACK		10
3497c478bd9Sstevel@tonic-gate #define	PTL1_BAD_DTRACE_FLAGS	11
3507c478bd9Sstevel@tonic-gate #define	PTL1_BAD_CTX_STEAL	12
3517c478bd9Sstevel@tonic-gate #define	PTL1_BAD_ECC		13
3528f230a59Sbs21162 #define	PTL1_BAD_CTX		14
3531e2e7a75Shuah #define	PTL1_BAD_RAISE_TSBEXCP	20
3541426d65aSsm142603 #define	PTL1_NO_SCDTSB8K	21
3557c478bd9Sstevel@tonic-gate 
3567c478bd9Sstevel@tonic-gate /*
3577c478bd9Sstevel@tonic-gate  * Defines used for ptl1 related data structs.
3587c478bd9Sstevel@tonic-gate  */
3597c478bd9Sstevel@tonic-gate #define	PTL1_MAXTL		4
3607c478bd9Sstevel@tonic-gate #define	PTL1_DEBUG_TRAP		0x7C
3617c478bd9Sstevel@tonic-gate #define	PTL1_SSIZE		1024	/* minimum stack size */
3627c478bd9Sstevel@tonic-gate #define	CPU_ALLOC_SIZE		MMU_PAGESIZE
3637c478bd9Sstevel@tonic-gate 
3647c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3657c478bd9Sstevel@tonic-gate }
3667c478bd9Sstevel@tonic-gate #endif
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate #endif	/* _SYS_MACHPARAM_H */
369