/* * 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 * or http://www.opensolaris.org/os/licensing. * 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 2019 Peter Tribble. */ /* * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ #ifndef _SYS_MACHPARAM_H #define _SYS_MACHPARAM_H #ifdef __cplusplus extern "C" { #endif #ifndef _ASM #define ADDRESS_C(c) c ## ul #else /* _ASM */ #define ADDRESS_C(c) (c) #endif /* _ASM */ /* * Machine dependent parameters and limits - sun4u version. */ /* * Define the VAC symbol (etc.) if we could run on a machine * which has a Virtual Address Cache * * This stuff gotta go. */ #define VAC /* support virtual addressed caches */ /* * The maximum possible number of UPA devices in a system. * MAX_UPA maybe defined in a platform's makefile. */ #ifndef MAX_UPA #define MAX_UPA 32 #endif /* * Maximum cpuid value that we support. NCPU can be defined in a platform's * makefile. */ #ifndef NCPU #define NCPU 32 #endif #if (NCPU <= 1) #define NCPU_LOG2 0 #elif (NCPU <= 2) #define NCPU_LOG2 1 #elif (NCPU <= 4) #define NCPU_LOG2 2 #elif (NCPU <= 8) #define NCPU_LOG2 3 #elif (NCPU <= 16) #define NCPU_LOG2 4 #elif (NCPU <= 32) #define NCPU_LOG2 5 #elif (NCPU <= 64) #define NCPU_LOG2 6 #elif (NCPU <= 128) #define NCPU_LOG2 7 #elif (NCPU <= 256) #define NCPU_LOG2 8 #elif (NCPU <= 512) #define NCPU_LOG2 9 #elif (NCPU <= 1024) #define NCPU_LOG2 10 #else #error "add test for larger NCPU" #endif /* NCPU_P2 is NCPU rounded to a power of 2 */ #define NCPU_P2 (1 << NCPU_LOG2) /* * Maximum number of processors that we support. With CMP processors, the * portid may not be equal to cpuid. MAX_CPU_CHIPID can be defined in a * platform's makefile. */ #ifndef MAX_CPU_CHIPID #define MAX_CPU_CHIPID NCPU #endif /* * 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? */ /* * MMU_PAGES* describes the physical page size used by the mapping hardware. * PAGES* describes the logical page size used by the system. */ #define MMU_PAGE_SIZES 6 /* max sun4u mmu-supported page sizes */ #define DEFAULT_MMU_PAGE_SIZES 4 /* default sun4u supported page sizes */ /* * XXX make sure the MMU_PAGESHIFT definition here is * consistent with the one in param.h */ #define MMU_PAGESHIFT 13 #define MMU_PAGESIZE (1<> 19) & 0x1FF) #define IO_BUSTYPE(pfn) ((PFN_TO_BUSTYPE(pfn) & 0x100) >> 8) #define PFN_TO_UPAID(pfn) (((pfn) >> 20) & 0x1F) /* * Defines used for the ptl1_panic parameter, which is passed to the * ptl1_panic assembly routine in %g1. These #defines have string * names defined in sun4u/os/mach_cpu_states.c which should be kept up to * date if new #defines are added. */ #define PTL1_BAD_DEBUG 0 #define PTL1_BAD_WTRAP 1 #define PTL1_BAD_KMISS 2 #define PTL1_BAD_KPROT_FAULT 3 #define PTL1_BAD_ISM 4 #define PTL1_BAD_MMUTRAP 5 #define PTL1_BAD_TRAP 6 #define PTL1_BAD_FPTRAP 7 #define PTL1_BAD_INTR_VEC 8 #define PTL1_BAD_TRACE_PTR 9 #define PTL1_BAD_STACK 10 #define PTL1_BAD_DTRACE_FLAGS 11 #define PTL1_BAD_CTX_STEAL 12 #define PTL1_BAD_ECC 13 #define PTL1_BAD_CTX 14 #define PTL1_BAD_RAISE_TSBEXCP 20 #define PTL1_NO_SCDTSB8K 21 /* * Defines used for ptl1 related data structs. */ #define PTL1_MAXTL 4 #define PTL1_DEBUG_TRAP 0x7C #define PTL1_SSIZE 1024 /* minimum stack size */ #define CPU_ALLOC_SIZE MMU_PAGESIZE #ifdef __cplusplus } #endif #endif /* _SYS_MACHPARAM_H */