xref: /onnv-gate/usr/src/uts/sun4v/ml/hcall.s (revision 13098:496fd9979cfc)
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
51617Sgovinda * Common Development and Distribution License (the "License").
61617Sgovinda * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
211991Sheppo
220Sstevel@tonic-gate/*
23*13098SWentao.Yang@Sun.COM * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate */
250Sstevel@tonic-gate
260Sstevel@tonic-gate/*
270Sstevel@tonic-gate * Hypervisor calls
280Sstevel@tonic-gate */
290Sstevel@tonic-gate
300Sstevel@tonic-gate#include <sys/asm_linkage.h>
310Sstevel@tonic-gate#include <sys/machasi.h>
320Sstevel@tonic-gate#include <sys/machparam.h>
330Sstevel@tonic-gate#include <sys/hypervisor_api.h>
340Sstevel@tonic-gate
350Sstevel@tonic-gate#if defined(lint) || defined(__lint)
360Sstevel@tonic-gate
370Sstevel@tonic-gate/*ARGSUSED*/
381991Sheppouint64_t
391991Sheppohv_mach_exit(uint64_t exit_code)
401991Sheppo{ return (0); }
411991Sheppo
421991Sheppouint64_t
431991Sheppohv_mach_sir(void)
441991Sheppo{ return (0); }
451991Sheppo
461991Sheppo/*ARGSUSED*/
471991Sheppouint64_t
481991Sheppohv_cpu_start(uint64_t cpuid, uint64_t pc, uint64_t rtba, uint64_t arg)
491991Sheppo{ return (0); }
501991Sheppo
511991Sheppo/*ARGSUSED*/
521991Sheppouint64_t
531991Sheppohv_cpu_stop(uint64_t cpuid)
541991Sheppo{ return (0); }
551991Sheppo
561991Sheppo/*ARGSUSED*/
571991Sheppouint64_t
581991Sheppohv_cpu_set_rtba(uint64_t *rtba)
591991Sheppo{ return (0); }
601991Sheppo
611991Sheppo/*ARGSUSED*/
620Sstevel@tonic-gateint64_t
630Sstevel@tonic-gatehv_cnputchar(uint8_t ch)
640Sstevel@tonic-gate{ return (0); }
650Sstevel@tonic-gate
660Sstevel@tonic-gate/*ARGSUSED*/
670Sstevel@tonic-gateint64_t
680Sstevel@tonic-gatehv_cngetchar(uint8_t *ch)
690Sstevel@tonic-gate{ return (0); }
700Sstevel@tonic-gate
710Sstevel@tonic-gate/*ARGSUSED*/
720Sstevel@tonic-gateuint64_t
730Sstevel@tonic-gatehv_tod_get(uint64_t *seconds)
740Sstevel@tonic-gate{ return (0); }
750Sstevel@tonic-gate
760Sstevel@tonic-gate/*ARGSUSED*/
770Sstevel@tonic-gateuint64_t
780Sstevel@tonic-gatehv_tod_set(uint64_t seconds)
790Sstevel@tonic-gate{ return (0);}
800Sstevel@tonic-gate
810Sstevel@tonic-gate/*ARGSUSED*/
820Sstevel@tonic-gateuint64_t
830Sstevel@tonic-gatehv_mmu_map_perm_addr(void *vaddr, int ctx, uint64_t tte, int flags)
840Sstevel@tonic-gate{ return (0); }
850Sstevel@tonic-gate
861991Sheppo/*ARGSUSED */
871991Sheppouint64_t
881991Sheppohv_mmu_fault_area_conf(void *raddr)
891991Sheppo{ return (0); }
901991Sheppo
910Sstevel@tonic-gate/*ARGSUSED*/
920Sstevel@tonic-gateuint64_t
930Sstevel@tonic-gatehv_mmu_unmap_perm_addr(void *vaddr, int ctx, int flags)
940Sstevel@tonic-gate{ return (0); }
950Sstevel@tonic-gate
960Sstevel@tonic-gate/*ARGSUSED*/
970Sstevel@tonic-gateuint64_t
980Sstevel@tonic-gatehv_set_ctx0(uint64_t ntsb_descriptor, uint64_t desc_ra)
990Sstevel@tonic-gate{ return (0); }
1000Sstevel@tonic-gate
1010Sstevel@tonic-gate/*ARGSUSED*/
1020Sstevel@tonic-gateuint64_t
1030Sstevel@tonic-gatehv_set_ctxnon0(uint64_t ntsb_descriptor, uint64_t desc_ra)
1040Sstevel@tonic-gate{ return (0); }
1050Sstevel@tonic-gate
1060Sstevel@tonic-gate#ifdef SET_MMU_STATS
1070Sstevel@tonic-gate/*ARGSUSED*/
1080Sstevel@tonic-gateuint64_t
1090Sstevel@tonic-gatehv_mmu_set_stat_area(uint64_t rstatarea, uint64_t size)
1100Sstevel@tonic-gate{ return (0); }
1110Sstevel@tonic-gate#endif /* SET_MMU_STATS */
1120Sstevel@tonic-gate
1130Sstevel@tonic-gate/*ARGSUSED*/
1140Sstevel@tonic-gateuint64_t
1150Sstevel@tonic-gatehv_cpu_qconf(int queue, uint64_t paddr, int size)
1160Sstevel@tonic-gate{ return (0); }
1170Sstevel@tonic-gate
1180Sstevel@tonic-gate/*ARGSUSED*/
1190Sstevel@tonic-gateuint64_t
1200Sstevel@tonic-gatehvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, uint64_t *sysino)
1210Sstevel@tonic-gate{ return (0); }
1220Sstevel@tonic-gate
1230Sstevel@tonic-gate/*ARGSUSED*/
1240Sstevel@tonic-gateuint64_t
1250Sstevel@tonic-gatehvio_intr_getvalid(uint64_t sysino, int *intr_valid_state)
1260Sstevel@tonic-gate{ return (0); }
1270Sstevel@tonic-gate
1280Sstevel@tonic-gate/*ARGSUSED*/
1290Sstevel@tonic-gateuint64_t
1300Sstevel@tonic-gatehvio_intr_setvalid(uint64_t sysino, int intr_valid_state)
1310Sstevel@tonic-gate{ return (0); }
1320Sstevel@tonic-gate
1330Sstevel@tonic-gate/*ARGSUSED*/
1340Sstevel@tonic-gateuint64_t
1350Sstevel@tonic-gatehvio_intr_getstate(uint64_t sysino, int *intr_state)
1360Sstevel@tonic-gate{ return (0); }
1370Sstevel@tonic-gate
1380Sstevel@tonic-gate/*ARGSUSED*/
1390Sstevel@tonic-gateuint64_t
1400Sstevel@tonic-gatehvio_intr_setstate(uint64_t sysino, int intr_state)
1410Sstevel@tonic-gate{ return (0); }
1420Sstevel@tonic-gate
1430Sstevel@tonic-gate/*ARGSUSED*/
1440Sstevel@tonic-gateuint64_t
1450Sstevel@tonic-gatehvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid)
1460Sstevel@tonic-gate{ return (0); }
1470Sstevel@tonic-gate
1480Sstevel@tonic-gate/*ARGSUSED*/
1490Sstevel@tonic-gateuint64_t
1500Sstevel@tonic-gatehvio_intr_settarget(uint64_t sysino, uint32_t cpuid)
1510Sstevel@tonic-gate{ return (0); }
1520Sstevel@tonic-gate
1530Sstevel@tonic-gateuint64_t
1540Sstevel@tonic-gatehv_cpu_yield(void)
1550Sstevel@tonic-gate{ return (0); }
1560Sstevel@tonic-gate
1570Sstevel@tonic-gate/*ARGSUSED*/
1580Sstevel@tonic-gateuint64_t
1590Sstevel@tonic-gatehv_cpu_state(uint64_t cpuid, uint64_t *cpu_state)
1600Sstevel@tonic-gate{ return (0); }
1610Sstevel@tonic-gate
1620Sstevel@tonic-gate/*ARGSUSED*/
1630Sstevel@tonic-gateuint64_t
1640Sstevel@tonic-gatehv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *minsize)
1650Sstevel@tonic-gate{ return (0); }
1660Sstevel@tonic-gate
1670Sstevel@tonic-gate/*ARGSUSED*/
1680Sstevel@tonic-gateuint64_t
1690Sstevel@tonic-gatehv_mem_scrub(uint64_t real_addr, uint64_t length, uint64_t *scrubbed_len)
1700Sstevel@tonic-gate{ return (0); }
1710Sstevel@tonic-gate
1720Sstevel@tonic-gate/*ARGSUSED*/
1730Sstevel@tonic-gateuint64_t
1740Sstevel@tonic-gatehv_mem_sync(uint64_t real_addr, uint64_t length, uint64_t *flushed_len)
1750Sstevel@tonic-gate{ return (0); }
1760Sstevel@tonic-gate
1770Sstevel@tonic-gate/*ARGSUSED*/
1780Sstevel@tonic-gateuint64_t
1790Sstevel@tonic-gatehv_ttrace_buf_conf(uint64_t paddr, uint64_t size, uint64_t *size1)
1800Sstevel@tonic-gate{ return (0); }
1810Sstevel@tonic-gate
1820Sstevel@tonic-gate/*ARGSUSED*/
1830Sstevel@tonic-gateuint64_t
1840Sstevel@tonic-gatehv_ttrace_buf_info(uint64_t *paddr, uint64_t *size)
1850Sstevel@tonic-gate{ return (0); }
1860Sstevel@tonic-gate
1870Sstevel@tonic-gate/*ARGSUSED*/
1880Sstevel@tonic-gateuint64_t
1890Sstevel@tonic-gatehv_ttrace_enable(uint64_t enable, uint64_t *prev_enable)
1900Sstevel@tonic-gate{ return (0); }
1910Sstevel@tonic-gate
1920Sstevel@tonic-gate/*ARGSUSED*/
1930Sstevel@tonic-gateuint64_t
1940Sstevel@tonic-gatehv_ttrace_freeze(uint64_t freeze, uint64_t *prev_freeze)
1950Sstevel@tonic-gate{ return (0); }
1960Sstevel@tonic-gate
1970Sstevel@tonic-gate/*ARGSUSED*/
1980Sstevel@tonic-gateuint64_t
1990Sstevel@tonic-gatehv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep)
2000Sstevel@tonic-gate{ return (0); }
2011991Sheppo
2020Sstevel@tonic-gate/*ARGSUSED*/
2030Sstevel@tonic-gateuint64_t
204624Sschwartzhv_ra2pa(uint64_t ra)
205624Sschwartz{ return (0); }
206624Sschwartz
207624Sschwartz/*ARGSUSED*/
208624Sschwartzuint64_t
209624Sschwartzhv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
210624Sschwartz{ return (0); }
211624Sschwartz
2121991Sheppo/*ARGSUSED*/
2131991Sheppouint64_t
2141991Sheppohv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
2151991Sheppo{ return (0); }
2161991Sheppo
2171991Sheppo/*ARGSUSED*/
2181991Sheppouint64_t
2191991Sheppohv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
2201991Sheppo{ return (0); }
2211991Sheppo
2221991Sheppo/*ARGSUSED*/
2231991Sheppouint64_t
2241991Sheppohv_ldc_tx_get_state(uint64_t channel,
2251991Sheppo	uint64_t *headp, uint64_t *tailp, uint64_t *state)
2261991Sheppo{ return (0); }
2271991Sheppo
2281991Sheppo/*ARGSUSED*/
2291991Sheppouint64_t
2301991Sheppohv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
2311991Sheppo{ return (0); }
2321991Sheppo
2331991Sheppo/*ARGSUSED*/
2341991Sheppouint64_t
2351991Sheppohv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
2361991Sheppo{ return (0); }
2371991Sheppo
2381991Sheppo/*ARGSUSED*/
2391991Sheppouint64_t
2401991Sheppohv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
2411991Sheppo{ return (0); }
2421991Sheppo
2431991Sheppo/*ARGSUSED*/
2441991Sheppouint64_t
2451991Sheppohv_ldc_rx_get_state(uint64_t channel,
2461991Sheppo	uint64_t *headp, uint64_t *tailp, uint64_t *state)
2471991Sheppo{ return (0); }
2481991Sheppo
2491991Sheppo/*ARGSUSED*/
2501991Sheppouint64_t
2511991Sheppohv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
2521991Sheppo{ return (0); }
2531991Sheppo
2541991Sheppo/*ARGSUSED*/
2551991Sheppouint64_t
2561991Sheppohv_ldc_send_msg(uint64_t channel, uint64_t msg_ra)
2571991Sheppo{ return (0); }
2581991Sheppo
2591991Sheppo/*ARGSUSED*/
2601991Sheppouint64_t
2611991Sheppohv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra, uint64_t tbl_entries)
2621991Sheppo{ return (0); }
2631991Sheppo
2641991Sheppo/*ARGSUSED*/
2651991Sheppouint64_t
2661991Sheppohv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
2671991Sheppo	uint64_t raddr, uint64_t length, uint64_t *lengthp)
2681991Sheppo{ return (0); }
2691991Sheppo
2701991Sheppo/*ARGSUSED*/
2711991Sheppouint64_t
2721991Sheppohvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino, uint64_t *cookie)
2731991Sheppo{ return (0); }
2741991Sheppo
2751991Sheppo/*ARGSUSED*/
2761991Sheppouint64_t
2771991Sheppohvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino, uint64_t cookie)
2781991Sheppo{ return (0); }
2791991Sheppo
2801991Sheppo/*ARGSUSED*/
2811991Sheppouint64_t
2821991Sheppohvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino, int *intr_valid_state)
2831991Sheppo{ return (0); }
2841991Sheppo
2851991Sheppo/*ARGSUSED*/
2861991Sheppouint64_t
2871991Sheppohvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino, int intr_valid_state)
2881991Sheppo{ return (0); }
2891991Sheppo
2901991Sheppo/*ARGSUSED*/
2911991Sheppouint64_t
2921991Sheppohvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino, int *intr_state)
2931991Sheppo{ return (0); }
2941991Sheppo
2951991Sheppo/*ARGSUSED*/
2961991Sheppouint64_t
2971991Sheppohvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino, int intr_state)
2981991Sheppo{ return (0); }
2991991Sheppo
3001991Sheppo/*ARGSUSED*/
3011991Sheppouint64_t
3021991Sheppohvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino, uint32_t *cpuid)
3031991Sheppo{ return (0); }
3041991Sheppo
3051991Sheppo/*ARGSUSED*/
3061991Sheppouint64_t
3071991Sheppohvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino, uint32_t cpuid)
3081991Sheppo{ return (0); }
3091991Sheppo
3101991Sheppo/*ARGSUSED*/
3111991Sheppouint64_t
3121991Sheppohv_api_get_version(uint64_t api_group, uint64_t *majorp, uint64_t *minorp)
3131991Sheppo{ return (0); }
3141991Sheppo
3151991Sheppo/*ARGSUSED*/
3161991Sheppouint64_t
3171991Sheppohv_api_set_version(uint64_t api_group, uint64_t major, uint64_t minor,
3181991Sheppo    uint64_t *supported_minor)
3191991Sheppo{ return (0); }
3201991Sheppo
3217718SJason.Beloro@Sun.COM/*ARGSUSED*/
3227718SJason.Beloro@Sun.COMuint64_t
3237718SJason.Beloro@Sun.COMhv_tm_enable(uint64_t enable)
3247718SJason.Beloro@Sun.COM{ return (0); }
3257718SJason.Beloro@Sun.COM
32610271SJason.Beloro@Sun.COM/*ARGSUSED*/
3272036Swentaoyuint64_t
3282036Swentaoyhv_mach_set_watchdog(uint64_t timeout, uint64_t *time_remaining)
3292036Swentaoy{ return (0); }
3302036Swentaoy
3312282Sjb145095/*ARGSUSED*/
3322282Sjb145095int64_t
3332282Sjb145095hv_cnwrite(uint64_t buf_ra, uint64_t count, uint64_t *retcount)
3342282Sjb145095{ return (0); }
3352282Sjb145095
3362282Sjb145095/*ARGSUSED*/
3372282Sjb145095int64_t
3382282Sjb145095hv_cnread(uint64_t buf_ra, uint64_t count, int64_t *retcount)
3392282Sjb145095{ return (0); }
3402282Sjb145095
3413266Sjb145095/*ARGSUSED*/
3423266Sjb145095uint64_t
3433266Sjb145095hv_soft_state_set(uint64_t state, uint64_t string)
3443266Sjb145095{ return (0); }
3453266Sjb145095
3463266Sjb145095/*ARGSUSED*/
3473266Sjb145095uint64_t
3483266Sjb145095hv_soft_state_get(uint64_t string, uint64_t *state)
34911304SJanie.Lu@Sun.COM{ return (0); }uint64_t
35011172SHaik.Aftandilian@Sun.COMhv_guest_suspend(void)
35111172SHaik.Aftandilian@Sun.COM{ return (0); }
35211172SHaik.Aftandilian@Sun.COM
35311172SHaik.Aftandilian@Sun.COM/*ARGSUSED*/
35411172SHaik.Aftandilian@Sun.COMuint64_t
35511387SSurya.Prakki@Sun.COMhv_tick_set_npt(uint64_t npt)
35611172SHaik.Aftandilian@Sun.COM{ return (0); }
35711172SHaik.Aftandilian@Sun.COM
35811172SHaik.Aftandilian@Sun.COM/*ARGSUSED*/
35911172SHaik.Aftandilian@Sun.COMuint64_t
36011387SSurya.Prakki@Sun.COMhv_stick_set_npt(uint64_t npt)
36111172SHaik.Aftandilian@Sun.COM{ return (0); }
36211172SHaik.Aftandilian@Sun.COM
36311304SJanie.Lu@Sun.COM/*ARGSUSED*/
36411304SJanie.Lu@Sun.COMuint64_t
36511304SJanie.Lu@Sun.COMhv_reboot_data_set(uint64_t buffer_ra, uint64_t buffer_len)
36611304SJanie.Lu@Sun.COM{ return (0); }
36711304SJanie.Lu@Sun.COM
3680Sstevel@tonic-gate#else	/* lint || __lint */
3690Sstevel@tonic-gate
3700Sstevel@tonic-gate	/*
3711991Sheppo	 * int hv_mach_exit(uint64_t exit_code)
3721991Sheppo	 */
3731991Sheppo	ENTRY(hv_mach_exit)
3741991Sheppo	mov	HV_MACH_EXIT, %o5
3751991Sheppo	ta	FAST_TRAP
3761991Sheppo	retl
3771991Sheppo	  nop
3781991Sheppo	SET_SIZE(hv_mach_exit)
3791991Sheppo
3801991Sheppo	/*
3811991Sheppo	 * uint64_t hv_mach_sir(void)
3821991Sheppo	 */
3831991Sheppo	ENTRY(hv_mach_sir)
3841991Sheppo	mov	HV_MACH_SIR, %o5
3851991Sheppo	ta	FAST_TRAP
3861991Sheppo	retl
3871991Sheppo	  nop
3881991Sheppo	SET_SIZE(hv_mach_sir)
3891991Sheppo
3901991Sheppo	/*
3911991Sheppo	 * hv_cpu_start(uint64_t cpuid, uint64_t pc, ui64_t rtba,
3921991Sheppo	 *     uint64_t arg)
3931991Sheppo	 */
3941991Sheppo	ENTRY(hv_cpu_start)
3951991Sheppo	mov	HV_CPU_START, %o5
3961991Sheppo	ta	FAST_TRAP
3971991Sheppo	retl
3981991Sheppo	  nop
3991991Sheppo	SET_SIZE(hv_cpu_start)
4001991Sheppo
4011991Sheppo	/*
4021991Sheppo	 * hv_cpu_stop(uint64_t cpuid)
4031991Sheppo	 */
4041991Sheppo	ENTRY(hv_cpu_stop)
4051991Sheppo	mov	HV_CPU_STOP, %o5
4061991Sheppo	ta	FAST_TRAP
4071991Sheppo	retl
4081991Sheppo	  nop
4091991Sheppo	SET_SIZE(hv_cpu_stop)
4101991Sheppo
4111991Sheppo	/*
4121991Sheppo	 * hv_cpu_set_rtba(uint64_t *rtba)
4131991Sheppo	 */
4141991Sheppo	ENTRY(hv_cpu_set_rtba)
4151991Sheppo	mov	%o0, %o2
4161991Sheppo	ldx	[%o2], %o0
4171991Sheppo	mov	HV_CPU_SET_RTBA, %o5
4181991Sheppo	ta	FAST_TRAP
4191991Sheppo	stx	%o1, [%o2]
4201991Sheppo	retl
4211991Sheppo	  nop
4221991Sheppo	SET_SIZE(hv_cpu_set_rtba)
4231991Sheppo
4241991Sheppo	/*
4251991Sheppo	 * int64_t hv_cnputchar(uint8_t ch)
4260Sstevel@tonic-gate	 */
4270Sstevel@tonic-gate	ENTRY(hv_cnputchar)
4281991Sheppo	mov	CONS_PUTCHAR, %o5
4290Sstevel@tonic-gate	ta	FAST_TRAP
4300Sstevel@tonic-gate	retl
4311991Sheppo	  nop
4320Sstevel@tonic-gate	SET_SIZE(hv_cnputchar)
4330Sstevel@tonic-gate
4340Sstevel@tonic-gate	/*
4351991Sheppo	 * int64_t hv_cngetchar(uint8_t *ch)
4360Sstevel@tonic-gate	 */
4370Sstevel@tonic-gate	ENTRY(hv_cngetchar)
4380Sstevel@tonic-gate	mov	%o0, %o2
4391991Sheppo	mov	CONS_GETCHAR, %o5
4400Sstevel@tonic-gate	ta	FAST_TRAP
4410Sstevel@tonic-gate	brnz,a	%o0, 1f		! failure, just return error
4421991Sheppo	  nop
4430Sstevel@tonic-gate
4440Sstevel@tonic-gate	cmp	%o1, H_BREAK
4450Sstevel@tonic-gate	be	1f
4460Sstevel@tonic-gate	mov	%o1, %o0
4470Sstevel@tonic-gate
4480Sstevel@tonic-gate	cmp	%o1, H_HUP
4490Sstevel@tonic-gate	be	1f
4500Sstevel@tonic-gate	mov	%o1, %o0
4510Sstevel@tonic-gate
4520Sstevel@tonic-gate	stb	%o1, [%o2]	! success, save character and return 0
4530Sstevel@tonic-gate	mov	0, %o0
4540Sstevel@tonic-gate1:
4550Sstevel@tonic-gate	retl
4561991Sheppo	  nop
4570Sstevel@tonic-gate	SET_SIZE(hv_cngetchar)
4580Sstevel@tonic-gate
4590Sstevel@tonic-gate	ENTRY(hv_tod_get)
4600Sstevel@tonic-gate	mov	%o0, %o4
4610Sstevel@tonic-gate	mov	TOD_GET, %o5
4620Sstevel@tonic-gate	ta	FAST_TRAP
4630Sstevel@tonic-gate	retl
4640Sstevel@tonic-gate	  stx	%o1, [%o4]
4650Sstevel@tonic-gate	SET_SIZE(hv_tod_get)
4660Sstevel@tonic-gate
4670Sstevel@tonic-gate	ENTRY(hv_tod_set)
4680Sstevel@tonic-gate	mov	TOD_SET, %o5
4690Sstevel@tonic-gate	ta	FAST_TRAP
4700Sstevel@tonic-gate	retl
4710Sstevel@tonic-gate	nop
4720Sstevel@tonic-gate	SET_SIZE(hv_tod_set)
4730Sstevel@tonic-gate
4740Sstevel@tonic-gate	/*
4750Sstevel@tonic-gate	 * Map permanent address
4760Sstevel@tonic-gate	 * arg0 vaddr (%o0)
4770Sstevel@tonic-gate	 * arg1 context (%o1)
4780Sstevel@tonic-gate	 * arg2 tte (%o2)
4790Sstevel@tonic-gate	 * arg3 flags (%o3)  0x1=d 0x2=i
4800Sstevel@tonic-gate	 */
4810Sstevel@tonic-gate	ENTRY(hv_mmu_map_perm_addr)
4820Sstevel@tonic-gate	mov	MAP_PERM_ADDR, %o5
4830Sstevel@tonic-gate	ta	FAST_TRAP
4840Sstevel@tonic-gate	retl
4850Sstevel@tonic-gate	nop
4860Sstevel@tonic-gate	SET_SIZE(hv_mmu_map_perm_addr)
4870Sstevel@tonic-gate
4880Sstevel@tonic-gate	/*
4891991Sheppo	 * hv_mmu_fault_area_conf(void *raddr)
4901991Sheppo	 */
4911991Sheppo	ENTRY(hv_mmu_fault_area_conf)
4921991Sheppo	mov	%o0, %o2
4931991Sheppo	ldx	[%o2], %o0
4941991Sheppo	mov	MMU_SET_INFOPTR, %o5
4951991Sheppo	ta	FAST_TRAP
4961991Sheppo	stx	%o1, [%o2]
4971991Sheppo	retl
4981991Sheppo	  nop
4991991Sheppo	SET_SIZE(hv_mmu_fault_area_conf)
5001991Sheppo
5011991Sheppo	/*
5020Sstevel@tonic-gate	 * Unmap permanent address
5030Sstevel@tonic-gate	 * arg0 vaddr (%o0)
5040Sstevel@tonic-gate	 * arg1 context (%o1)
5050Sstevel@tonic-gate	 * arg2 flags (%o2)  0x1=d 0x2=i
5060Sstevel@tonic-gate	 */
5070Sstevel@tonic-gate	ENTRY(hv_mmu_unmap_perm_addr)
5080Sstevel@tonic-gate	mov	UNMAP_PERM_ADDR, %o5
5090Sstevel@tonic-gate	ta	FAST_TRAP
5100Sstevel@tonic-gate	retl
5110Sstevel@tonic-gate	nop
5120Sstevel@tonic-gate	SET_SIZE(hv_mmu_unmap_perm_addr)
5130Sstevel@tonic-gate
5140Sstevel@tonic-gate	/*
5150Sstevel@tonic-gate	 * Set TSB for context 0
5160Sstevel@tonic-gate	 * arg0 ntsb_descriptor (%o0)
5170Sstevel@tonic-gate	 * arg1 desc_ra (%o1)
5180Sstevel@tonic-gate	 */
5190Sstevel@tonic-gate	ENTRY(hv_set_ctx0)
5200Sstevel@tonic-gate	mov	MMU_TSB_CTX0, %o5
5210Sstevel@tonic-gate	ta	FAST_TRAP
5220Sstevel@tonic-gate	retl
5230Sstevel@tonic-gate	nop
5240Sstevel@tonic-gate	SET_SIZE(hv_set_ctx0)
5250Sstevel@tonic-gate
5260Sstevel@tonic-gate	/*
5270Sstevel@tonic-gate	 * Set TSB for context non0
5280Sstevel@tonic-gate	 * arg0 ntsb_descriptor (%o0)
5290Sstevel@tonic-gate	 * arg1 desc_ra (%o1)
5300Sstevel@tonic-gate	 */
5310Sstevel@tonic-gate	ENTRY(hv_set_ctxnon0)
5320Sstevel@tonic-gate	mov	MMU_TSB_CTXNON0, %o5
5330Sstevel@tonic-gate	ta	FAST_TRAP
5340Sstevel@tonic-gate	retl
5350Sstevel@tonic-gate	nop
5360Sstevel@tonic-gate	SET_SIZE(hv_set_ctxnon0)
5370Sstevel@tonic-gate
5380Sstevel@tonic-gate#ifdef SET_MMU_STATS
5390Sstevel@tonic-gate	/*
5400Sstevel@tonic-gate	 * Returns old stat area on success
5410Sstevel@tonic-gate	 */
5420Sstevel@tonic-gate	ENTRY(hv_mmu_set_stat_area)
5430Sstevel@tonic-gate	mov	MMU_STAT_AREA, %o5
5440Sstevel@tonic-gate	ta	FAST_TRAP
5450Sstevel@tonic-gate	retl
5460Sstevel@tonic-gate	nop
5470Sstevel@tonic-gate	SET_SIZE(hv_mmu_set_stat_area)
5480Sstevel@tonic-gate#endif /* SET_MMU_STATS */
5490Sstevel@tonic-gate
5500Sstevel@tonic-gate	/*
5510Sstevel@tonic-gate	 * CPU Q Configure
5520Sstevel@tonic-gate	 * arg0 queue (%o0)
5530Sstevel@tonic-gate	 * arg1 Base address RA (%o1)
5540Sstevel@tonic-gate	 * arg2 Size (%o2)
5550Sstevel@tonic-gate	 */
5560Sstevel@tonic-gate	ENTRY(hv_cpu_qconf)
5571991Sheppo	mov	HV_CPU_QCONF, %o5
5580Sstevel@tonic-gate	ta	FAST_TRAP
5590Sstevel@tonic-gate	retl
5600Sstevel@tonic-gate	nop
5610Sstevel@tonic-gate	SET_SIZE(hv_cpu_qconf)
5620Sstevel@tonic-gate
5630Sstevel@tonic-gate	/*
5640Sstevel@tonic-gate	 * arg0 - devhandle
5650Sstevel@tonic-gate	 * arg1 - devino
5660Sstevel@tonic-gate	 *
5670Sstevel@tonic-gate	 * ret0 - status
5680Sstevel@tonic-gate	 * ret1 - sysino
5690Sstevel@tonic-gate	 */
5700Sstevel@tonic-gate	ENTRY(hvio_intr_devino_to_sysino)
5710Sstevel@tonic-gate	mov	HVIO_INTR_DEVINO2SYSINO, %o5
5720Sstevel@tonic-gate	ta	FAST_TRAP
5730Sstevel@tonic-gate	brz,a	%o0, 1f
5740Sstevel@tonic-gate	stx	%o1, [%o2]
5750Sstevel@tonic-gate1:	retl
5760Sstevel@tonic-gate	nop
5770Sstevel@tonic-gate	SET_SIZE(hvio_intr_devino_to_sysino)
5780Sstevel@tonic-gate
5790Sstevel@tonic-gate	/*
5800Sstevel@tonic-gate	 * arg0 - sysino
5810Sstevel@tonic-gate	 *
5820Sstevel@tonic-gate	 * ret0 - status
5830Sstevel@tonic-gate	 * ret1 - intr_valid_state
5840Sstevel@tonic-gate	 */
5850Sstevel@tonic-gate	ENTRY(hvio_intr_getvalid)
5860Sstevel@tonic-gate	mov	%o1, %o2
5870Sstevel@tonic-gate	mov	HVIO_INTR_GETVALID, %o5
5880Sstevel@tonic-gate	ta	FAST_TRAP
5890Sstevel@tonic-gate	brz,a	%o0, 1f
5900Sstevel@tonic-gate	stuw	%o1, [%o2]
5910Sstevel@tonic-gate1:	retl
5920Sstevel@tonic-gate	nop
5930Sstevel@tonic-gate	SET_SIZE(hvio_intr_getvalid)
5940Sstevel@tonic-gate
5950Sstevel@tonic-gate	/*
5960Sstevel@tonic-gate	 * arg0 - sysino
5970Sstevel@tonic-gate	 * arg1 - intr_valid_state
5980Sstevel@tonic-gate	 *
5990Sstevel@tonic-gate	 * ret0 - status
6000Sstevel@tonic-gate	 */
6010Sstevel@tonic-gate	ENTRY(hvio_intr_setvalid)
6020Sstevel@tonic-gate	mov	HVIO_INTR_SETVALID, %o5
6030Sstevel@tonic-gate	ta	FAST_TRAP
6040Sstevel@tonic-gate	retl
6050Sstevel@tonic-gate	nop
6060Sstevel@tonic-gate	SET_SIZE(hvio_intr_setvalid)
6070Sstevel@tonic-gate
6080Sstevel@tonic-gate	/*
6090Sstevel@tonic-gate	 * arg0 - sysino
6100Sstevel@tonic-gate	 *
6110Sstevel@tonic-gate	 * ret0 - status
6120Sstevel@tonic-gate	 * ret1 - intr_state
6130Sstevel@tonic-gate	 */
6140Sstevel@tonic-gate	ENTRY(hvio_intr_getstate)
6150Sstevel@tonic-gate	mov	%o1, %o2
6160Sstevel@tonic-gate	mov	HVIO_INTR_GETSTATE, %o5
6170Sstevel@tonic-gate	ta	FAST_TRAP
6180Sstevel@tonic-gate	brz,a	%o0, 1f
6190Sstevel@tonic-gate	stuw	%o1, [%o2]
6200Sstevel@tonic-gate1:	retl
6210Sstevel@tonic-gate	nop
6220Sstevel@tonic-gate	SET_SIZE(hvio_intr_getstate)
6230Sstevel@tonic-gate
6240Sstevel@tonic-gate	/*
6250Sstevel@tonic-gate	 * arg0 - sysino
6260Sstevel@tonic-gate	 * arg1 - intr_state
6270Sstevel@tonic-gate	 *
6280Sstevel@tonic-gate	 * ret0 - status
6290Sstevel@tonic-gate	 */
6300Sstevel@tonic-gate	ENTRY(hvio_intr_setstate)
6310Sstevel@tonic-gate	mov	HVIO_INTR_SETSTATE, %o5
6320Sstevel@tonic-gate	ta	FAST_TRAP
6330Sstevel@tonic-gate	retl
6340Sstevel@tonic-gate	nop
6350Sstevel@tonic-gate	SET_SIZE(hvio_intr_setstate)
6360Sstevel@tonic-gate
6370Sstevel@tonic-gate	/*
6380Sstevel@tonic-gate	 * arg0 - sysino
6390Sstevel@tonic-gate	 *
6400Sstevel@tonic-gate	 * ret0 - status
6410Sstevel@tonic-gate	 * ret1 - cpu_id
6420Sstevel@tonic-gate	 */
6430Sstevel@tonic-gate	ENTRY(hvio_intr_gettarget)
6440Sstevel@tonic-gate	mov	%o1, %o2
6450Sstevel@tonic-gate	mov	HVIO_INTR_GETTARGET, %o5
6460Sstevel@tonic-gate	ta	FAST_TRAP
6470Sstevel@tonic-gate	brz,a	%o0, 1f
6480Sstevel@tonic-gate	stuw	%o1, [%o2]
6490Sstevel@tonic-gate1:	retl
6500Sstevel@tonic-gate	nop
6510Sstevel@tonic-gate	SET_SIZE(hvio_intr_gettarget)
6520Sstevel@tonic-gate
6530Sstevel@tonic-gate	/*
6540Sstevel@tonic-gate	 * arg0 - sysino
6550Sstevel@tonic-gate	 * arg1 - cpu_id
6560Sstevel@tonic-gate	 *
6570Sstevel@tonic-gate	 * ret0 - status
6580Sstevel@tonic-gate	 */
6590Sstevel@tonic-gate	ENTRY(hvio_intr_settarget)
6600Sstevel@tonic-gate	mov	HVIO_INTR_SETTARGET, %o5
6610Sstevel@tonic-gate	ta	FAST_TRAP
6620Sstevel@tonic-gate	retl
6630Sstevel@tonic-gate	nop
6640Sstevel@tonic-gate	SET_SIZE(hvio_intr_settarget)
6650Sstevel@tonic-gate
6660Sstevel@tonic-gate	/*
6670Sstevel@tonic-gate	 * hv_cpu_yield(void)
6680Sstevel@tonic-gate	 */
6690Sstevel@tonic-gate	ENTRY(hv_cpu_yield)
6700Sstevel@tonic-gate	mov	HV_CPU_YIELD, %o5
6710Sstevel@tonic-gate	ta	FAST_TRAP
6720Sstevel@tonic-gate	retl
6730Sstevel@tonic-gate	nop
6740Sstevel@tonic-gate	SET_SIZE(hv_cpu_yield)
6750Sstevel@tonic-gate
6760Sstevel@tonic-gate	/*
6770Sstevel@tonic-gate	 * int hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state);
6780Sstevel@tonic-gate	 */
6790Sstevel@tonic-gate	ENTRY(hv_cpu_state)
6800Sstevel@tonic-gate	mov	%o1, %o4			! save datap
6810Sstevel@tonic-gate	mov	HV_CPU_STATE, %o5
6820Sstevel@tonic-gate	ta	FAST_TRAP
6830Sstevel@tonic-gate	brz,a	%o0, 1f
6840Sstevel@tonic-gate	stx	%o1, [%o4]
6850Sstevel@tonic-gate1:
6860Sstevel@tonic-gate	retl
6870Sstevel@tonic-gate	nop
6880Sstevel@tonic-gate	SET_SIZE(hv_cpu_state)
6890Sstevel@tonic-gate
6900Sstevel@tonic-gate	/*
6910Sstevel@tonic-gate	 * HV state dump zone Configure
6920Sstevel@tonic-gate	 * arg0 real adrs of dump buffer (%o0)
6930Sstevel@tonic-gate	 * arg1 size of dump buffer (%o1)
6940Sstevel@tonic-gate	 * ret0 status (%o0)
6950Sstevel@tonic-gate	 * ret1 size of buffer on success and min size on EINVAL (%o1)
6960Sstevel@tonic-gate	 * hv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *ret_size)
6970Sstevel@tonic-gate	 */
6980Sstevel@tonic-gate	ENTRY(hv_dump_buf_update)
6990Sstevel@tonic-gate	mov	DUMP_BUF_UPDATE, %o5
7000Sstevel@tonic-gate	ta	FAST_TRAP
7010Sstevel@tonic-gate	retl
7020Sstevel@tonic-gate	stx	%o1, [%o2]
7030Sstevel@tonic-gate	SET_SIZE(hv_dump_buf_update)
7040Sstevel@tonic-gate
7052036Swentaoy	/*
7062036Swentaoy	 * arg0 - timeout value (%o0)
7072036Swentaoy	 *
7082036Swentaoy	 * ret0 - status (%o0)
7092036Swentaoy	 * ret1 - time_remaining (%o1)
7102036Swentaoy	 * hv_mach_set_watchdog(uint64_t timeout, uint64_t *time_remaining)
7112036Swentaoy	 */
7122036Swentaoy	ENTRY(hv_mach_set_watchdog)
7132036Swentaoy	mov	%o1, %o2
7142036Swentaoy	mov	MACH_SET_WATCHDOG, %o5
7152036Swentaoy	ta	FAST_TRAP
7162036Swentaoy	retl
7172036Swentaoy	stx	%o1, [%o2]
7182036Swentaoy	SET_SIZE(hv_mach_set_watchdog)
7190Sstevel@tonic-gate
7200Sstevel@tonic-gate	/*
7210Sstevel@tonic-gate	 * For memory scrub
7220Sstevel@tonic-gate	 * int hv_mem_scrub(uint64_t real_addr, uint64_t length,
7230Sstevel@tonic-gate	 * 	uint64_t *scrubbed_len);
7240Sstevel@tonic-gate	 * Retun %o0 -- status
7250Sstevel@tonic-gate	 *       %o1 -- bytes scrubbed
7260Sstevel@tonic-gate	 */
7270Sstevel@tonic-gate	ENTRY(hv_mem_scrub)
7280Sstevel@tonic-gate	mov	%o2, %o4
7290Sstevel@tonic-gate	mov	HV_MEM_SCRUB, %o5
7300Sstevel@tonic-gate	ta	FAST_TRAP
7310Sstevel@tonic-gate	retl
7320Sstevel@tonic-gate	stx	%o1, [%o4]
7330Sstevel@tonic-gate	SET_SIZE(hv_mem_scrub)
7340Sstevel@tonic-gate
7350Sstevel@tonic-gate	/*
7360Sstevel@tonic-gate	 * Flush ecache
7370Sstevel@tonic-gate	 * int hv_mem_sync(uint64_t real_addr, uint64_t length,
7380Sstevel@tonic-gate	 * 	uint64_t *flushed_len);
7390Sstevel@tonic-gate	 * Retun %o0 -- status
7400Sstevel@tonic-gate	 *       %o1 -- bytes flushed
7410Sstevel@tonic-gate	 */
7420Sstevel@tonic-gate	ENTRY(hv_mem_sync)
7430Sstevel@tonic-gate	mov	%o2, %o4
7440Sstevel@tonic-gate	mov	HV_MEM_SYNC, %o5
7450Sstevel@tonic-gate	ta	FAST_TRAP
7460Sstevel@tonic-gate	retl
7470Sstevel@tonic-gate	stx	%o1, [%o4]
7480Sstevel@tonic-gate	SET_SIZE(hv_mem_sync)
7490Sstevel@tonic-gate
7500Sstevel@tonic-gate	/*
75110271SJason.Beloro@Sun.COM	 * uint64_t hv_tm_enable(uint64_t enable)
7527718SJason.Beloro@Sun.COM	 */
7537718SJason.Beloro@Sun.COM	ENTRY(hv_tm_enable)
7547718SJason.Beloro@Sun.COM	mov	HV_TM_ENABLE, %o5
7557718SJason.Beloro@Sun.COM	ta	FAST_TRAP
7567718SJason.Beloro@Sun.COM	retl
7577718SJason.Beloro@Sun.COM	  nop
7587718SJason.Beloro@Sun.COM	SET_SIZE(hv_tm_enable)
7597718SJason.Beloro@Sun.COM
7607718SJason.Beloro@Sun.COM	/*
7610Sstevel@tonic-gate	 * TTRACE_BUF_CONF Configure
7620Sstevel@tonic-gate	 * arg0 RA base of buffer (%o0)
7630Sstevel@tonic-gate	 * arg1 buf size in no. of entries (%o1)
7640Sstevel@tonic-gate	 * ret0 status (%o0)
7650Sstevel@tonic-gate	 * ret1 minimum size in no. of entries on failure,
7660Sstevel@tonic-gate	 * actual size in no. of entries on success (%o1)
7670Sstevel@tonic-gate	 */
7680Sstevel@tonic-gate	ENTRY(hv_ttrace_buf_conf)
7690Sstevel@tonic-gate	mov	TTRACE_BUF_CONF, %o5
7700Sstevel@tonic-gate	ta	FAST_TRAP
7710Sstevel@tonic-gate	retl
7720Sstevel@tonic-gate	stx	%o1, [%o2]
7730Sstevel@tonic-gate	SET_SIZE(hv_ttrace_buf_conf)
7740Sstevel@tonic-gate
7750Sstevel@tonic-gate	 /*
7760Sstevel@tonic-gate	 * TTRACE_BUF_INFO
7770Sstevel@tonic-gate	 * ret0 status (%o0)
7780Sstevel@tonic-gate	 * ret1 RA base of buffer (%o1)
7790Sstevel@tonic-gate	 * ret2 size in no. of entries (%o2)
7800Sstevel@tonic-gate	 */
7810Sstevel@tonic-gate	ENTRY(hv_ttrace_buf_info)
7820Sstevel@tonic-gate	mov	%o0, %o3
7830Sstevel@tonic-gate	mov	%o1, %o4
7840Sstevel@tonic-gate	mov	TTRACE_BUF_INFO, %o5
7850Sstevel@tonic-gate	ta	FAST_TRAP
7860Sstevel@tonic-gate	stx	%o1, [%o3]
7870Sstevel@tonic-gate	retl
7880Sstevel@tonic-gate	stx	%o2, [%o4]
7890Sstevel@tonic-gate	SET_SIZE(hv_ttrace_buf_info)
7900Sstevel@tonic-gate
7910Sstevel@tonic-gate	/*
7920Sstevel@tonic-gate	 * TTRACE_ENABLE
7930Sstevel@tonic-gate	 * arg0 enable/ disable (%o0)
7940Sstevel@tonic-gate	 * ret0 status (%o0)
7950Sstevel@tonic-gate	 * ret1 previous enable state (%o1)
7960Sstevel@tonic-gate	 */
7970Sstevel@tonic-gate	ENTRY(hv_ttrace_enable)
7980Sstevel@tonic-gate	mov	%o1, %o2
7990Sstevel@tonic-gate	mov	TTRACE_ENABLE, %o5
8000Sstevel@tonic-gate	ta	FAST_TRAP
8010Sstevel@tonic-gate	retl
8020Sstevel@tonic-gate	stx	%o1, [%o2]
8030Sstevel@tonic-gate	SET_SIZE(hv_ttrace_enable)
8040Sstevel@tonic-gate
8050Sstevel@tonic-gate	/*
8060Sstevel@tonic-gate	 * TTRACE_FREEZE
8070Sstevel@tonic-gate	 * arg0 enable/ freeze (%o0)
8080Sstevel@tonic-gate	 * ret0 status (%o0)
8090Sstevel@tonic-gate	 * ret1 previous freeze state (%o1)
8101991Sheppo	 */
8110Sstevel@tonic-gate	ENTRY(hv_ttrace_freeze)
8120Sstevel@tonic-gate	mov	%o1, %o2
8130Sstevel@tonic-gate	mov	TTRACE_FREEZE, %o5
8140Sstevel@tonic-gate	ta	FAST_TRAP
8150Sstevel@tonic-gate	retl
8160Sstevel@tonic-gate	stx	%o1, [%o2]
8170Sstevel@tonic-gate	SET_SIZE(hv_ttrace_freeze)
8180Sstevel@tonic-gate
8190Sstevel@tonic-gate	/*
820624Sschwartz	 * MACH_DESC
821624Sschwartz	 * arg0 buffer real address
822624Sschwartz	 * arg1 pointer to uint64_t for size of buffer
823624Sschwartz	 * ret0 status
824624Sschwartz	 * ret1 return required size of buffer / returned data size
825624Sschwartz	 */
8260Sstevel@tonic-gate	ENTRY(hv_mach_desc)
8270Sstevel@tonic-gate	mov     %o1, %o4                ! save datap
8280Sstevel@tonic-gate	ldx     [%o1], %o1
8290Sstevel@tonic-gate	mov     HV_MACH_DESC, %o5
8300Sstevel@tonic-gate	ta      FAST_TRAP
8310Sstevel@tonic-gate	retl
8320Sstevel@tonic-gate	stx   %o1, [%o4]
8330Sstevel@tonic-gate	SET_SIZE(hv_mach_desc)
8340Sstevel@tonic-gate
8350Sstevel@tonic-gate	/*
836624Sschwartz	 * hv_ra2pa(uint64_t ra)
837624Sschwartz	 *
838624Sschwartz	 * MACH_DESC
839624Sschwartz	 * arg0 Real address to convert
840624Sschwartz	 * ret0 Returned physical address or -1 on error
841624Sschwartz	 */
842624Sschwartz	ENTRY(hv_ra2pa)
843624Sschwartz	mov	HV_RA2PA, %o5
844624Sschwartz	ta	FAST_TRAP
845624Sschwartz	cmp	%o0, 0
846624Sschwartz	move	%xcc, %o1, %o0
847624Sschwartz	movne	%xcc, -1, %o0
848624Sschwartz	retl
849624Sschwartz	nop
850624Sschwartz	SET_SIZE(hv_ra2pa)
851624Sschwartz
852624Sschwartz	/*
853624Sschwartz	 * hv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
854624Sschwartz	 *
855624Sschwartz	 * MACH_DESC
856624Sschwartz	 * arg0 OS function to call
857624Sschwartz	 * arg1 First arg to OS function
858624Sschwartz	 * arg2 Second arg to OS function
859624Sschwartz	 * arg3 Third arg to OS function
860624Sschwartz	 * ret0 Returned value from function
861624Sschwartz	 */
862624Sschwartz
863624Sschwartz	ENTRY(hv_hpriv)
864624Sschwartz	mov	HV_HPRIV, %o5
865624Sschwartz	ta	FAST_TRAP
866624Sschwartz	retl
867624Sschwartz	nop
868624Sschwartz	SET_SIZE(hv_hpriv)
869624Sschwartz
8701991Sheppo	/*
8711991Sheppo         * hv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base,
8721991Sheppo	 *	uint64_t nentries);
8731991Sheppo	 */
8741991Sheppo	ENTRY(hv_ldc_tx_qconf)
8751991Sheppo	mov     LDC_TX_QCONF, %o5
8761991Sheppo	ta      FAST_TRAP
8771991Sheppo	retl
8781991Sheppo	  nop
8791991Sheppo	SET_SIZE(hv_ldc_tx_qconf)
8801991Sheppo
8811991Sheppo
8821991Sheppo	/*
8831991Sheppo         * hv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base,
8841991Sheppo	 *	uint64_t *nentries);
8851991Sheppo	 */
8861991Sheppo	ENTRY(hv_ldc_tx_qinfo)
8871991Sheppo	mov	%o1, %g1
8881991Sheppo	mov	%o2, %g2
8891991Sheppo	mov     LDC_TX_QINFO, %o5
8901991Sheppo	ta      FAST_TRAP
8911991Sheppo	stx     %o1, [%g1]
8921991Sheppo	retl
8931991Sheppo	  stx   %o2, [%g2]
8941991Sheppo	SET_SIZE(hv_ldc_tx_qinfo)
8951991Sheppo
8961991Sheppo
8971991Sheppo	/*
8981991Sheppo	 * hv_ldc_tx_get_state(uint64_t channel,
8991991Sheppo	 *	uint64_t *headp, uint64_t *tailp, uint64_t *state);
9001991Sheppo	 */
9011991Sheppo	ENTRY(hv_ldc_tx_get_state)
9021991Sheppo	mov     LDC_TX_GET_STATE, %o5
9031991Sheppo	mov     %o1, %g1
9041991Sheppo	mov     %o2, %g2
9051991Sheppo	mov     %o3, %g3
9061991Sheppo	ta      FAST_TRAP
9071991Sheppo	stx     %o1, [%g1]
9081991Sheppo	stx     %o2, [%g2]
9091991Sheppo	retl
9101991Sheppo	  stx   %o3, [%g3]
9111991Sheppo	SET_SIZE(hv_ldc_tx_get_state)
9121991Sheppo
9131991Sheppo
9141991Sheppo	/*
9151991Sheppo	 * hv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
9161991Sheppo	 */
9171991Sheppo	ENTRY(hv_ldc_tx_set_qtail)
9181991Sheppo	mov     LDC_TX_SET_QTAIL, %o5
9191991Sheppo	ta      FAST_TRAP
9201991Sheppo	retl
9211991Sheppo	SET_SIZE(hv_ldc_tx_set_qtail)
9221991Sheppo
9231991Sheppo
9241991Sheppo	/*
9251991Sheppo         * hv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base,
9261991Sheppo	 *	uint64_t nentries);
9271991Sheppo	 */
9281991Sheppo	ENTRY(hv_ldc_rx_qconf)
9291991Sheppo	mov     LDC_RX_QCONF, %o5
9301991Sheppo	ta      FAST_TRAP
9311991Sheppo	retl
9321991Sheppo	  nop
9331991Sheppo	SET_SIZE(hv_ldc_rx_qconf)
9341991Sheppo
9351991Sheppo
9361991Sheppo	/*
9371991Sheppo         * hv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base,
9381991Sheppo	 *	uint64_t *nentries);
9391991Sheppo	 */
9401991Sheppo	ENTRY(hv_ldc_rx_qinfo)
9411991Sheppo	mov	%o1, %g1
9421991Sheppo	mov	%o2, %g2
9431991Sheppo	mov     LDC_RX_QINFO, %o5
9441991Sheppo	ta      FAST_TRAP
9451991Sheppo	stx     %o1, [%g1]
9461991Sheppo	retl
9471991Sheppo	  stx   %o2, [%g2]
9481991Sheppo	SET_SIZE(hv_ldc_rx_qinfo)
9491991Sheppo
9501991Sheppo
9511991Sheppo	/*
9521991Sheppo	 * hv_ldc_rx_get_state(uint64_t channel,
9531991Sheppo	 *	uint64_t *headp, uint64_t *tailp, uint64_t *state);
9541991Sheppo	 */
9551991Sheppo	ENTRY(hv_ldc_rx_get_state)
9561991Sheppo	mov     LDC_RX_GET_STATE, %o5
9571991Sheppo	mov     %o1, %g1
9581991Sheppo	mov     %o2, %g2
9591991Sheppo	mov     %o3, %g3
9601991Sheppo	ta      FAST_TRAP
9611991Sheppo	stx     %o1, [%g1]
9621991Sheppo	stx     %o2, [%g2]
9631991Sheppo	retl
9641991Sheppo	  stx   %o3, [%g3]
9651991Sheppo	SET_SIZE(hv_ldc_rx_get_state)
9661991Sheppo
9671991Sheppo
9681991Sheppo	/*
9691991Sheppo	 * hv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
9701991Sheppo	 */
9711991Sheppo	ENTRY(hv_ldc_rx_set_qhead)
9721991Sheppo	mov     LDC_RX_SET_QHEAD, %o5
9731991Sheppo	ta      FAST_TRAP
9741991Sheppo	retl
9751991Sheppo	SET_SIZE(hv_ldc_rx_set_qhead)
9761991Sheppo
9771991Sheppo	/*
9781991Sheppo	 * hv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra,
9791991Sheppo	 *		uint64_t tbl_entries)
9801991Sheppo	 */
9811991Sheppo	ENTRY(hv_ldc_set_map_table)
9821991Sheppo	mov     LDC_SET_MAP_TABLE, %o5
9831991Sheppo	ta      FAST_TRAP
9841991Sheppo	retl
9851991Sheppo	  nop
9861991Sheppo	SET_SIZE(hv_ldc_set_map_table)
9871991Sheppo
9881991Sheppo
9891991Sheppo	/*
9901991Sheppo	 * hv_ldc_get_map_table(uint64_t channel, uint64_t *tbl_ra,
9911991Sheppo	 *		uint64_t *tbl_entries)
9921991Sheppo	 */
9931991Sheppo	ENTRY(hv_ldc_get_map_table)
9941991Sheppo	mov	%o1, %g1
9951991Sheppo	mov	%o2, %g2
9961991Sheppo	mov     LDC_GET_MAP_TABLE, %o5
9971991Sheppo	ta      FAST_TRAP
9981991Sheppo	stx     %o1, [%g1]
9991991Sheppo	retl
10001991Sheppo	  stx     %o2, [%g2]
10011991Sheppo	SET_SIZE(hv_ldc_get_map_table)
10021991Sheppo
10031991Sheppo
10041991Sheppo	/*
10051991Sheppo	 * hv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
10061991Sheppo	 *		uint64_t raddr, uint64_t length, uint64_t *lengthp);
10071991Sheppo	 */
10081991Sheppo	ENTRY(hv_ldc_copy)
10091991Sheppo	mov     %o5, %g1
10101991Sheppo	mov     LDC_COPY, %o5
10111991Sheppo	ta      FAST_TRAP
10121991Sheppo	retl
10131991Sheppo	  stx   %o1, [%g1]
10141991Sheppo	SET_SIZE(hv_ldc_copy)
10151991Sheppo
10161991Sheppo
10171991Sheppo	/*
10181991Sheppo	 * hv_ldc_mapin(uint64_t channel, uint64_t cookie, uint64_t *raddr,
10191991Sheppo	 *		uint64_t *perm)
10201991Sheppo	 */
10211991Sheppo	ENTRY(hv_ldc_mapin)
10221991Sheppo	mov	%o2, %g1
10231991Sheppo	mov	%o3, %g2
10241991Sheppo	mov     LDC_MAPIN, %o5
10251991Sheppo	ta      FAST_TRAP
10261991Sheppo	stx     %o1, [%g1]
10271991Sheppo	retl
10281991Sheppo	  stx     %o2, [%g2]
10291991Sheppo	SET_SIZE(hv_ldc_mapin)
10301991Sheppo
10311991Sheppo
10321991Sheppo	/*
10331991Sheppo	 * hv_ldc_unmap(uint64_t raddr)
10341991Sheppo	 */
10351991Sheppo	ENTRY(hv_ldc_unmap)
10361991Sheppo	mov     LDC_UNMAP, %o5
10371991Sheppo	ta      FAST_TRAP
10381991Sheppo	retl
10391991Sheppo	  nop
10401991Sheppo	SET_SIZE(hv_ldc_unmap)
10411991Sheppo
10421991Sheppo
10431991Sheppo	/*
10442531Snarayan	 * hv_ldc_revoke(uint64_t channel, uint64_t cookie,
10452531Snarayan	 *		 uint64_t revoke_cookie
10461991Sheppo	 */
10471991Sheppo	ENTRY(hv_ldc_revoke)
10481991Sheppo	mov     LDC_REVOKE, %o5
10491991Sheppo	ta      FAST_TRAP
10501991Sheppo	retl
10511991Sheppo	  nop
10521991Sheppo	SET_SIZE(hv_ldc_revoke)
10531991Sheppo
1054*13098SWentao.Yang@Sun.COM	/*
1055*13098SWentao.Yang@Sun.COM	 * hv_ldc_mapin_size_max(uint64_t tbl_type, uint64_t *sz)
1056*13098SWentao.Yang@Sun.COM	 */
1057*13098SWentao.Yang@Sun.COM	ENTRY(hv_ldc_mapin_size_max)
1058*13098SWentao.Yang@Sun.COM	mov	%o1, %g1
1059*13098SWentao.Yang@Sun.COM	mov     LDC_MAPIN_SIZE_MAX, %o5
1060*13098SWentao.Yang@Sun.COM	ta      FAST_TRAP
1061*13098SWentao.Yang@Sun.COM	retl
1062*13098SWentao.Yang@Sun.COM	  stx     %o1, [%g1]
1063*13098SWentao.Yang@Sun.COM	SET_SIZE(hv_ldc_mapin_size_max)
10641991Sheppo
10651991Sheppo	/*
10661991Sheppo	 * hvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino,
10671991Sheppo	 *			uint64_t *cookie);
10681991Sheppo	 */
10691991Sheppo	ENTRY(hvldc_intr_getcookie)
10701991Sheppo	mov	%o2, %g1
10711991Sheppo	mov     VINTR_GET_COOKIE, %o5
10721991Sheppo	ta      FAST_TRAP
10731991Sheppo	retl
10741991Sheppo	  stx   %o1, [%g1]
10751991Sheppo	SET_SIZE(hvldc_intr_getcookie)
10761991Sheppo
10771991Sheppo	/*
10781991Sheppo	 * hvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino,
10791991Sheppo	 *			uint64_t cookie);
10801991Sheppo	 */
10811991Sheppo	ENTRY(hvldc_intr_setcookie)
10821991Sheppo	mov     VINTR_SET_COOKIE, %o5
10831991Sheppo	ta      FAST_TRAP
10841991Sheppo	retl
10851991Sheppo	  nop
10861991Sheppo	SET_SIZE(hvldc_intr_setcookie)
10871991Sheppo
10881991Sheppo
10891991Sheppo	/*
10901991Sheppo	 * hvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino,
10911991Sheppo	 *			int *intr_valid_state);
10921991Sheppo	 */
10931991Sheppo	ENTRY(hvldc_intr_getvalid)
10941991Sheppo	mov	%o2, %g1
10951991Sheppo	mov     VINTR_GET_VALID, %o5
10961991Sheppo	ta      FAST_TRAP
10971991Sheppo	retl
10981991Sheppo	  stuw   %o1, [%g1]
10991991Sheppo	SET_SIZE(hvldc_intr_getvalid)
11001991Sheppo
11011991Sheppo	/*
11021991Sheppo	 * hvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino,
11031991Sheppo	 *			int intr_valid_state);
11041991Sheppo	 */
11051991Sheppo	ENTRY(hvldc_intr_setvalid)
11061991Sheppo	mov     VINTR_SET_VALID, %o5
11071991Sheppo	ta      FAST_TRAP
11081991Sheppo	retl
11091991Sheppo	  nop
11101991Sheppo	SET_SIZE(hvldc_intr_setvalid)
11111991Sheppo
11121991Sheppo	/*
11131991Sheppo	 * hvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino,
11141991Sheppo	 *			int *intr_state);
11151991Sheppo	 */
11161991Sheppo	ENTRY(hvldc_intr_getstate)
11171991Sheppo	mov	%o2, %g1
11181991Sheppo	mov     VINTR_GET_STATE, %o5
11191991Sheppo	ta      FAST_TRAP
11201991Sheppo	retl
11211991Sheppo	  stuw   %o1, [%g1]
11221991Sheppo	SET_SIZE(hvldc_intr_getstate)
11231991Sheppo
11241991Sheppo	/*
11251991Sheppo	 * hvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino,
11261991Sheppo	 *			int intr_state);
11271991Sheppo	 */
11281991Sheppo	ENTRY(hvldc_intr_setstate)
11291991Sheppo	mov     VINTR_SET_STATE, %o5
11301991Sheppo	ta      FAST_TRAP
11311991Sheppo	retl
11321991Sheppo	  nop
11331991Sheppo	SET_SIZE(hvldc_intr_setstate)
11341991Sheppo
11351991Sheppo	/*
11361991Sheppo	 * hvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino,
11371991Sheppo	 *			uint32_t *cpuid);
11381991Sheppo	 */
11391991Sheppo	ENTRY(hvldc_intr_gettarget)
11401991Sheppo	mov	%o2, %g1
11411991Sheppo	mov     VINTR_GET_TARGET, %o5
11421991Sheppo	ta      FAST_TRAP
11431991Sheppo	retl
11441991Sheppo	  stuw   %o1, [%g1]
11451991Sheppo	SET_SIZE(hvldc_intr_gettarget)
11461991Sheppo
11471991Sheppo	/*
11481991Sheppo	 * hvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino,
11491991Sheppo	 *			uint32_t cpuid);
11501991Sheppo	 */
11511991Sheppo	ENTRY(hvldc_intr_settarget)
11521991Sheppo	mov     VINTR_SET_TARGET, %o5
11531991Sheppo	ta      FAST_TRAP
11541991Sheppo	retl
11551991Sheppo	  nop
11561991Sheppo	SET_SIZE(hvldc_intr_settarget)
11571991Sheppo
11581991Sheppo	/*
11591991Sheppo	 * hv_api_get_version(uint64_t api_group, uint64_t *majorp,
11601991Sheppo	 *			uint64_t *minorp)
11611991Sheppo	 *
11621991Sheppo	 * API_GET_VERSION
11631991Sheppo	 * arg0 API group
11641991Sheppo	 * ret0 status
11651991Sheppo	 * ret1 major number
11661991Sheppo	 * ret2 minor number
11671991Sheppo	 */
11681991Sheppo	ENTRY(hv_api_get_version)
11691991Sheppo	mov	%o1, %o3
11701991Sheppo	mov	%o2, %o4
11711991Sheppo	mov	API_GET_VERSION, %o5
11721991Sheppo	ta	CORE_TRAP
11731991Sheppo	stx	%o1, [%o3]
11741991Sheppo	retl
11751991Sheppo	  stx	%o2, [%o4]
11761991Sheppo	SET_SIZE(hv_api_get_version)
11771991Sheppo
11781991Sheppo	/*
11791991Sheppo	 * hv_api_set_version(uint64_t api_group, uint64_t major,
11801991Sheppo	 *			uint64_t minor, uint64_t *supported_minor)
11811991Sheppo	 *
11821991Sheppo	 * API_SET_VERSION
11831991Sheppo	 * arg0 API group
11841991Sheppo	 * arg1 major number
11851991Sheppo	 * arg2 requested minor number
11861991Sheppo	 * ret0 status
11871991Sheppo	 * ret1 actual minor number
11881991Sheppo	 */
11891991Sheppo	ENTRY(hv_api_set_version)
11901991Sheppo	mov	%o3, %o4
11911991Sheppo	mov	API_SET_VERSION, %o5
11921991Sheppo	ta	CORE_TRAP
11931991Sheppo	retl
11941991Sheppo	  stx	%o1, [%o4]
11951991Sheppo	SET_SIZE(hv_api_set_version)
11961991Sheppo
11972282Sjb145095	/*
11982282Sjb145095	 * %o0 - buffer real address
11992282Sjb145095	 * %o1 - buffer size
12002282Sjb145095	 * %o2 - &characters written
12012282Sjb145095	 * returns
12022282Sjb145095	 * 	status
12032282Sjb145095	 */
12042282Sjb145095	ENTRY(hv_cnwrite)
12052282Sjb145095	mov	CONS_WRITE, %o5
12062282Sjb145095	ta	FAST_TRAP
12072282Sjb145095	retl
12082282Sjb145095	stx	%o1, [%o2]
12092282Sjb145095	SET_SIZE(hv_cnwrite)
12102282Sjb145095
12112282Sjb145095	/*
12122282Sjb145095	 * %o0 character buffer ra
12132282Sjb145095	 * %o1 buffer size
12142282Sjb145095	 * %o2 pointer to returned size
12152282Sjb145095	 * return values:
12162282Sjb145095	 * 0 success
12172282Sjb145095	 * hv_errno failure
12182282Sjb145095	 */
12192282Sjb145095	ENTRY(hv_cnread)
12202282Sjb145095	mov	CONS_READ, %o5
12212282Sjb145095	ta	FAST_TRAP
12222282Sjb145095	brnz,a	%o0, 1f		! failure, just return error
12232282Sjb145095	nop
12242282Sjb145095
12252282Sjb145095	cmp	%o1, H_BREAK
12262282Sjb145095	be	1f
12272282Sjb145095	mov	%o1, %o0
12282282Sjb145095
12292282Sjb145095	cmp	%o1, H_HUP
12302282Sjb145095	be	1f
12312282Sjb145095	mov	%o1, %o0
12322282Sjb145095
12332282Sjb145095	stx	%o1, [%o2]	! success, save count and return 0
12342282Sjb145095	mov	0, %o0
12352282Sjb1450951:
12362282Sjb145095	retl
12372282Sjb145095	nop
12382282Sjb145095	SET_SIZE(hv_cnread)
12392282Sjb145095
12403266Sjb145095	/*
12413266Sjb145095	 * SOFT_STATE_SET
12423266Sjb145095	 * arg0 state (%o0)
12433266Sjb145095	 * arg1 string (%o1)
12443266Sjb145095	 * ret0 status (%o0)
12453266Sjb145095	 */
12463266Sjb145095	ENTRY(hv_soft_state_set)
12473266Sjb145095	mov	SOFT_STATE_SET, %o5
12483266Sjb145095	ta	FAST_TRAP
12493266Sjb145095	retl
12503266Sjb145095	nop
12513266Sjb145095	SET_SIZE(hv_soft_state_set)
12523266Sjb145095
12533266Sjb145095	/*
12543266Sjb145095	 * SOFT_STATE_GET
12553266Sjb145095	 * arg0 string buffer (%o0)
12563266Sjb145095	 * ret0 status (%o0)
12573266Sjb145095	 * ret1 current state (%o1)
12583266Sjb145095	 */
12593266Sjb145095	ENTRY(hv_soft_state_get)
12603266Sjb145095	mov	%o1, %o2
12613266Sjb145095	mov	SOFT_STATE_GET, %o5
12623266Sjb145095	ta	FAST_TRAP
12633266Sjb145095	retl
12643266Sjb145095	stx	%o1, [%o2]
12653266Sjb145095	SET_SIZE(hv_soft_state_get)
12663266Sjb145095
126711172SHaik.Aftandilian@Sun.COM	ENTRY(hv_guest_suspend)
126811172SHaik.Aftandilian@Sun.COM	mov	GUEST_SUSPEND, %o5
126911172SHaik.Aftandilian@Sun.COM	ta	FAST_TRAP
127011172SHaik.Aftandilian@Sun.COM	retl
127111172SHaik.Aftandilian@Sun.COM	nop
127211172SHaik.Aftandilian@Sun.COM	SET_SIZE(hv_guest_suspend)
127311172SHaik.Aftandilian@Sun.COM
127411172SHaik.Aftandilian@Sun.COM	ENTRY(hv_tick_set_npt)
127511172SHaik.Aftandilian@Sun.COM	mov	TICK_SET_NPT, %o5
127611172SHaik.Aftandilian@Sun.COM	ta	FAST_TRAP
127711172SHaik.Aftandilian@Sun.COM	retl
127811172SHaik.Aftandilian@Sun.COM	nop
127911172SHaik.Aftandilian@Sun.COM	SET_SIZE(hv_tick_set_npt)
128011172SHaik.Aftandilian@Sun.COM
128111172SHaik.Aftandilian@Sun.COM	ENTRY(hv_stick_set_npt)
128211172SHaik.Aftandilian@Sun.COM	mov	STICK_SET_NPT, %o5
128311172SHaik.Aftandilian@Sun.COM	ta	FAST_TRAP
128411172SHaik.Aftandilian@Sun.COM	retl
128511172SHaik.Aftandilian@Sun.COM	nop
128611172SHaik.Aftandilian@Sun.COM	SET_SIZE(hv_stick_set_npt)
128711172SHaik.Aftandilian@Sun.COM
128811304SJanie.Lu@Sun.COM	/*
128911304SJanie.Lu@Sun.COM	 * REBOOT_DATA_SET
129011304SJanie.Lu@Sun.COM	 * arg0 buffer real address
129111304SJanie.Lu@Sun.COM	 * arg1 buffer length
129211304SJanie.Lu@Sun.COM	 * ret0 status
129311304SJanie.Lu@Sun.COM	 */
129411304SJanie.Lu@Sun.COM	ENTRY(hv_reboot_data_set)
129511304SJanie.Lu@Sun.COM	mov	HV_REBOOT_DATA_SET, %o5
129611304SJanie.Lu@Sun.COM	ta	FAST_TRAP
129711304SJanie.Lu@Sun.COM	retl
129811304SJanie.Lu@Sun.COM	nop
129911304SJanie.Lu@Sun.COM	SET_SIZE(hv_reboot_data_set)
130011304SJanie.Lu@Sun.COM
13010Sstevel@tonic-gate#endif	/* lint || __lint */
1302