xref: /titanic_44/usr/src/uts/sun4v/io/iospc/rfios_acc.h (revision 4df55fde49134f9735f84011f23a767c75e393c7)
1*4df55fdeSJanie Lu /*
2*4df55fdeSJanie Lu  * CDDL HEADER START
3*4df55fdeSJanie Lu  *
4*4df55fdeSJanie Lu  * The contents of this file are subject to the terms of the
5*4df55fdeSJanie Lu  * Common Development and Distribution License (the "License").
6*4df55fdeSJanie Lu  * You may not use this file except in compliance with the License.
7*4df55fdeSJanie Lu  *
8*4df55fdeSJanie Lu  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4df55fdeSJanie Lu  * or http://www.opensolaris.org/os/licensing.
10*4df55fdeSJanie Lu  * See the License for the specific language governing permissions
11*4df55fdeSJanie Lu  * and limitations under the License.
12*4df55fdeSJanie Lu  *
13*4df55fdeSJanie Lu  * When distributing Covered Code, include this CDDL HEADER in each
14*4df55fdeSJanie Lu  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4df55fdeSJanie Lu  * If applicable, add the following below this CDDL HEADER, with the
16*4df55fdeSJanie Lu  * fields enclosed by brackets "[]" replaced with your own identifying
17*4df55fdeSJanie Lu  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4df55fdeSJanie Lu  *
19*4df55fdeSJanie Lu  * CDDL HEADER END
20*4df55fdeSJanie Lu  */
21*4df55fdeSJanie Lu 
22*4df55fdeSJanie Lu /*
23*4df55fdeSJanie Lu  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*4df55fdeSJanie Lu  * Use is subject to license terms.
25*4df55fdeSJanie Lu  */
26*4df55fdeSJanie Lu 
27*4df55fdeSJanie Lu #ifndef	_RFIOS_ACC_H
28*4df55fdeSJanie Lu #define	_RFIOS_ACC_H
29*4df55fdeSJanie Lu 
30*4df55fdeSJanie Lu /*
31*4df55fdeSJanie Lu  * Hypervisor and function definitions needed to access the device.
32*4df55fdeSJanie Lu  * Defined by FWARC 2008/613.
33*4df55fdeSJanie Lu  */
34*4df55fdeSJanie Lu 
35*4df55fdeSJanie Lu #ifdef	__cplusplus
36*4df55fdeSJanie Lu extern "C" {
37*4df55fdeSJanie Lu #endif
38*4df55fdeSJanie Lu 
39*4df55fdeSJanie Lu #ifndef _ASM
40*4df55fdeSJanie Lu 
41*4df55fdeSJanie Lu #include <sys/types.h>
42*4df55fdeSJanie Lu #include <sys/hypervisor_api.h>
43*4df55fdeSJanie Lu 
44*4df55fdeSJanie Lu typedef uint64_t cntr_handle_t;
45*4df55fdeSJanie Lu 
46*4df55fdeSJanie Lu extern int rfiospc_get_perfreg(cntr_handle_t handle, int regid, uint64_t *data);
47*4df55fdeSJanie Lu extern int rfiospc_set_perfreg(cntr_handle_t handle, int regid, uint64_t data);
48*4df55fdeSJanie Lu 
49*4df55fdeSJanie Lu #endif /* _ASM */
50*4df55fdeSJanie Lu 
51*4df55fdeSJanie Lu /*
52*4df55fdeSJanie Lu  * RF IOS API hypervisor group number.
53*4df55fdeSJanie Lu  */
54*4df55fdeSJanie Lu #define	RF_PERF_COUNTER_GROUP_ID	0x020a
55*4df55fdeSJanie Lu 
56*4df55fdeSJanie Lu /*
57*4df55fdeSJanie Lu  * RF IOS performance counter fasttraps.
58*4df55fdeSJanie Lu  */
59*4df55fdeSJanie Lu 
60*4df55fdeSJanie Lu #define	RFIOS_GET_PERFREG	0x165
61*4df55fdeSJanie Lu #define	RFIOS_SET_PERFREG	0x166
62*4df55fdeSJanie Lu 
63*4df55fdeSJanie Lu /*
64*4df55fdeSJanie Lu  * Performance counter register definitions.
65*4df55fdeSJanie Lu  */
66*4df55fdeSJanie Lu 
67*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEX_SEL	0
68*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEX_CNT0	1
69*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEX_CNT1	2
70*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_ATU_SEL	3
71*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_ATU_CNT0	4
72*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_ATU_CNT1	5
73*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_IMU_SEL	6
74*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_IMU_CNT0	7
75*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_IMU_CNT1	8
76*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_NPU_SEL	9
77*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_NPU_CNT0	10
78*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_NPU_CNT1	11
79*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU0_SEL	12
80*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU0_CNT0	13
81*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU0_CNT1	14
82*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU1_SEL	15
83*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU1_CNT0	16
84*4df55fdeSJanie Lu #define	HVIO_RFIOS_PERFREG_PEU1_CNT1	17
85*4df55fdeSJanie Lu 
86*4df55fdeSJanie Lu #ifdef	__cplusplus
87*4df55fdeSJanie Lu }
88*4df55fdeSJanie Lu #endif
89*4df55fdeSJanie Lu 
90*4df55fdeSJanie Lu #endif	/* _RFIOS_ACC_H */
91