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