xref: /titanic_50/usr/src/uts/sun4v/io/fpc/fpc-impl-4v.h (revision 0ad689d678ef901f32945172f48ddc7b16dde50d)
1110e73f9Sschwartz /*
2110e73f9Sschwartz  * CDDL HEADER START
3110e73f9Sschwartz  *
4110e73f9Sschwartz  * The contents of this file are subject to the terms of the
5110e73f9Sschwartz  * Common Development and Distribution License (the "License").
6110e73f9Sschwartz  * You may not use this file except in compliance with the License.
7110e73f9Sschwartz  *
8110e73f9Sschwartz  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9110e73f9Sschwartz  * or http://www.opensolaris.org/os/licensing.
10110e73f9Sschwartz  * See the License for the specific language governing permissions
11110e73f9Sschwartz  * and limitations under the License.
12110e73f9Sschwartz  *
13110e73f9Sschwartz  * When distributing Covered Code, include this CDDL HEADER in each
14110e73f9Sschwartz  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15110e73f9Sschwartz  * If applicable, add the following below this CDDL HEADER, with the
16110e73f9Sschwartz  * fields enclosed by brackets "[]" replaced with your own identifying
17110e73f9Sschwartz  * information: Portions Copyright [yyyy] [name of copyright owner]
18110e73f9Sschwartz  *
19110e73f9Sschwartz  * CDDL HEADER END
20110e73f9Sschwartz  */
21110e73f9Sschwartz 
22110e73f9Sschwartz /*
23110e73f9Sschwartz  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24110e73f9Sschwartz  * Use is subject to license terms.
25110e73f9Sschwartz  */
26110e73f9Sschwartz 
27110e73f9Sschwartz #ifndef	_FPC_IMPL_4V_H
28110e73f9Sschwartz #define	_FPC_IMPL_4V_H
29110e73f9Sschwartz 
30110e73f9Sschwartz #pragma ident	"%Z%%M%	%I%	%E% SMI"
31110e73f9Sschwartz 
32110e73f9Sschwartz #ifdef	__cplusplus
33110e73f9Sschwartz extern "C" {
34110e73f9Sschwartz #endif
35110e73f9Sschwartz 
36*0ad689d6Sschwartz #ifndef _ASM
37*0ad689d6Sschwartz 
38110e73f9Sschwartz typedef uint64_t devhandle_t;
39110e73f9Sschwartz 
40110e73f9Sschwartz #define	DEVHDLE_MASK    0xFFFFFFF
41110e73f9Sschwartz 
42110e73f9Sschwartz extern int fpc_get_fire_perfreg(devhandle_t dev_hdl, int regid, uint64_t *data);
43110e73f9Sschwartz extern int fpc_set_fire_perfreg(devhandle_t dev_hdl, int regid, uint64_t data);
44110e73f9Sschwartz 
45*0ad689d6Sschwartz #endif /* _ASM */
46*0ad689d6Sschwartz 
47*0ad689d6Sschwartz 
48*0ad689d6Sschwartz /*
49*0ad689d6Sschwartz  * Fire performance counter fasttraps.
50*0ad689d6Sschwartz  *
51*0ad689d6Sschwartz  * These are in the HSVC_GROUP_FIRE_PERF hypervisor group of functionality.
52*0ad689d6Sschwartz  */
53*0ad689d6Sschwartz #define	FIRE_GET_PERFREG	0x120
54*0ad689d6Sschwartz #define	FIRE_SET_PERFREG	0x121
55*0ad689d6Sschwartz 
56*0ad689d6Sschwartz /*
57*0ad689d6Sschwartz  * Performance counter register definitions.
58*0ad689d6Sschwartz  */
59*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_JBC_SEL	0
60*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_JBC_CNT0	1
61*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_JBC_CNT1	2
62*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_IMU_SEL	3
63*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_IMU_CNT0	4
64*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_IMU_CNT1	5
65*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_MMU_SEL	6
66*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_MMU_CNT0	7
67*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_MMU_CNT1	8
68*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_TLU_SEL	9
69*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_TLU_CNT0	10
70*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_TLU_CNT1	11
71*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_TLU_CNT2	12
72*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_LNK_SEL	13
73*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_LNK_CNT1	14
74*0ad689d6Sschwartz #define	HVIO_FIRE_PERFREG_PCIE_LNK_CNT2	15
75*0ad689d6Sschwartz 
76110e73f9Sschwartz #ifdef	__cplusplus
77110e73f9Sschwartz }
78110e73f9Sschwartz #endif
79110e73f9Sschwartz 
80110e73f9Sschwartz #endif	/* _FPC_IMPL_4V_H */
81