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 5*a10abbb4Slm66018 * Common Development and Distribution License (the "License"). 6*a10abbb4Slm66018 * 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 /* 22*a10abbb4Slm66018 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_MACHINTREG_H 277c478bd9Sstevel@tonic-gate #define _SYS_MACHINTREG_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifdef __cplusplus 327c478bd9Sstevel@tonic-gate extern "C" { 337c478bd9Sstevel@tonic-gate #endif 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate /* 367c478bd9Sstevel@tonic-gate * IGN_SIZE can be defined in a platform's makefile. If it is not defined, 377c478bd9Sstevel@tonic-gate * use a default of 5. 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate #ifndef IGN_SIZE 407c478bd9Sstevel@tonic-gate #define IGN_SIZE 5 /* Interrupt Group Number bit size */ 417c478bd9Sstevel@tonic-gate #endif 427c478bd9Sstevel@tonic-gate #define UPAID_TO_IGN(upaid) (upaid) 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate /* 45*a10abbb4Slm66018 * MAXVINTRS is the number of interrupts we require to be allocated 46*a10abbb4Slm66018 * in the system intr_vec_table in addition to the hardware interrupts. 47*a10abbb4Slm66018 * These interrupts will be used by the sun4v cnex driver for its Logical 48*a10abbb4Slm66018 * Domain Channels. Each LDC requires a pair of interrupts, (RX/TX), 49*a10abbb4Slm66018 * and the total number of interrupts required will depend on the 50*a10abbb4Slm66018 * resources available to the system (CPUs, memory, etc) and how 51*a10abbb4Slm66018 * the system domains are configured, (number of virtual disks/networks 52*a10abbb4Slm66018 * per domain etc). 53*a10abbb4Slm66018 * 54*a10abbb4Slm66018 * The service domain requires (at least) a console LDC, Domain Services 55*a10abbb4Slm66018 * LDCs, vdisk LDC and vnet LDC per guest domain. It also requires a small 56*a10abbb4Slm66018 * number of LDCs for communications with the SP etc. 57*a10abbb4Slm66018 * 58*a10abbb4Slm66018 * The number of LDCs required is ~(N * 4 + a few more) where N is the 59*a10abbb4Slm66018 * possible maximum guest domains. The current possible maximum 60*a10abbb4Slm66018 * number of domains is 512, so we require ~2048 LDCs. And as 61*a10abbb4Slm66018 * each LDC requires a pair of interrupts we need to add the 62*a10abbb4Slm66018 * capacity for ~4096 interrupts to the system interrupt table. 63*a10abbb4Slm66018 * 64*a10abbb4Slm66018 * We start allocating the LDC interrupts at MINVINTR_COOKIE. 65*a10abbb4Slm66018 */ 66*a10abbb4Slm66018 #define MINVINTR_COOKIE (MAXDEVINTRS) 67*a10abbb4Slm66018 #define MAXVINTRS 4096 68*a10abbb4Slm66018 69*a10abbb4Slm66018 /* 707c478bd9Sstevel@tonic-gate * CPU_MONDO and DEV_MONDO registers 717c478bd9Sstevel@tonic-gate * for sun4v class of cpus probably should 727c478bd9Sstevel@tonic-gate * be moved to a new file 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate #define CPU_MONDO_Q_HD 0x3c0 757c478bd9Sstevel@tonic-gate #define CPU_MONDO_Q_TL 0x3c8 767c478bd9Sstevel@tonic-gate #define DEV_MONDO_Q_HD 0x3d0 777c478bd9Sstevel@tonic-gate #define DEV_MONDO_Q_TL 0x3d8 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate /* 807c478bd9Sstevel@tonic-gate * RESUMABLE_ERROR and NONRESUMABLE_ERROR registers 817c478bd9Sstevel@tonic-gate * for sun4v class of cpus 827c478bd9Sstevel@tonic-gate */ 837c478bd9Sstevel@tonic-gate #define CPU_RQ_HD 0x3e0 847c478bd9Sstevel@tonic-gate #define CPU_RQ_TL 0x3e8 857c478bd9Sstevel@tonic-gate #define CPU_NRQ_HD 0x3f0 867c478bd9Sstevel@tonic-gate #define CPU_NRQ_TL 0x3f8 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate #ifdef __cplusplus 897c478bd9Sstevel@tonic-gate } 907c478bd9Sstevel@tonic-gate #endif 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate #endif /* _SYS_MACHINTREG_H */ 93