xref: /titanic_53/usr/src/uts/sun4v/ml/hcall.s (revision 3b890a5b92df88d9d90b2d7ac57e8c1e93e59e6a)
17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
544bb982bSgovinda * Common Development and Distribution License (the "License").
644bb982bSgovinda * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
211ae08745Sheppo
227c478bd9Sstevel@tonic-gate/*
2344bb982bSgovinda * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate */
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gate/*
307c478bd9Sstevel@tonic-gate * Hypervisor calls
317c478bd9Sstevel@tonic-gate */
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h>
347c478bd9Sstevel@tonic-gate#include <sys/machasi.h>
357c478bd9Sstevel@tonic-gate#include <sys/machparam.h>
367c478bd9Sstevel@tonic-gate#include <sys/hypervisor_api.h>
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate#if defined(lint) || defined(__lint)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate/*ARGSUSED*/
411ae08745Sheppouint64_t
421ae08745Sheppohv_mach_exit(uint64_t exit_code)
431ae08745Sheppo{ return (0); }
441ae08745Sheppo
451ae08745Sheppouint64_t
461ae08745Sheppohv_mach_sir(void)
471ae08745Sheppo{ return (0); }
481ae08745Sheppo
491ae08745Sheppo/*ARGSUSED*/
501ae08745Sheppouint64_t
511ae08745Sheppohv_cpu_start(uint64_t cpuid, uint64_t pc, uint64_t rtba, uint64_t arg)
521ae08745Sheppo{ return (0); }
531ae08745Sheppo
541ae08745Sheppo/*ARGSUSED*/
551ae08745Sheppouint64_t
561ae08745Sheppohv_cpu_stop(uint64_t cpuid)
571ae08745Sheppo{ return (0); }
581ae08745Sheppo
591ae08745Sheppo/*ARGSUSED*/
601ae08745Sheppouint64_t
611ae08745Sheppohv_cpu_set_rtba(uint64_t *rtba)
621ae08745Sheppo{ return (0); }
631ae08745Sheppo
641ae08745Sheppo/*ARGSUSED*/
657c478bd9Sstevel@tonic-gateint64_t
667c478bd9Sstevel@tonic-gatehv_cnputchar(uint8_t ch)
677c478bd9Sstevel@tonic-gate{ return (0); }
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gate/*ARGSUSED*/
707c478bd9Sstevel@tonic-gateint64_t
717c478bd9Sstevel@tonic-gatehv_cngetchar(uint8_t *ch)
727c478bd9Sstevel@tonic-gate{ return (0); }
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate/*ARGSUSED*/
757c478bd9Sstevel@tonic-gateuint64_t
767c478bd9Sstevel@tonic-gatehv_tod_get(uint64_t *seconds)
777c478bd9Sstevel@tonic-gate{ return (0); }
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate/*ARGSUSED*/
807c478bd9Sstevel@tonic-gateuint64_t
817c478bd9Sstevel@tonic-gatehv_tod_set(uint64_t seconds)
827c478bd9Sstevel@tonic-gate{ return (0);}
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate/*ARGSUSED*/
857c478bd9Sstevel@tonic-gateuint64_t
867c478bd9Sstevel@tonic-gatehv_mmu_map_perm_addr(void *vaddr, int ctx, uint64_t tte, int flags)
877c478bd9Sstevel@tonic-gate{ return (0); }
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gate/*ARGSUSED */
907c478bd9Sstevel@tonic-gateuint64_t
911ae08745Sheppohv_mmu_fault_area_conf(void *raddr)
921ae08745Sheppo{ return (0); }
931ae08745Sheppo
941ae08745Sheppo/*ARGSUSED*/
951ae08745Sheppouint64_t
967c478bd9Sstevel@tonic-gatehv_mmu_unmap_perm_addr(void *vaddr, int ctx, int flags)
977c478bd9Sstevel@tonic-gate{ return (0); }
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1007c478bd9Sstevel@tonic-gateuint64_t
1017c478bd9Sstevel@tonic-gatehv_set_ctx0(uint64_t ntsb_descriptor, uint64_t desc_ra)
1027c478bd9Sstevel@tonic-gate{ return (0); }
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1057c478bd9Sstevel@tonic-gateuint64_t
1067c478bd9Sstevel@tonic-gatehv_set_ctxnon0(uint64_t ntsb_descriptor, uint64_t desc_ra)
1077c478bd9Sstevel@tonic-gate{ return (0); }
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate#ifdef SET_MMU_STATS
1107c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1117c478bd9Sstevel@tonic-gateuint64_t
1127c478bd9Sstevel@tonic-gatehv_mmu_set_stat_area(uint64_t rstatarea, uint64_t size)
1137c478bd9Sstevel@tonic-gate{ return (0); }
1147c478bd9Sstevel@tonic-gate#endif /* SET_MMU_STATS */
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1177c478bd9Sstevel@tonic-gateuint64_t
1187c478bd9Sstevel@tonic-gatehv_cpu_qconf(int queue, uint64_t paddr, int size)
1197c478bd9Sstevel@tonic-gate{ return (0); }
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1227c478bd9Sstevel@tonic-gateuint64_t
1237c478bd9Sstevel@tonic-gatehvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, uint64_t *sysino)
1247c478bd9Sstevel@tonic-gate{ return (0); }
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1277c478bd9Sstevel@tonic-gateuint64_t
1287c478bd9Sstevel@tonic-gatehvio_intr_getvalid(uint64_t sysino, int *intr_valid_state)
1297c478bd9Sstevel@tonic-gate{ return (0); }
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1327c478bd9Sstevel@tonic-gateuint64_t
1337c478bd9Sstevel@tonic-gatehvio_intr_setvalid(uint64_t sysino, int intr_valid_state)
1347c478bd9Sstevel@tonic-gate{ return (0); }
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1377c478bd9Sstevel@tonic-gateuint64_t
1387c478bd9Sstevel@tonic-gatehvio_intr_getstate(uint64_t sysino, int *intr_state)
1397c478bd9Sstevel@tonic-gate{ return (0); }
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1427c478bd9Sstevel@tonic-gateuint64_t
1437c478bd9Sstevel@tonic-gatehvio_intr_setstate(uint64_t sysino, int intr_state)
1447c478bd9Sstevel@tonic-gate{ return (0); }
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1477c478bd9Sstevel@tonic-gateuint64_t
1487c478bd9Sstevel@tonic-gatehvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid)
1497c478bd9Sstevel@tonic-gate{ return (0); }
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1527c478bd9Sstevel@tonic-gateuint64_t
1537c478bd9Sstevel@tonic-gatehvio_intr_settarget(uint64_t sysino, uint32_t cpuid)
1547c478bd9Sstevel@tonic-gate{ return (0); }
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gateuint64_t
1577c478bd9Sstevel@tonic-gatehv_cpu_yield(void)
1587c478bd9Sstevel@tonic-gate{ return (0); }
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1617c478bd9Sstevel@tonic-gateuint64_t
1627c478bd9Sstevel@tonic-gatehv_cpu_state(uint64_t cpuid, uint64_t *cpu_state)
1637c478bd9Sstevel@tonic-gate{ return (0); }
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1667c478bd9Sstevel@tonic-gateuint64_t
1677c478bd9Sstevel@tonic-gatehv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *minsize)
1687c478bd9Sstevel@tonic-gate{ return (0); }
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1717c478bd9Sstevel@tonic-gateuint64_t
1727c478bd9Sstevel@tonic-gatehv_mem_scrub(uint64_t real_addr, uint64_t length, uint64_t *scrubbed_len)
1737c478bd9Sstevel@tonic-gate{ return (0); }
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1767c478bd9Sstevel@tonic-gateuint64_t
1777c478bd9Sstevel@tonic-gatehv_mem_sync(uint64_t real_addr, uint64_t length, uint64_t *flushed_len)
1787c478bd9Sstevel@tonic-gate{ return (0); }
1797c478bd9Sstevel@tonic-gate
1807c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1817c478bd9Sstevel@tonic-gateuint64_t
1827c478bd9Sstevel@tonic-gatehv_ttrace_buf_conf(uint64_t paddr, uint64_t size, uint64_t *size1)
1837c478bd9Sstevel@tonic-gate{ return (0); }
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1867c478bd9Sstevel@tonic-gateuint64_t
1877c478bd9Sstevel@tonic-gatehv_ttrace_buf_info(uint64_t *paddr, uint64_t *size)
1887c478bd9Sstevel@tonic-gate{ return (0); }
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1917c478bd9Sstevel@tonic-gateuint64_t
1927c478bd9Sstevel@tonic-gatehv_ttrace_enable(uint64_t enable, uint64_t *prev_enable)
1937c478bd9Sstevel@tonic-gate{ return (0); }
1947c478bd9Sstevel@tonic-gate
1957c478bd9Sstevel@tonic-gate/*ARGSUSED*/
1967c478bd9Sstevel@tonic-gateuint64_t
1977c478bd9Sstevel@tonic-gatehv_ttrace_freeze(uint64_t freeze, uint64_t *prev_freeze)
1987c478bd9Sstevel@tonic-gate{ return (0); }
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gate/*ARGSUSED*/
2017c478bd9Sstevel@tonic-gateuint64_t
2027c478bd9Sstevel@tonic-gatehv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep)
2037c478bd9Sstevel@tonic-gate{ return (0); }
2047c478bd9Sstevel@tonic-gate
2057c478bd9Sstevel@tonic-gate/*ARGSUSED*/
2067c478bd9Sstevel@tonic-gateuint64_t
20769cd775fSschwartzhv_ra2pa(uint64_t ra)
20869cd775fSschwartz{ return (0); }
20969cd775fSschwartz
21069cd775fSschwartz/*ARGSUSED*/
21169cd775fSschwartzuint64_t
21269cd775fSschwartzhv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
21369cd775fSschwartz{ return (0); }
21469cd775fSschwartz
2151ae08745Sheppo/*ARGSUSED*/
2161ae08745Sheppouint64_t
2171ae08745Sheppohv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
2181ae08745Sheppo{ return (0); }
2191ae08745Sheppo
2201ae08745Sheppo/*ARGSUSED*/
2211ae08745Sheppouint64_t
2221ae08745Sheppohv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
2231ae08745Sheppo{ return (0); }
2241ae08745Sheppo
2251ae08745Sheppo/*ARGSUSED*/
2261ae08745Sheppouint64_t
2271ae08745Sheppohv_ldc_tx_get_state(uint64_t channel,
2281ae08745Sheppo	uint64_t *headp, uint64_t *tailp, uint64_t *state)
2291ae08745Sheppo{ return (0); }
2301ae08745Sheppo
2311ae08745Sheppo/*ARGSUSED*/
2321ae08745Sheppouint64_t
2331ae08745Sheppohv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
2341ae08745Sheppo{ return (0); }
2351ae08745Sheppo
2361ae08745Sheppo/*ARGSUSED*/
2371ae08745Sheppouint64_t
2381ae08745Sheppohv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
2391ae08745Sheppo{ return (0); }
2401ae08745Sheppo
2411ae08745Sheppo/*ARGSUSED*/
2421ae08745Sheppouint64_t
2431ae08745Sheppohv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
2441ae08745Sheppo{ return (0); }
2451ae08745Sheppo
2461ae08745Sheppo/*ARGSUSED*/
2471ae08745Sheppouint64_t
2481ae08745Sheppohv_ldc_rx_get_state(uint64_t channel,
2491ae08745Sheppo	uint64_t *headp, uint64_t *tailp, uint64_t *state)
2501ae08745Sheppo{ return (0); }
2511ae08745Sheppo
2521ae08745Sheppo/*ARGSUSED*/
2531ae08745Sheppouint64_t
2541ae08745Sheppohv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
2551ae08745Sheppo{ return (0); }
2561ae08745Sheppo
2571ae08745Sheppo/*ARGSUSED*/
2581ae08745Sheppouint64_t
2591ae08745Sheppohv_ldc_send_msg(uint64_t channel, uint64_t msg_ra)
2601ae08745Sheppo{ return (0); }
2611ae08745Sheppo
2621ae08745Sheppo/*ARGSUSED*/
2631ae08745Sheppouint64_t
2641ae08745Sheppohv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra, uint64_t tbl_entries)
2651ae08745Sheppo{ return (0); }
2661ae08745Sheppo
2671ae08745Sheppo/*ARGSUSED*/
2681ae08745Sheppouint64_t
2691ae08745Sheppohv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
2701ae08745Sheppo	uint64_t raddr, uint64_t length, uint64_t *lengthp)
2711ae08745Sheppo{ return (0); }
2721ae08745Sheppo
2731ae08745Sheppo/*ARGSUSED*/
2741ae08745Sheppouint64_t
2751ae08745Sheppohvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino, uint64_t *cookie)
2761ae08745Sheppo{ return (0); }
2771ae08745Sheppo
2781ae08745Sheppo/*ARGSUSED*/
2791ae08745Sheppouint64_t
2801ae08745Sheppohvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino, uint64_t cookie)
2811ae08745Sheppo{ return (0); }
2821ae08745Sheppo
2831ae08745Sheppo/*ARGSUSED*/
2841ae08745Sheppouint64_t
2851ae08745Sheppohvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino, int *intr_valid_state)
2861ae08745Sheppo{ return (0); }
2871ae08745Sheppo
2881ae08745Sheppo/*ARGSUSED*/
2891ae08745Sheppouint64_t
2901ae08745Sheppohvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino, int intr_valid_state)
2911ae08745Sheppo{ return (0); }
2921ae08745Sheppo
2931ae08745Sheppo/*ARGSUSED*/
2941ae08745Sheppouint64_t
2951ae08745Sheppohvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino, int *intr_state)
2961ae08745Sheppo{ return (0); }
2971ae08745Sheppo
2981ae08745Sheppo/*ARGSUSED*/
2991ae08745Sheppouint64_t
3001ae08745Sheppohvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino, int intr_state)
3011ae08745Sheppo{ return (0); }
3021ae08745Sheppo
3031ae08745Sheppo/*ARGSUSED*/
3041ae08745Sheppouint64_t
3051ae08745Sheppohvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino, uint32_t *cpuid)
3061ae08745Sheppo{ return (0); }
3071ae08745Sheppo
3081ae08745Sheppo/*ARGSUSED*/
3091ae08745Sheppouint64_t
3101ae08745Sheppohvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino, uint32_t cpuid)
3111ae08745Sheppo{ return (0); }
3121ae08745Sheppo
3131ae08745Sheppo/*ARGSUSED*/
3141ae08745Sheppouint64_t
3151ae08745Sheppohv_api_get_version(uint64_t api_group, uint64_t *majorp, uint64_t *minorp)
3161ae08745Sheppo{ return (0); }
3171ae08745Sheppo
3181ae08745Sheppo/*ARGSUSED*/
3191ae08745Sheppouint64_t
3201ae08745Sheppohv_api_set_version(uint64_t api_group, uint64_t major, uint64_t minor,
3211ae08745Sheppo    uint64_t *supported_minor)
3221ae08745Sheppo{ return (0); }
3231ae08745Sheppo
3243c431bb5Swentaoy/*ARGSUSED*/
3253c431bb5Swentaoyuint64_t
3263c431bb5Swentaoyhv_mach_set_watchdog(uint64_t timeout, uint64_t *time_remaining)
3273c431bb5Swentaoy{ return (0); }
3283c431bb5Swentaoy
329136097ceSjb145095/*ARGSUSED*/
330136097ceSjb145095int64_t
331136097ceSjb145095hv_cnwrite(uint64_t buf_ra, uint64_t count, uint64_t *retcount)
332136097ceSjb145095{ return (0); }
333136097ceSjb145095
334136097ceSjb145095/*ARGSUSED*/
335136097ceSjb145095int64_t
336136097ceSjb145095hv_cnread(uint64_t buf_ra, uint64_t count, int64_t *retcount)
337136097ceSjb145095{ return (0); }
338136097ceSjb145095
339*3b890a5bSjb145095/*ARGSUSED*/
340*3b890a5bSjb145095uint64_t
341*3b890a5bSjb145095hv_soft_state_set(uint64_t state, uint64_t string)
342*3b890a5bSjb145095{ return (0); }
343*3b890a5bSjb145095
344*3b890a5bSjb145095/*ARGSUSED*/
345*3b890a5bSjb145095uint64_t
346*3b890a5bSjb145095hv_soft_state_get(uint64_t string, uint64_t *state)
347*3b890a5bSjb145095{ return (0); }
348*3b890a5bSjb145095
3497c478bd9Sstevel@tonic-gate#else	/* lint || __lint */
3507c478bd9Sstevel@tonic-gate
3517c478bd9Sstevel@tonic-gate	/*
3521ae08745Sheppo	 * int hv_mach_exit(uint64_t exit_code)
3531ae08745Sheppo	 */
3541ae08745Sheppo	ENTRY(hv_mach_exit)
3551ae08745Sheppo	mov	HV_MACH_EXIT, %o5
3561ae08745Sheppo	ta	FAST_TRAP
3571ae08745Sheppo	retl
3581ae08745Sheppo	  nop
3591ae08745Sheppo	SET_SIZE(hv_mach_exit)
3601ae08745Sheppo
3611ae08745Sheppo	/*
3621ae08745Sheppo	 * uint64_t hv_mach_sir(void)
3631ae08745Sheppo	 */
3641ae08745Sheppo	ENTRY(hv_mach_sir)
3651ae08745Sheppo	mov	HV_MACH_SIR, %o5
3661ae08745Sheppo	ta	FAST_TRAP
3671ae08745Sheppo	retl
3681ae08745Sheppo	  nop
3691ae08745Sheppo	SET_SIZE(hv_mach_sir)
3701ae08745Sheppo
3711ae08745Sheppo	/*
3721ae08745Sheppo	 * hv_cpu_start(uint64_t cpuid, uint64_t pc, ui64_t rtba,
3731ae08745Sheppo	 *     uint64_t arg)
3741ae08745Sheppo	 */
3751ae08745Sheppo	ENTRY(hv_cpu_start)
3761ae08745Sheppo	mov	HV_CPU_START, %o5
3771ae08745Sheppo	ta	FAST_TRAP
3781ae08745Sheppo	retl
3791ae08745Sheppo	  nop
3801ae08745Sheppo	SET_SIZE(hv_cpu_start)
3811ae08745Sheppo
3821ae08745Sheppo	/*
3831ae08745Sheppo	 * hv_cpu_stop(uint64_t cpuid)
3841ae08745Sheppo	 */
3851ae08745Sheppo	ENTRY(hv_cpu_stop)
3861ae08745Sheppo	mov	HV_CPU_STOP, %o5
3871ae08745Sheppo	ta	FAST_TRAP
3881ae08745Sheppo	retl
3891ae08745Sheppo	  nop
3901ae08745Sheppo	SET_SIZE(hv_cpu_stop)
3911ae08745Sheppo
3921ae08745Sheppo	/*
3931ae08745Sheppo	 * hv_cpu_set_rtba(uint64_t *rtba)
3941ae08745Sheppo	 */
3951ae08745Sheppo	ENTRY(hv_cpu_set_rtba)
3961ae08745Sheppo	mov	%o0, %o2
3971ae08745Sheppo	ldx	[%o2], %o0
3981ae08745Sheppo	mov	HV_CPU_SET_RTBA, %o5
3991ae08745Sheppo	ta	FAST_TRAP
4001ae08745Sheppo	stx	%o1, [%o2]
4011ae08745Sheppo	retl
4021ae08745Sheppo	  nop
4031ae08745Sheppo	SET_SIZE(hv_cpu_set_rtba)
4041ae08745Sheppo
4051ae08745Sheppo	/*
4061ae08745Sheppo	 * int64_t hv_cnputchar(uint8_t ch)
4077c478bd9Sstevel@tonic-gate	 */
4087c478bd9Sstevel@tonic-gate	ENTRY(hv_cnputchar)
4091ae08745Sheppo	mov	CONS_PUTCHAR, %o5
4107c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4117c478bd9Sstevel@tonic-gate	retl
4121ae08745Sheppo	  nop
4137c478bd9Sstevel@tonic-gate	SET_SIZE(hv_cnputchar)
4147c478bd9Sstevel@tonic-gate
4157c478bd9Sstevel@tonic-gate	/*
4161ae08745Sheppo	 * int64_t hv_cngetchar(uint8_t *ch)
4177c478bd9Sstevel@tonic-gate	 */
4187c478bd9Sstevel@tonic-gate	ENTRY(hv_cngetchar)
4197c478bd9Sstevel@tonic-gate	mov	%o0, %o2
4201ae08745Sheppo	mov	CONS_GETCHAR, %o5
4217c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4227c478bd9Sstevel@tonic-gate	brnz,a	%o0, 1f		! failure, just return error
4231ae08745Sheppo	  nop
4247c478bd9Sstevel@tonic-gate
4257c478bd9Sstevel@tonic-gate	cmp	%o1, H_BREAK
4267c478bd9Sstevel@tonic-gate	be	1f
4277c478bd9Sstevel@tonic-gate	mov	%o1, %o0
4287c478bd9Sstevel@tonic-gate
4297c478bd9Sstevel@tonic-gate	cmp	%o1, H_HUP
4307c478bd9Sstevel@tonic-gate	be	1f
4317c478bd9Sstevel@tonic-gate	mov	%o1, %o0
4327c478bd9Sstevel@tonic-gate
4337c478bd9Sstevel@tonic-gate	stb	%o1, [%o2]	! success, save character and return 0
4347c478bd9Sstevel@tonic-gate	mov	0, %o0
4357c478bd9Sstevel@tonic-gate1:
4367c478bd9Sstevel@tonic-gate	retl
4377c478bd9Sstevel@tonic-gate	  nop
4387c478bd9Sstevel@tonic-gate	SET_SIZE(hv_cngetchar)
4397c478bd9Sstevel@tonic-gate
4407c478bd9Sstevel@tonic-gate	ENTRY(hv_tod_get)
4417c478bd9Sstevel@tonic-gate	mov	%o0, %o4
4427c478bd9Sstevel@tonic-gate	mov	TOD_GET, %o5
4437c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4447c478bd9Sstevel@tonic-gate	retl
4457c478bd9Sstevel@tonic-gate	  stx	%o1, [%o4]
4467c478bd9Sstevel@tonic-gate	SET_SIZE(hv_tod_get)
4477c478bd9Sstevel@tonic-gate
4487c478bd9Sstevel@tonic-gate	ENTRY(hv_tod_set)
4497c478bd9Sstevel@tonic-gate	mov	TOD_SET, %o5
4507c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4517c478bd9Sstevel@tonic-gate	retl
4527c478bd9Sstevel@tonic-gate	nop
4537c478bd9Sstevel@tonic-gate	SET_SIZE(hv_tod_set)
4547c478bd9Sstevel@tonic-gate
4557c478bd9Sstevel@tonic-gate	/*
4567c478bd9Sstevel@tonic-gate	 * Map permanent address
4577c478bd9Sstevel@tonic-gate	 * arg0 vaddr (%o0)
4587c478bd9Sstevel@tonic-gate	 * arg1 context (%o1)
4597c478bd9Sstevel@tonic-gate	 * arg2 tte (%o2)
4607c478bd9Sstevel@tonic-gate	 * arg3 flags (%o3)  0x1=d 0x2=i
4617c478bd9Sstevel@tonic-gate	 */
4627c478bd9Sstevel@tonic-gate	ENTRY(hv_mmu_map_perm_addr)
4637c478bd9Sstevel@tonic-gate	mov	MAP_PERM_ADDR, %o5
4647c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4657c478bd9Sstevel@tonic-gate	retl
4667c478bd9Sstevel@tonic-gate	nop
4677c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mmu_map_perm_addr)
4687c478bd9Sstevel@tonic-gate
4697c478bd9Sstevel@tonic-gate	/*
4701ae08745Sheppo	 * hv_mmu_fault_area_conf(void *raddr)
4711ae08745Sheppo	 */
4721ae08745Sheppo	ENTRY(hv_mmu_fault_area_conf)
4731ae08745Sheppo	mov	%o0, %o2
4741ae08745Sheppo	ldx	[%o2], %o0
4751ae08745Sheppo	mov	MMU_SET_INFOPTR, %o5
4761ae08745Sheppo	ta	FAST_TRAP
4771ae08745Sheppo	stx	%o1, [%o2]
4781ae08745Sheppo	retl
4791ae08745Sheppo	  nop
4801ae08745Sheppo	SET_SIZE(hv_mmu_fault_area_conf)
4811ae08745Sheppo
4821ae08745Sheppo	/*
4837c478bd9Sstevel@tonic-gate	 * Unmap permanent address
4847c478bd9Sstevel@tonic-gate	 * arg0 vaddr (%o0)
4857c478bd9Sstevel@tonic-gate	 * arg1 context (%o1)
4867c478bd9Sstevel@tonic-gate	 * arg2 flags (%o2)  0x1=d 0x2=i
4877c478bd9Sstevel@tonic-gate	 */
4887c478bd9Sstevel@tonic-gate	ENTRY(hv_mmu_unmap_perm_addr)
4897c478bd9Sstevel@tonic-gate	mov	UNMAP_PERM_ADDR, %o5
4907c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
4917c478bd9Sstevel@tonic-gate	retl
4927c478bd9Sstevel@tonic-gate	nop
4937c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mmu_unmap_perm_addr)
4947c478bd9Sstevel@tonic-gate
4957c478bd9Sstevel@tonic-gate	/*
4967c478bd9Sstevel@tonic-gate	 * Set TSB for context 0
4977c478bd9Sstevel@tonic-gate	 * arg0 ntsb_descriptor (%o0)
4987c478bd9Sstevel@tonic-gate	 * arg1 desc_ra (%o1)
4997c478bd9Sstevel@tonic-gate	 */
5007c478bd9Sstevel@tonic-gate	ENTRY(hv_set_ctx0)
5017c478bd9Sstevel@tonic-gate	mov	MMU_TSB_CTX0, %o5
5027c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5037c478bd9Sstevel@tonic-gate	retl
5047c478bd9Sstevel@tonic-gate	nop
5057c478bd9Sstevel@tonic-gate	SET_SIZE(hv_set_ctx0)
5067c478bd9Sstevel@tonic-gate
5077c478bd9Sstevel@tonic-gate	/*
5087c478bd9Sstevel@tonic-gate	 * Set TSB for context non0
5097c478bd9Sstevel@tonic-gate	 * arg0 ntsb_descriptor (%o0)
5107c478bd9Sstevel@tonic-gate	 * arg1 desc_ra (%o1)
5117c478bd9Sstevel@tonic-gate	 */
5127c478bd9Sstevel@tonic-gate	ENTRY(hv_set_ctxnon0)
5137c478bd9Sstevel@tonic-gate	mov	MMU_TSB_CTXNON0, %o5
5147c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5157c478bd9Sstevel@tonic-gate	retl
5167c478bd9Sstevel@tonic-gate	nop
5177c478bd9Sstevel@tonic-gate	SET_SIZE(hv_set_ctxnon0)
5187c478bd9Sstevel@tonic-gate
5197c478bd9Sstevel@tonic-gate#ifdef SET_MMU_STATS
5207c478bd9Sstevel@tonic-gate	/*
5217c478bd9Sstevel@tonic-gate	 * Returns old stat area on success
5227c478bd9Sstevel@tonic-gate	 */
5237c478bd9Sstevel@tonic-gate	ENTRY(hv_mmu_set_stat_area)
5247c478bd9Sstevel@tonic-gate	mov	MMU_STAT_AREA, %o5
5257c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5267c478bd9Sstevel@tonic-gate	retl
5277c478bd9Sstevel@tonic-gate	nop
5287c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mmu_set_stat_area)
5297c478bd9Sstevel@tonic-gate#endif /* SET_MMU_STATS */
5307c478bd9Sstevel@tonic-gate
5317c478bd9Sstevel@tonic-gate	/*
5327c478bd9Sstevel@tonic-gate	 * CPU Q Configure
5337c478bd9Sstevel@tonic-gate	 * arg0 queue (%o0)
5347c478bd9Sstevel@tonic-gate	 * arg1 Base address RA (%o1)
5357c478bd9Sstevel@tonic-gate	 * arg2 Size (%o2)
5367c478bd9Sstevel@tonic-gate	 */
5377c478bd9Sstevel@tonic-gate	ENTRY(hv_cpu_qconf)
5381ae08745Sheppo	mov	HV_CPU_QCONF, %o5
5397c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5407c478bd9Sstevel@tonic-gate	retl
5417c478bd9Sstevel@tonic-gate	nop
5427c478bd9Sstevel@tonic-gate	SET_SIZE(hv_cpu_qconf)
5437c478bd9Sstevel@tonic-gate
5447c478bd9Sstevel@tonic-gate	/*
5457c478bd9Sstevel@tonic-gate	 * arg0 - devhandle
5467c478bd9Sstevel@tonic-gate	 * arg1 - devino
5477c478bd9Sstevel@tonic-gate	 *
5487c478bd9Sstevel@tonic-gate	 * ret0 - status
5497c478bd9Sstevel@tonic-gate	 * ret1 - sysino
5507c478bd9Sstevel@tonic-gate	 */
5517c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_devino_to_sysino)
5527c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_DEVINO2SYSINO, %o5
5537c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5547c478bd9Sstevel@tonic-gate	brz,a	%o0, 1f
5557c478bd9Sstevel@tonic-gate	stx	%o1, [%o2]
5567c478bd9Sstevel@tonic-gate1:	retl
5577c478bd9Sstevel@tonic-gate	nop
5587c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_devino_to_sysino)
5597c478bd9Sstevel@tonic-gate
5607c478bd9Sstevel@tonic-gate	/*
5617c478bd9Sstevel@tonic-gate	 * arg0 - sysino
5627c478bd9Sstevel@tonic-gate	 *
5637c478bd9Sstevel@tonic-gate	 * ret0 - status
5647c478bd9Sstevel@tonic-gate	 * ret1 - intr_valid_state
5657c478bd9Sstevel@tonic-gate	 */
5667c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_getvalid)
5677c478bd9Sstevel@tonic-gate	mov	%o1, %o2
5687c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_GETVALID, %o5
5697c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5707c478bd9Sstevel@tonic-gate	brz,a	%o0, 1f
5717c478bd9Sstevel@tonic-gate	stuw	%o1, [%o2]
5727c478bd9Sstevel@tonic-gate1:	retl
5737c478bd9Sstevel@tonic-gate	nop
5747c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_getvalid)
5757c478bd9Sstevel@tonic-gate
5767c478bd9Sstevel@tonic-gate	/*
5777c478bd9Sstevel@tonic-gate	 * arg0 - sysino
5787c478bd9Sstevel@tonic-gate	 * arg1 - intr_valid_state
5797c478bd9Sstevel@tonic-gate	 *
5807c478bd9Sstevel@tonic-gate	 * ret0 - status
5817c478bd9Sstevel@tonic-gate	 */
5827c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_setvalid)
5837c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_SETVALID, %o5
5847c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5857c478bd9Sstevel@tonic-gate	retl
5867c478bd9Sstevel@tonic-gate	nop
5877c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_setvalid)
5887c478bd9Sstevel@tonic-gate
5897c478bd9Sstevel@tonic-gate	/*
5907c478bd9Sstevel@tonic-gate	 * arg0 - sysino
5917c478bd9Sstevel@tonic-gate	 *
5927c478bd9Sstevel@tonic-gate	 * ret0 - status
5937c478bd9Sstevel@tonic-gate	 * ret1 - intr_state
5947c478bd9Sstevel@tonic-gate	 */
5957c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_getstate)
5967c478bd9Sstevel@tonic-gate	mov	%o1, %o2
5977c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_GETSTATE, %o5
5987c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
5997c478bd9Sstevel@tonic-gate	brz,a	%o0, 1f
6007c478bd9Sstevel@tonic-gate	stuw	%o1, [%o2]
6017c478bd9Sstevel@tonic-gate1:	retl
6027c478bd9Sstevel@tonic-gate	nop
6037c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_getstate)
6047c478bd9Sstevel@tonic-gate
6057c478bd9Sstevel@tonic-gate	/*
6067c478bd9Sstevel@tonic-gate	 * arg0 - sysino
6077c478bd9Sstevel@tonic-gate	 * arg1 - intr_state
6087c478bd9Sstevel@tonic-gate	 *
6097c478bd9Sstevel@tonic-gate	 * ret0 - status
6107c478bd9Sstevel@tonic-gate	 */
6117c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_setstate)
6127c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_SETSTATE, %o5
6137c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6147c478bd9Sstevel@tonic-gate	retl
6157c478bd9Sstevel@tonic-gate	nop
6167c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_setstate)
6177c478bd9Sstevel@tonic-gate
6187c478bd9Sstevel@tonic-gate	/*
6197c478bd9Sstevel@tonic-gate	 * arg0 - sysino
6207c478bd9Sstevel@tonic-gate	 *
6217c478bd9Sstevel@tonic-gate	 * ret0 - status
6227c478bd9Sstevel@tonic-gate	 * ret1 - cpu_id
6237c478bd9Sstevel@tonic-gate	 */
6247c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_gettarget)
6257c478bd9Sstevel@tonic-gate	mov	%o1, %o2
6267c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_GETTARGET, %o5
6277c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6287c478bd9Sstevel@tonic-gate	brz,a	%o0, 1f
6297c478bd9Sstevel@tonic-gate	stuw	%o1, [%o2]
6307c478bd9Sstevel@tonic-gate1:	retl
6317c478bd9Sstevel@tonic-gate	nop
6327c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_gettarget)
6337c478bd9Sstevel@tonic-gate
6347c478bd9Sstevel@tonic-gate	/*
6357c478bd9Sstevel@tonic-gate	 * arg0 - sysino
6367c478bd9Sstevel@tonic-gate	 * arg1 - cpu_id
6377c478bd9Sstevel@tonic-gate	 *
6387c478bd9Sstevel@tonic-gate	 * ret0 - status
6397c478bd9Sstevel@tonic-gate	 */
6407c478bd9Sstevel@tonic-gate	ENTRY(hvio_intr_settarget)
6417c478bd9Sstevel@tonic-gate	mov	HVIO_INTR_SETTARGET, %o5
6427c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6437c478bd9Sstevel@tonic-gate	retl
6447c478bd9Sstevel@tonic-gate	nop
6457c478bd9Sstevel@tonic-gate	SET_SIZE(hvio_intr_settarget)
6467c478bd9Sstevel@tonic-gate
6477c478bd9Sstevel@tonic-gate	/*
6487c478bd9Sstevel@tonic-gate	 * hv_cpu_yield(void)
6497c478bd9Sstevel@tonic-gate	 */
6507c478bd9Sstevel@tonic-gate	ENTRY(hv_cpu_yield)
6517c478bd9Sstevel@tonic-gate	mov	HV_CPU_YIELD, %o5
6527c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6537c478bd9Sstevel@tonic-gate	retl
6547c478bd9Sstevel@tonic-gate	nop
6557c478bd9Sstevel@tonic-gate	SET_SIZE(hv_cpu_yield)
6567c478bd9Sstevel@tonic-gate
6577c478bd9Sstevel@tonic-gate	/*
6587c478bd9Sstevel@tonic-gate	 * int hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state);
6597c478bd9Sstevel@tonic-gate	 */
6607c478bd9Sstevel@tonic-gate	ENTRY(hv_cpu_state)
6617c478bd9Sstevel@tonic-gate	mov	%o1, %o4			! save datap
6627c478bd9Sstevel@tonic-gate	mov	HV_CPU_STATE, %o5
6637c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6647c478bd9Sstevel@tonic-gate	brz,a	%o0, 1f
6657c478bd9Sstevel@tonic-gate	stx	%o1, [%o4]
6667c478bd9Sstevel@tonic-gate1:
6677c478bd9Sstevel@tonic-gate	retl
6687c478bd9Sstevel@tonic-gate	nop
6697c478bd9Sstevel@tonic-gate	SET_SIZE(hv_cpu_state)
6707c478bd9Sstevel@tonic-gate
6717c478bd9Sstevel@tonic-gate	/*
6727c478bd9Sstevel@tonic-gate	 * HV state dump zone Configure
6737c478bd9Sstevel@tonic-gate	 * arg0 real adrs of dump buffer (%o0)
6747c478bd9Sstevel@tonic-gate	 * arg1 size of dump buffer (%o1)
6757c478bd9Sstevel@tonic-gate	 * ret0 status (%o0)
6767c478bd9Sstevel@tonic-gate	 * ret1 size of buffer on success and min size on EINVAL (%o1)
6777c478bd9Sstevel@tonic-gate	 * hv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *ret_size)
6787c478bd9Sstevel@tonic-gate	 */
6797c478bd9Sstevel@tonic-gate	ENTRY(hv_dump_buf_update)
6807c478bd9Sstevel@tonic-gate	mov	DUMP_BUF_UPDATE, %o5
6817c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
6827c478bd9Sstevel@tonic-gate	retl
6837c478bd9Sstevel@tonic-gate	stx	%o1, [%o2]
6847c478bd9Sstevel@tonic-gate	SET_SIZE(hv_dump_buf_update)
6857c478bd9Sstevel@tonic-gate
6863c431bb5Swentaoy	/*
6873c431bb5Swentaoy	 * arg0 - timeout value (%o0)
6883c431bb5Swentaoy	 *
6893c431bb5Swentaoy	 * ret0 - status (%o0)
6903c431bb5Swentaoy	 * ret1 - time_remaining (%o1)
6913c431bb5Swentaoy	 * hv_mach_set_watchdog(uint64_t timeout, uint64_t *time_remaining)
6923c431bb5Swentaoy	 */
6933c431bb5Swentaoy	ENTRY(hv_mach_set_watchdog)
6943c431bb5Swentaoy	mov	%o1, %o2
6953c431bb5Swentaoy	mov	MACH_SET_WATCHDOG, %o5
6963c431bb5Swentaoy	ta	FAST_TRAP
6973c431bb5Swentaoy	retl
6983c431bb5Swentaoy	stx	%o1, [%o2]
6993c431bb5Swentaoy	SET_SIZE(hv_mach_set_watchdog)
7007c478bd9Sstevel@tonic-gate
7017c478bd9Sstevel@tonic-gate	/*
7027c478bd9Sstevel@tonic-gate	 * For memory scrub
7037c478bd9Sstevel@tonic-gate	 * int hv_mem_scrub(uint64_t real_addr, uint64_t length,
7047c478bd9Sstevel@tonic-gate	 * 	uint64_t *scrubbed_len);
7057c478bd9Sstevel@tonic-gate	 * Retun %o0 -- status
7067c478bd9Sstevel@tonic-gate	 *       %o1 -- bytes scrubbed
7077c478bd9Sstevel@tonic-gate	 */
7087c478bd9Sstevel@tonic-gate	ENTRY(hv_mem_scrub)
7097c478bd9Sstevel@tonic-gate	mov	%o2, %o4
7107c478bd9Sstevel@tonic-gate	mov	HV_MEM_SCRUB, %o5
7117c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7127c478bd9Sstevel@tonic-gate	retl
7137c478bd9Sstevel@tonic-gate	stx	%o1, [%o4]
7147c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mem_scrub)
7157c478bd9Sstevel@tonic-gate
7167c478bd9Sstevel@tonic-gate	/*
7177c478bd9Sstevel@tonic-gate	 * Flush ecache
7187c478bd9Sstevel@tonic-gate	 * int hv_mem_sync(uint64_t real_addr, uint64_t length,
7197c478bd9Sstevel@tonic-gate	 * 	uint64_t *flushed_len);
7207c478bd9Sstevel@tonic-gate	 * Retun %o0 -- status
7217c478bd9Sstevel@tonic-gate	 *       %o1 -- bytes flushed
7227c478bd9Sstevel@tonic-gate	 */
7237c478bd9Sstevel@tonic-gate	ENTRY(hv_mem_sync)
7247c478bd9Sstevel@tonic-gate	mov	%o2, %o4
7257c478bd9Sstevel@tonic-gate	mov	HV_MEM_SYNC, %o5
7267c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7277c478bd9Sstevel@tonic-gate	retl
7287c478bd9Sstevel@tonic-gate	stx	%o1, [%o4]
7297c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mem_sync)
7307c478bd9Sstevel@tonic-gate
7317c478bd9Sstevel@tonic-gate	/*
7327c478bd9Sstevel@tonic-gate	 * TTRACE_BUF_CONF Configure
7337c478bd9Sstevel@tonic-gate	 * arg0 RA base of buffer (%o0)
7347c478bd9Sstevel@tonic-gate	 * arg1 buf size in no. of entries (%o1)
7357c478bd9Sstevel@tonic-gate	 * ret0 status (%o0)
7367c478bd9Sstevel@tonic-gate	 * ret1 minimum size in no. of entries on failure,
7377c478bd9Sstevel@tonic-gate	 * actual size in no. of entries on success (%o1)
7387c478bd9Sstevel@tonic-gate	 */
7397c478bd9Sstevel@tonic-gate	ENTRY(hv_ttrace_buf_conf)
7407c478bd9Sstevel@tonic-gate	mov	TTRACE_BUF_CONF, %o5
7417c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7427c478bd9Sstevel@tonic-gate	retl
7437c478bd9Sstevel@tonic-gate	stx	%o1, [%o2]
7447c478bd9Sstevel@tonic-gate	SET_SIZE(hv_ttrace_buf_conf)
7457c478bd9Sstevel@tonic-gate
7467c478bd9Sstevel@tonic-gate	 /*
7477c478bd9Sstevel@tonic-gate	 * TTRACE_BUF_INFO
7487c478bd9Sstevel@tonic-gate	 * ret0 status (%o0)
7497c478bd9Sstevel@tonic-gate	 * ret1 RA base of buffer (%o1)
7507c478bd9Sstevel@tonic-gate	 * ret2 size in no. of entries (%o2)
7517c478bd9Sstevel@tonic-gate	 */
7527c478bd9Sstevel@tonic-gate	ENTRY(hv_ttrace_buf_info)
7537c478bd9Sstevel@tonic-gate	mov	%o0, %o3
7547c478bd9Sstevel@tonic-gate	mov	%o1, %o4
7557c478bd9Sstevel@tonic-gate	mov	TTRACE_BUF_INFO, %o5
7567c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7577c478bd9Sstevel@tonic-gate	stx	%o1, [%o3]
7587c478bd9Sstevel@tonic-gate	retl
7597c478bd9Sstevel@tonic-gate	stx	%o2, [%o4]
7607c478bd9Sstevel@tonic-gate	SET_SIZE(hv_ttrace_buf_info)
7617c478bd9Sstevel@tonic-gate
7627c478bd9Sstevel@tonic-gate	/*
7637c478bd9Sstevel@tonic-gate	 * TTRACE_ENABLE
7647c478bd9Sstevel@tonic-gate	 * arg0 enable/ disable (%o0)
7657c478bd9Sstevel@tonic-gate	 * ret0 status (%o0)
7667c478bd9Sstevel@tonic-gate	 * ret1 previous enable state (%o1)
7677c478bd9Sstevel@tonic-gate	 */
7687c478bd9Sstevel@tonic-gate	ENTRY(hv_ttrace_enable)
7697c478bd9Sstevel@tonic-gate	mov	%o1, %o2
7707c478bd9Sstevel@tonic-gate	mov	TTRACE_ENABLE, %o5
7717c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7727c478bd9Sstevel@tonic-gate	retl
7737c478bd9Sstevel@tonic-gate	stx	%o1, [%o2]
7747c478bd9Sstevel@tonic-gate	SET_SIZE(hv_ttrace_enable)
7757c478bd9Sstevel@tonic-gate
7767c478bd9Sstevel@tonic-gate	/*
7777c478bd9Sstevel@tonic-gate	 * TTRACE_FREEZE
7787c478bd9Sstevel@tonic-gate	 * arg0 enable/ freeze (%o0)
7797c478bd9Sstevel@tonic-gate	 * ret0 status (%o0)
7807c478bd9Sstevel@tonic-gate	 * ret1 previous freeze state (%o1)
7817c478bd9Sstevel@tonic-gate	 */
7827c478bd9Sstevel@tonic-gate	ENTRY(hv_ttrace_freeze)
7837c478bd9Sstevel@tonic-gate	mov	%o1, %o2
7847c478bd9Sstevel@tonic-gate	mov	TTRACE_FREEZE, %o5
7857c478bd9Sstevel@tonic-gate	ta	FAST_TRAP
7867c478bd9Sstevel@tonic-gate	retl
7877c478bd9Sstevel@tonic-gate	stx	%o1, [%o2]
7887c478bd9Sstevel@tonic-gate	SET_SIZE(hv_ttrace_freeze)
7897c478bd9Sstevel@tonic-gate
7907c478bd9Sstevel@tonic-gate	/*
7917c478bd9Sstevel@tonic-gate	 * MACH_DESC
7927c478bd9Sstevel@tonic-gate	 * arg0 buffer real address
7937c478bd9Sstevel@tonic-gate	 * arg1 pointer to uint64_t for size of buffer
7947c478bd9Sstevel@tonic-gate	 * ret0 status
7957c478bd9Sstevel@tonic-gate	 * ret1 return required size of buffer / returned data size
7967c478bd9Sstevel@tonic-gate	 */
7977c478bd9Sstevel@tonic-gate	ENTRY(hv_mach_desc)
7987c478bd9Sstevel@tonic-gate	mov     %o1, %o4                ! save datap
7997c478bd9Sstevel@tonic-gate	ldx     [%o1], %o1
8007c478bd9Sstevel@tonic-gate	mov     HV_MACH_DESC, %o5
8017c478bd9Sstevel@tonic-gate	ta      FAST_TRAP
8027c478bd9Sstevel@tonic-gate	retl
8037c478bd9Sstevel@tonic-gate	stx   %o1, [%o4]
8047c478bd9Sstevel@tonic-gate	SET_SIZE(hv_mach_desc)
8057c478bd9Sstevel@tonic-gate
8067c478bd9Sstevel@tonic-gate	/*
80769cd775fSschwartz	 * hv_ra2pa(uint64_t ra)
80869cd775fSschwartz	 *
80969cd775fSschwartz	 * MACH_DESC
81069cd775fSschwartz	 * arg0 Real address to convert
81169cd775fSschwartz	 * ret0 Returned physical address or -1 on error
81269cd775fSschwartz	 */
81369cd775fSschwartz	ENTRY(hv_ra2pa)
81469cd775fSschwartz	mov	HV_RA2PA, %o5
81569cd775fSschwartz	ta	FAST_TRAP
81669cd775fSschwartz	cmp	%o0, 0
81769cd775fSschwartz	move	%xcc, %o1, %o0
81869cd775fSschwartz	movne	%xcc, -1, %o0
81969cd775fSschwartz	retl
82069cd775fSschwartz	nop
82169cd775fSschwartz	SET_SIZE(hv_ra2pa)
82269cd775fSschwartz
82369cd775fSschwartz	/*
82469cd775fSschwartz	 * hv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
82569cd775fSschwartz	 *
82669cd775fSschwartz	 * MACH_DESC
82769cd775fSschwartz	 * arg0 OS function to call
82869cd775fSschwartz	 * arg1 First arg to OS function
82969cd775fSschwartz	 * arg2 Second arg to OS function
83069cd775fSschwartz	 * arg3 Third arg to OS function
83169cd775fSschwartz	 * ret0 Returned value from function
83269cd775fSschwartz	 */
83369cd775fSschwartz
83469cd775fSschwartz	ENTRY(hv_hpriv)
83569cd775fSschwartz	mov	HV_HPRIV, %o5
83669cd775fSschwartz	ta	FAST_TRAP
83769cd775fSschwartz	retl
83869cd775fSschwartz	nop
83969cd775fSschwartz	SET_SIZE(hv_hpriv)
84069cd775fSschwartz
8411ae08745Sheppo	/*
8421ae08745Sheppo         * hv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base,
8431ae08745Sheppo	 *	uint64_t nentries);
8441ae08745Sheppo	 */
8451ae08745Sheppo	ENTRY(hv_ldc_tx_qconf)
8461ae08745Sheppo	mov     LDC_TX_QCONF, %o5
8471ae08745Sheppo	ta      FAST_TRAP
8481ae08745Sheppo	retl
8491ae08745Sheppo	  nop
8501ae08745Sheppo	SET_SIZE(hv_ldc_tx_qconf)
8511ae08745Sheppo
8521ae08745Sheppo
8531ae08745Sheppo	/*
8541ae08745Sheppo         * hv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base,
8551ae08745Sheppo	 *	uint64_t *nentries);
8561ae08745Sheppo	 */
8571ae08745Sheppo	ENTRY(hv_ldc_tx_qinfo)
8581ae08745Sheppo	mov	%o1, %g1
8591ae08745Sheppo	mov	%o2, %g2
8601ae08745Sheppo	mov     LDC_TX_QINFO, %o5
8611ae08745Sheppo	ta      FAST_TRAP
8621ae08745Sheppo	stx     %o1, [%g1]
8631ae08745Sheppo	retl
8641ae08745Sheppo	  stx   %o2, [%g2]
8651ae08745Sheppo	SET_SIZE(hv_ldc_tx_qinfo)
8661ae08745Sheppo
8671ae08745Sheppo
8681ae08745Sheppo	/*
8691ae08745Sheppo	 * hv_ldc_tx_get_state(uint64_t channel,
8701ae08745Sheppo	 *	uint64_t *headp, uint64_t *tailp, uint64_t *state);
8711ae08745Sheppo	 */
8721ae08745Sheppo	ENTRY(hv_ldc_tx_get_state)
8731ae08745Sheppo	mov     LDC_TX_GET_STATE, %o5
8741ae08745Sheppo	mov     %o1, %g1
8751ae08745Sheppo	mov     %o2, %g2
8761ae08745Sheppo	mov     %o3, %g3
8771ae08745Sheppo	ta      FAST_TRAP
8781ae08745Sheppo	stx     %o1, [%g1]
8791ae08745Sheppo	stx     %o2, [%g2]
8801ae08745Sheppo	retl
8811ae08745Sheppo	  stx   %o3, [%g3]
8821ae08745Sheppo	SET_SIZE(hv_ldc_tx_get_state)
8831ae08745Sheppo
8841ae08745Sheppo
8851ae08745Sheppo	/*
8861ae08745Sheppo	 * hv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
8871ae08745Sheppo	 */
8881ae08745Sheppo	ENTRY(hv_ldc_tx_set_qtail)
8891ae08745Sheppo	mov     LDC_TX_SET_QTAIL, %o5
8901ae08745Sheppo	ta      FAST_TRAP
8911ae08745Sheppo	retl
8921ae08745Sheppo	SET_SIZE(hv_ldc_tx_set_qtail)
8931ae08745Sheppo
8941ae08745Sheppo
8951ae08745Sheppo	/*
8961ae08745Sheppo         * hv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base,
8971ae08745Sheppo	 *	uint64_t nentries);
8981ae08745Sheppo	 */
8991ae08745Sheppo	ENTRY(hv_ldc_rx_qconf)
9001ae08745Sheppo	mov     LDC_RX_QCONF, %o5
9011ae08745Sheppo	ta      FAST_TRAP
9021ae08745Sheppo	retl
9031ae08745Sheppo	  nop
9041ae08745Sheppo	SET_SIZE(hv_ldc_rx_qconf)
9051ae08745Sheppo
9061ae08745Sheppo
9071ae08745Sheppo	/*
9081ae08745Sheppo         * hv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base,
9091ae08745Sheppo	 *	uint64_t *nentries);
9101ae08745Sheppo	 */
9111ae08745Sheppo	ENTRY(hv_ldc_rx_qinfo)
9121ae08745Sheppo	mov	%o1, %g1
9131ae08745Sheppo	mov	%o2, %g2
9141ae08745Sheppo	mov     LDC_RX_QINFO, %o5
9151ae08745Sheppo	ta      FAST_TRAP
9161ae08745Sheppo	stx     %o1, [%g1]
9171ae08745Sheppo	retl
9181ae08745Sheppo	  stx   %o2, [%g2]
9191ae08745Sheppo	SET_SIZE(hv_ldc_rx_qinfo)
9201ae08745Sheppo
9211ae08745Sheppo
9221ae08745Sheppo	/*
9231ae08745Sheppo	 * hv_ldc_rx_get_state(uint64_t channel,
9241ae08745Sheppo	 *	uint64_t *headp, uint64_t *tailp, uint64_t *state);
9251ae08745Sheppo	 */
9261ae08745Sheppo	ENTRY(hv_ldc_rx_get_state)
9271ae08745Sheppo	mov     LDC_RX_GET_STATE, %o5
9281ae08745Sheppo	mov     %o1, %g1
9291ae08745Sheppo	mov     %o2, %g2
9301ae08745Sheppo	mov     %o3, %g3
9311ae08745Sheppo	ta      FAST_TRAP
9321ae08745Sheppo	stx     %o1, [%g1]
9331ae08745Sheppo	stx     %o2, [%g2]
9341ae08745Sheppo	retl
9351ae08745Sheppo	  stx   %o3, [%g3]
9361ae08745Sheppo	SET_SIZE(hv_ldc_rx_get_state)
9371ae08745Sheppo
9381ae08745Sheppo
9391ae08745Sheppo	/*
9401ae08745Sheppo	 * hv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
9411ae08745Sheppo	 */
9421ae08745Sheppo	ENTRY(hv_ldc_rx_set_qhead)
9431ae08745Sheppo	mov     LDC_RX_SET_QHEAD, %o5
9441ae08745Sheppo	ta      FAST_TRAP
9451ae08745Sheppo	retl
9461ae08745Sheppo	SET_SIZE(hv_ldc_rx_set_qhead)
9471ae08745Sheppo
9481ae08745Sheppo	/*
9491ae08745Sheppo	 * hv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra,
9501ae08745Sheppo	 *		uint64_t tbl_entries)
9511ae08745Sheppo	 */
9521ae08745Sheppo	ENTRY(hv_ldc_set_map_table)
9531ae08745Sheppo	mov     LDC_SET_MAP_TABLE, %o5
9541ae08745Sheppo	ta      FAST_TRAP
9551ae08745Sheppo	retl
9561ae08745Sheppo	  nop
9571ae08745Sheppo	SET_SIZE(hv_ldc_set_map_table)
9581ae08745Sheppo
9591ae08745Sheppo
9601ae08745Sheppo	/*
9611ae08745Sheppo	 * hv_ldc_get_map_table(uint64_t channel, uint64_t *tbl_ra,
9621ae08745Sheppo	 *		uint64_t *tbl_entries)
9631ae08745Sheppo	 */
9641ae08745Sheppo	ENTRY(hv_ldc_get_map_table)
9651ae08745Sheppo	mov	%o1, %g1
9661ae08745Sheppo	mov	%o2, %g2
9671ae08745Sheppo	mov     LDC_GET_MAP_TABLE, %o5
9681ae08745Sheppo	ta      FAST_TRAP
9691ae08745Sheppo	stx     %o1, [%g1]
9701ae08745Sheppo	retl
9711ae08745Sheppo	  stx     %o2, [%g2]
9721ae08745Sheppo	SET_SIZE(hv_ldc_get_map_table)
9731ae08745Sheppo
9741ae08745Sheppo
9751ae08745Sheppo	/*
9761ae08745Sheppo	 * hv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
9771ae08745Sheppo	 *		uint64_t raddr, uint64_t length, uint64_t *lengthp);
9781ae08745Sheppo	 */
9791ae08745Sheppo	ENTRY(hv_ldc_copy)
9801ae08745Sheppo	mov     %o5, %g1
9811ae08745Sheppo	mov     LDC_COPY, %o5
9821ae08745Sheppo	ta      FAST_TRAP
9831ae08745Sheppo	retl
9841ae08745Sheppo	  stx   %o1, [%g1]
9851ae08745Sheppo	SET_SIZE(hv_ldc_copy)
9861ae08745Sheppo
9871ae08745Sheppo
9881ae08745Sheppo	/*
9891ae08745Sheppo	 * hv_ldc_mapin(uint64_t channel, uint64_t cookie, uint64_t *raddr,
9901ae08745Sheppo	 *		uint64_t *perm)
9911ae08745Sheppo	 */
9921ae08745Sheppo	ENTRY(hv_ldc_mapin)
9931ae08745Sheppo	mov	%o2, %g1
9941ae08745Sheppo	mov	%o3, %g2
9951ae08745Sheppo	mov     LDC_MAPIN, %o5
9961ae08745Sheppo	ta      FAST_TRAP
9971ae08745Sheppo	stx     %o1, [%g1]
9981ae08745Sheppo	retl
9991ae08745Sheppo	  stx     %o2, [%g2]
10001ae08745Sheppo	SET_SIZE(hv_ldc_mapin)
10011ae08745Sheppo
10021ae08745Sheppo
10031ae08745Sheppo	/*
10041ae08745Sheppo	 * hv_ldc_unmap(uint64_t raddr)
10051ae08745Sheppo	 */
10061ae08745Sheppo	ENTRY(hv_ldc_unmap)
10071ae08745Sheppo	mov     LDC_UNMAP, %o5
10081ae08745Sheppo	ta      FAST_TRAP
10091ae08745Sheppo	retl
10101ae08745Sheppo	  nop
10111ae08745Sheppo	SET_SIZE(hv_ldc_unmap)
10121ae08745Sheppo
10131ae08745Sheppo
10141ae08745Sheppo	/*
10154bac2208Snarayan	 * hv_ldc_revoke(uint64_t channel, uint64_t cookie,
10164bac2208Snarayan	 *		 uint64_t revoke_cookie
10171ae08745Sheppo	 */
10181ae08745Sheppo	ENTRY(hv_ldc_revoke)
10191ae08745Sheppo	mov     LDC_REVOKE, %o5
10201ae08745Sheppo	ta      FAST_TRAP
10211ae08745Sheppo	retl
10221ae08745Sheppo	  nop
10231ae08745Sheppo	SET_SIZE(hv_ldc_revoke)
10241ae08745Sheppo
10251ae08745Sheppo
10261ae08745Sheppo	/*
10271ae08745Sheppo	 * hvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino,
10281ae08745Sheppo	 *			uint64_t *cookie);
10291ae08745Sheppo	 */
10301ae08745Sheppo	ENTRY(hvldc_intr_getcookie)
10311ae08745Sheppo	mov	%o2, %g1
10321ae08745Sheppo	mov     VINTR_GET_COOKIE, %o5
10331ae08745Sheppo	ta      FAST_TRAP
10341ae08745Sheppo	retl
10351ae08745Sheppo	  stx   %o1, [%g1]
10361ae08745Sheppo	SET_SIZE(hvldc_intr_getcookie)
10371ae08745Sheppo
10381ae08745Sheppo	/*
10391ae08745Sheppo	 * hvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino,
10401ae08745Sheppo	 *			uint64_t cookie);
10411ae08745Sheppo	 */
10421ae08745Sheppo	ENTRY(hvldc_intr_setcookie)
10431ae08745Sheppo	mov     VINTR_SET_COOKIE, %o5
10441ae08745Sheppo	ta      FAST_TRAP
10451ae08745Sheppo	retl
10461ae08745Sheppo	  nop
10471ae08745Sheppo	SET_SIZE(hvldc_intr_setcookie)
10481ae08745Sheppo
10491ae08745Sheppo
10501ae08745Sheppo	/*
10511ae08745Sheppo	 * hvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino,
10521ae08745Sheppo	 *			int *intr_valid_state);
10531ae08745Sheppo	 */
10541ae08745Sheppo	ENTRY(hvldc_intr_getvalid)
10551ae08745Sheppo	mov	%o2, %g1
10561ae08745Sheppo	mov     VINTR_GET_VALID, %o5
10571ae08745Sheppo	ta      FAST_TRAP
10581ae08745Sheppo	retl
10591ae08745Sheppo	  stuw   %o1, [%g1]
10601ae08745Sheppo	SET_SIZE(hvldc_intr_getvalid)
10611ae08745Sheppo
10621ae08745Sheppo	/*
10631ae08745Sheppo	 * hvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino,
10641ae08745Sheppo	 *			int intr_valid_state);
10651ae08745Sheppo	 */
10661ae08745Sheppo	ENTRY(hvldc_intr_setvalid)
10671ae08745Sheppo	mov     VINTR_SET_VALID, %o5
10681ae08745Sheppo	ta      FAST_TRAP
10691ae08745Sheppo	retl
10701ae08745Sheppo	  nop
10711ae08745Sheppo	SET_SIZE(hvldc_intr_setvalid)
10721ae08745Sheppo
10731ae08745Sheppo	/*
10741ae08745Sheppo	 * hvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino,
10751ae08745Sheppo	 *			int *intr_state);
10761ae08745Sheppo	 */
10771ae08745Sheppo	ENTRY(hvldc_intr_getstate)
10781ae08745Sheppo	mov	%o2, %g1
10791ae08745Sheppo	mov     VINTR_GET_STATE, %o5
10801ae08745Sheppo	ta      FAST_TRAP
10811ae08745Sheppo	retl
10821ae08745Sheppo	  stuw   %o1, [%g1]
10831ae08745Sheppo	SET_SIZE(hvldc_intr_getstate)
10841ae08745Sheppo
10851ae08745Sheppo	/*
10861ae08745Sheppo	 * hvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino,
10871ae08745Sheppo	 *			int intr_state);
10881ae08745Sheppo	 */
10891ae08745Sheppo	ENTRY(hvldc_intr_setstate)
10901ae08745Sheppo	mov     VINTR_SET_STATE, %o5
10911ae08745Sheppo	ta      FAST_TRAP
10921ae08745Sheppo	retl
10931ae08745Sheppo	  nop
10941ae08745Sheppo	SET_SIZE(hvldc_intr_setstate)
10951ae08745Sheppo
10961ae08745Sheppo	/*
10971ae08745Sheppo	 * hvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino,
10981ae08745Sheppo	 *			uint32_t *cpuid);
10991ae08745Sheppo	 */
11001ae08745Sheppo	ENTRY(hvldc_intr_gettarget)
11011ae08745Sheppo	mov	%o2, %g1
11021ae08745Sheppo	mov     VINTR_GET_TARGET, %o5
11031ae08745Sheppo	ta      FAST_TRAP
11041ae08745Sheppo	retl
11051ae08745Sheppo	  stuw   %o1, [%g1]
11061ae08745Sheppo	SET_SIZE(hvldc_intr_gettarget)
11071ae08745Sheppo
11081ae08745Sheppo	/*
11091ae08745Sheppo	 * hvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino,
11101ae08745Sheppo	 *			uint32_t cpuid);
11111ae08745Sheppo	 */
11121ae08745Sheppo	ENTRY(hvldc_intr_settarget)
11131ae08745Sheppo	mov     VINTR_SET_TARGET, %o5
11141ae08745Sheppo	ta      FAST_TRAP
11151ae08745Sheppo	retl
11161ae08745Sheppo	  nop
11171ae08745Sheppo	SET_SIZE(hvldc_intr_settarget)
11181ae08745Sheppo
11191ae08745Sheppo	/*
11201ae08745Sheppo	 * hv_api_get_version(uint64_t api_group, uint64_t *majorp,
11211ae08745Sheppo	 *			uint64_t *minorp)
11221ae08745Sheppo	 *
11231ae08745Sheppo	 * API_GET_VERSION
11241ae08745Sheppo	 * arg0 API group
11251ae08745Sheppo	 * ret0 status
11261ae08745Sheppo	 * ret1 major number
11271ae08745Sheppo	 * ret2 minor number
11281ae08745Sheppo	 */
11291ae08745Sheppo	ENTRY(hv_api_get_version)
11301ae08745Sheppo	mov	%o1, %o3
11311ae08745Sheppo	mov	%o2, %o4
11321ae08745Sheppo	mov	API_GET_VERSION, %o5
11331ae08745Sheppo	ta	CORE_TRAP
11341ae08745Sheppo	stx	%o1, [%o3]
11351ae08745Sheppo	retl
11361ae08745Sheppo	  stx	%o2, [%o4]
11371ae08745Sheppo	SET_SIZE(hv_api_get_version)
11381ae08745Sheppo
11391ae08745Sheppo	/*
11401ae08745Sheppo	 * hv_api_set_version(uint64_t api_group, uint64_t major,
11411ae08745Sheppo	 *			uint64_t minor, uint64_t *supported_minor)
11421ae08745Sheppo	 *
11431ae08745Sheppo	 * API_SET_VERSION
11441ae08745Sheppo	 * arg0 API group
11451ae08745Sheppo	 * arg1 major number
11461ae08745Sheppo	 * arg2 requested minor number
11471ae08745Sheppo	 * ret0 status
11481ae08745Sheppo	 * ret1 actual minor number
11491ae08745Sheppo	 */
11501ae08745Sheppo	ENTRY(hv_api_set_version)
11511ae08745Sheppo	mov	%o3, %o4
11521ae08745Sheppo	mov	API_SET_VERSION, %o5
11531ae08745Sheppo	ta	CORE_TRAP
11541ae08745Sheppo	retl
11551ae08745Sheppo	  stx	%o1, [%o4]
11561ae08745Sheppo	SET_SIZE(hv_api_set_version)
11571ae08745Sheppo
1158136097ceSjb145095	/*
1159136097ceSjb145095	 * %o0 - buffer real address
1160136097ceSjb145095	 * %o1 - buffer size
1161136097ceSjb145095	 * %o2 - &characters written
1162136097ceSjb145095	 * returns
1163136097ceSjb145095	 * 	status
1164136097ceSjb145095	 */
1165136097ceSjb145095	ENTRY(hv_cnwrite)
1166136097ceSjb145095	mov	CONS_WRITE, %o5
1167136097ceSjb145095	ta	FAST_TRAP
1168136097ceSjb145095	retl
1169136097ceSjb145095	stx	%o1, [%o2]
1170136097ceSjb145095	SET_SIZE(hv_cnwrite)
1171136097ceSjb145095
1172136097ceSjb145095	/*
1173136097ceSjb145095	 * %o0 character buffer ra
1174136097ceSjb145095	 * %o1 buffer size
1175136097ceSjb145095	 * %o2 pointer to returned size
1176136097ceSjb145095	 * return values:
1177136097ceSjb145095	 * 0 success
1178136097ceSjb145095	 * hv_errno failure
1179136097ceSjb145095	 */
1180136097ceSjb145095	ENTRY(hv_cnread)
1181136097ceSjb145095	mov	CONS_READ, %o5
1182136097ceSjb145095	ta	FAST_TRAP
1183136097ceSjb145095	brnz,a	%o0, 1f		! failure, just return error
1184136097ceSjb145095	nop
1185136097ceSjb145095
1186136097ceSjb145095	cmp	%o1, H_BREAK
1187136097ceSjb145095	be	1f
1188136097ceSjb145095	mov	%o1, %o0
1189136097ceSjb145095
1190136097ceSjb145095	cmp	%o1, H_HUP
1191136097ceSjb145095	be	1f
1192136097ceSjb145095	mov	%o1, %o0
1193136097ceSjb145095
1194136097ceSjb145095	stx	%o1, [%o2]	! success, save count and return 0
1195136097ceSjb145095	mov	0, %o0
1196136097ceSjb1450951:
1197136097ceSjb145095	retl
1198136097ceSjb145095	nop
1199136097ceSjb145095	SET_SIZE(hv_cnread)
1200136097ceSjb145095
1201*3b890a5bSjb145095	/*
1202*3b890a5bSjb145095	 * SOFT_STATE_SET
1203*3b890a5bSjb145095	 * arg0 state (%o0)
1204*3b890a5bSjb145095	 * arg1 string (%o1)
1205*3b890a5bSjb145095	 * ret0 status (%o0)
1206*3b890a5bSjb145095	 */
1207*3b890a5bSjb145095	ENTRY(hv_soft_state_set)
1208*3b890a5bSjb145095	mov	SOFT_STATE_SET, %o5
1209*3b890a5bSjb145095	ta	FAST_TRAP
1210*3b890a5bSjb145095	retl
1211*3b890a5bSjb145095	nop
1212*3b890a5bSjb145095	SET_SIZE(hv_soft_state_set)
1213*3b890a5bSjb145095
1214*3b890a5bSjb145095	/*
1215*3b890a5bSjb145095	 * SOFT_STATE_GET
1216*3b890a5bSjb145095	 * arg0 string buffer (%o0)
1217*3b890a5bSjb145095	 * ret0 status (%o0)
1218*3b890a5bSjb145095	 * ret1 current state (%o1)
1219*3b890a5bSjb145095	 */
1220*3b890a5bSjb145095	ENTRY(hv_soft_state_get)
1221*3b890a5bSjb145095	mov	%o1, %o2
1222*3b890a5bSjb145095	mov	SOFT_STATE_GET, %o5
1223*3b890a5bSjb145095	ta	FAST_TRAP
1224*3b890a5bSjb145095	retl
1225*3b890a5bSjb145095	stx	%o1, [%o2]
1226*3b890a5bSjb145095	SET_SIZE(hv_soft_state_get)
1227*3b890a5bSjb145095
12287c478bd9Sstevel@tonic-gate#endif	/* lint || __lint */
1229