xref: /titanic_50/usr/src/uts/sun4v/sys/machintreg.h (revision bfed486ad8de8b8ebc6345a8e10accae08bf2f45)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_MACHINTREG_H
27 #define	_SYS_MACHINTREG_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * IGN_SIZE can be defined in a platform's makefile. If it is not defined,
37  * use a default of 5.
38  */
39 #ifndef IGN_SIZE
40 #define	IGN_SIZE	5		/* Interrupt Group Number bit size */
41 #endif
42 #define	UPAID_TO_IGN(upaid) (upaid)
43 
44 /*
45  * MAXVINTRS is the number of interrupts we require to be allocated
46  * in the system intr_vec_table in addition to the hardware interrupts.
47  * These interrupts will be used by the sun4v cnex driver for its Logical
48  * Domain Channels. Each LDC requires a pair of interrupts, (RX/TX),
49  * and the total number of interrupts required will depend on the
50  * resources available to the system (CPUs, memory, etc) and how
51  * the system domains are configured, (number of virtual disks/networks
52  * per domain etc).
53  *
54  * The service domain requires (at least) a console LDC, Domain Services
55  * LDCs, vdisk LDC and vnet LDC per guest domain. It also requires a small
56  * number of LDCs for communications with the SP etc.
57  *
58  * The number of LDCs required is ~(N * 4 + a few more) where N is the
59  * possible maximum guest domains. The current possible maximum
60  * number of domains is 512, so we require ~2048 LDCs. And as
61  * each LDC requires a pair of interrupts we need to add the
62  * capacity for ~4096 interrupts to the system interrupt table.
63  *
64  * We start allocating the LDC interrupts at MINVINTR_COOKIE.
65  */
66 #define	MINVINTR_COOKIE		(MAXDEVINTRS)
67 #define	MAXVINTRS		4096
68 
69 /*
70  * CPU_MONDO and DEV_MONDO  registers
71  * for sun4v class of cpus probably should
72  * be moved to a new file
73  */
74 #define	CPU_MONDO_Q_HD	0x3c0
75 #define	CPU_MONDO_Q_TL	0x3c8
76 #define	DEV_MONDO_Q_HD	0x3d0
77 #define	DEV_MONDO_Q_TL	0x3d8
78 
79 /*
80  * RESUMABLE_ERROR and NONRESUMABLE_ERROR registers
81  * for sun4v class of cpus
82  */
83 #define	CPU_RQ_HD		0x3e0
84 #define	CPU_RQ_TL		0x3e8
85 #define	CPU_NRQ_HD		0x3f0
86 #define	CPU_NRQ_TL		0x3f8
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _SYS_MACHINTREG_H */
93