xref: /titanic_41/usr/src/uts/sun4v/io/iospc/rfios_asm.s (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/*
28*4df55fdeSJanie Lu * Assembly language support for the iospc IO performance counter driver.
29*4df55fdeSJanie Lu */
30*4df55fdeSJanie Lu
31*4df55fdeSJanie Lu#include <sys/asm_linkage.h>
32*4df55fdeSJanie Lu#include <sys/hypervisor_api.h>
33*4df55fdeSJanie Lu#include "rfios_acc.h"
34*4df55fdeSJanie Lu
35*4df55fdeSJanie Lu/*LINTLIBRARY*/
36*4df55fdeSJanie Lu
37*4df55fdeSJanie Lu#if defined(lint)
38*4df55fdeSJanie Lu
39*4df55fdeSJanie Lu/*ARGSUSED*/
40*4df55fdeSJanie Luint
41*4df55fdeSJanie Lurfiospc_get_perfreg(cntr_handle_t handle, int regid, uint64_t *data)
42*4df55fdeSJanie Lu{ return (0); }
43*4df55fdeSJanie Lu
44*4df55fdeSJanie Lu/*ARGSUSED*/
45*4df55fdeSJanie Luint
46*4df55fdeSJanie Lurfiospc_set_perfreg(cntr_handle_t handle, int regid, uint64_t data)
47*4df55fdeSJanie Lu{ return (0); }
48*4df55fdeSJanie Lu
49*4df55fdeSJanie Lu#else /* lint */
50*4df55fdeSJanie Lu
51*4df55fdeSJanie Lu	ENTRY(rfiospc_get_perfreg)
52*4df55fdeSJanie Lu	mov	RFIOS_GET_PERFREG, %o5
53*4df55fdeSJanie Lu	ta	FAST_TRAP
54*4df55fdeSJanie Lu	brz,a	%o0, 1f
55*4df55fdeSJanie Lu	stx	%o1, [%o2]
56*4df55fdeSJanie Lu1:	retl
57*4df55fdeSJanie Lu	nop
58*4df55fdeSJanie Lu	SET_SIZE(rfiospc_get_perfreg)
59*4df55fdeSJanie Lu
60*4df55fdeSJanie Lu	ENTRY(rfiospc_set_perfreg)
61*4df55fdeSJanie Lu	mov	RFIOS_SET_PERFREG, %o5
62*4df55fdeSJanie Lu	ta	FAST_TRAP
63*4df55fdeSJanie Lu	retl
64*4df55fdeSJanie Lu	nop
65*4df55fdeSJanie Lu	SET_SIZE(rfiospc_set_perfreg)
66*4df55fdeSJanie Lu
67*4df55fdeSJanie Lu#endif
68