1*ea1a228cSschwartz/* 2*ea1a228cSschwartz * CDDL HEADER START 3*ea1a228cSschwartz * 4*ea1a228cSschwartz * The contents of this file are subject to the terms of the 5*ea1a228cSschwartz * Common Development and Distribution License (the "License"). 6*ea1a228cSschwartz * You may not use this file except in compliance with the License. 7*ea1a228cSschwartz * 8*ea1a228cSschwartz * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*ea1a228cSschwartz * or http://www.opensolaris.org/os/licensing. 10*ea1a228cSschwartz * See the License for the specific language governing permissions 11*ea1a228cSschwartz * and limitations under the License. 12*ea1a228cSschwartz * 13*ea1a228cSschwartz * When distributing Covered Code, include this CDDL HEADER in each 14*ea1a228cSschwartz * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*ea1a228cSschwartz * If applicable, add the following below this CDDL HEADER, with the 16*ea1a228cSschwartz * fields enclosed by brackets "[]" replaced with your own identifying 17*ea1a228cSschwartz * information: Portions Copyright [yyyy] [name of copyright owner] 18*ea1a228cSschwartz * 19*ea1a228cSschwartz * CDDL HEADER END 20*ea1a228cSschwartz */ 21*ea1a228cSschwartz 22*ea1a228cSschwartz/* 23*ea1a228cSschwartz * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*ea1a228cSschwartz * Use is subject to license terms. 25*ea1a228cSschwartz */ 26*ea1a228cSschwartz 27*ea1a228cSschwartz#pragma ident "%Z%%M% %I% %E% SMI" 28*ea1a228cSschwartz 29*ea1a228cSschwartz/* 30*ea1a228cSschwartz * Assembly language support for the n2piupc N2 PIU performance counter driver. 31*ea1a228cSschwartz */ 32*ea1a228cSschwartz 33*ea1a228cSschwartz#include <sys/asm_linkage.h> 34*ea1a228cSschwartz#include <sys/hypervisor_api.h> 35*ea1a228cSschwartz#include "n2piupc_acc.h" 36*ea1a228cSschwartz 37*ea1a228cSschwartz/*LINTLIBRARY*/ 38*ea1a228cSschwartz 39*ea1a228cSschwartz#if defined(lint) 40*ea1a228cSschwartz 41*ea1a228cSschwartz/*ARGSUSED*/ 42*ea1a228cSschwartzint 43*ea1a228cSschwartzn2piupc_get_perfreg(cntr_handle_t handle, int regid, uint64_t *data) 44*ea1a228cSschwartz{ return (0); } 45*ea1a228cSschwartz 46*ea1a228cSschwartz/*ARGSUSED*/ 47*ea1a228cSschwartzint 48*ea1a228cSschwartzn2piupc_set_perfreg(cntr_handle_t handle, int regid, uint64_t data) 49*ea1a228cSschwartz{ return (0); } 50*ea1a228cSschwartz 51*ea1a228cSschwartz#else /* lint */ 52*ea1a228cSschwartz 53*ea1a228cSschwartz ENTRY(n2piupc_get_perfreg) 54*ea1a228cSschwartz mov N2PIU_GET_PERFREG, %o5 55*ea1a228cSschwartz ta FAST_TRAP 56*ea1a228cSschwartz brz,a %o0, 1f 57*ea1a228cSschwartz stx %o1, [%o2] 58*ea1a228cSschwartz1: retl 59*ea1a228cSschwartz nop 60*ea1a228cSschwartz SET_SIZE(n2piupc_get_perfreg) 61*ea1a228cSschwartz 62*ea1a228cSschwartz ENTRY(n2piupc_set_perfreg) 63*ea1a228cSschwartz mov N2PIU_SET_PERFREG, %o5 64*ea1a228cSschwartz ta FAST_TRAP 65*ea1a228cSschwartz retl 66*ea1a228cSschwartz nop 67*ea1a228cSschwartz SET_SIZE(n2piupc_set_perfreg) 68*ea1a228cSschwartz 69*ea1a228cSschwartz#endif 70