xref: /illumos-gate/usr/src/uts/sun4v/io/iospc/rfios_acc.h (revision a61ed2ce7a86a4d6428f2a83eb4739fae945447e)
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 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_RFIOS_ACC_H
28 #define	_RFIOS_ACC_H
29 
30 /*
31  * Hypervisor and function definitions needed to access the device.
32  * Defined by FWARC 2008/613.
33  */
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #ifndef _ASM
40 
41 #include <sys/types.h>
42 #include <sys/hypervisor_api.h>
43 
44 typedef uint64_t cntr_handle_t;
45 
46 extern int rfiospc_get_perfreg(cntr_handle_t handle, int regid, uint64_t *data);
47 extern int rfiospc_set_perfreg(cntr_handle_t handle, int regid, uint64_t data);
48 
49 #endif /* _ASM */
50 
51 /*
52  * RF IOS API hypervisor group number.
53  */
54 #define	RF_PERF_COUNTER_GROUP_ID	0x020a
55 
56 /*
57  * RF IOS performance counter fasttraps.
58  */
59 
60 #define	RFIOS_GET_PERFREG	0x165
61 #define	RFIOS_SET_PERFREG	0x166
62 
63 /*
64  * Performance counter register definitions.
65  */
66 
67 #define	HVIO_RFIOS_PERFREG_PEX_SEL	0
68 #define	HVIO_RFIOS_PERFREG_PEX_CNT0	1
69 #define	HVIO_RFIOS_PERFREG_PEX_CNT1	2
70 #define	HVIO_RFIOS_PERFREG_ATU_SEL	3
71 #define	HVIO_RFIOS_PERFREG_ATU_CNT0	4
72 #define	HVIO_RFIOS_PERFREG_ATU_CNT1	5
73 #define	HVIO_RFIOS_PERFREG_IMU_SEL	6
74 #define	HVIO_RFIOS_PERFREG_IMU_CNT0	7
75 #define	HVIO_RFIOS_PERFREG_IMU_CNT1	8
76 #define	HVIO_RFIOS_PERFREG_NPU_SEL	9
77 #define	HVIO_RFIOS_PERFREG_NPU_CNT0	10
78 #define	HVIO_RFIOS_PERFREG_NPU_CNT1	11
79 #define	HVIO_RFIOS_PERFREG_PEU0_SEL	12
80 #define	HVIO_RFIOS_PERFREG_PEU0_CNT0	13
81 #define	HVIO_RFIOS_PERFREG_PEU0_CNT1	14
82 #define	HVIO_RFIOS_PERFREG_PEU1_SEL	15
83 #define	HVIO_RFIOS_PERFREG_PEU1_CNT0	16
84 #define	HVIO_RFIOS_PERFREG_PEU1_CNT1	17
85 
86 #ifdef	__cplusplus
87 }
88 #endif
89 
90 #endif	/* _RFIOS_ACC_H */
91