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 51370Sschwartz * Common Development and Distribution License (the "License"). 61370Sschwartz * 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 */ 211370Sschwartz 220Sstevel@tonic-gate /* 231310Sha137994 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate #ifndef _SYS_HYPERVISOR_API_H 280Sstevel@tonic-gate #define _SYS_HYPERVISOR_API_H 290Sstevel@tonic-gate 300Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 310Sstevel@tonic-gate 320Sstevel@tonic-gate /* 330Sstevel@tonic-gate * sun4v Hypervisor API 340Sstevel@tonic-gate * 350Sstevel@tonic-gate * Reference: api.pdf Revision 0.12 dated May 12, 2004. 360Sstevel@tonic-gate * io-api.txt version 1.11 dated 10/19/2004 370Sstevel@tonic-gate */ 380Sstevel@tonic-gate 390Sstevel@tonic-gate #ifdef __cplusplus 400Sstevel@tonic-gate extern "C" { 410Sstevel@tonic-gate #endif 420Sstevel@tonic-gate 430Sstevel@tonic-gate /* 440Sstevel@tonic-gate * Trap types 450Sstevel@tonic-gate */ 460Sstevel@tonic-gate #define FAST_TRAP 0x80 /* Function # in %o5 */ 470Sstevel@tonic-gate #define CPU_TICK_NPT 0x81 480Sstevel@tonic-gate #define CPU_STICK_NPT 0x82 490Sstevel@tonic-gate #define MMU_MAP_ADDR 0x83 500Sstevel@tonic-gate #define MMU_UNMAP_ADDR 0x84 510Sstevel@tonic-gate 521991Sheppo #define CORE_TRAP 0xff 531991Sheppo 540Sstevel@tonic-gate /* 550Sstevel@tonic-gate * Error returns in %o0. 560Sstevel@tonic-gate * (Additional result is returned in %o1.) 570Sstevel@tonic-gate */ 580Sstevel@tonic-gate #define H_EOK 0 /* Successful return */ 590Sstevel@tonic-gate #define H_ENOCPU 1 /* Invalid CPU id */ 600Sstevel@tonic-gate #define H_ENORADDR 2 /* Invalid real address */ 610Sstevel@tonic-gate #define H_ENOINTR 3 /* Invalid interrupt id */ 620Sstevel@tonic-gate #define H_EBADPGSZ 4 /* Invalid pagesize encoding */ 630Sstevel@tonic-gate #define H_EBADTSB 5 /* Invalid TSB description */ 640Sstevel@tonic-gate #define H_EINVAL 6 /* Invalid argument */ 650Sstevel@tonic-gate #define H_EBADTRAP 7 /* Invalid function number */ 660Sstevel@tonic-gate #define H_EBADALIGN 8 /* Invalid address alignment */ 670Sstevel@tonic-gate #define H_EWOULDBLOCK 9 /* Cannot complete operation */ 680Sstevel@tonic-gate /* without blocking */ 690Sstevel@tonic-gate #define H_ENOACCESS 10 /* No access to resource */ 700Sstevel@tonic-gate #define H_EIO 11 /* I/O error */ 710Sstevel@tonic-gate #define H_ECPUERROR 12 /* CPU is in error state */ 720Sstevel@tonic-gate #define H_ENOTSUPPORTED 13 /* Function not supported */ 730Sstevel@tonic-gate #define H_ENOMAP 14 /* Mapping is not valid, */ 740Sstevel@tonic-gate /* no translation exists */ 751592Sgirish #define H_EBUSY 17 /* Resource busy */ 761991Sheppo #define H_ETOOMANY 15 /* Hard resource limit exceeded */ 771991Sheppo #define H_ECHANNEL 16 /* Illegal LDC channel */ 780Sstevel@tonic-gate 790Sstevel@tonic-gate #define H_BREAK -1 /* Console Break */ 800Sstevel@tonic-gate #define H_HUP -2 /* Console Break */ 811310Sha137994 821310Sha137994 /* 831310Sha137994 * Mondo CPU ID argument processing. 841310Sha137994 */ 851310Sha137994 #define HV_SEND_MONDO_ENTRYDONE 0xffff 861310Sha137994 870Sstevel@tonic-gate /* 880Sstevel@tonic-gate * Function numbers for FAST_TRAP. 890Sstevel@tonic-gate */ 900Sstevel@tonic-gate #define HV_MACH_EXIT 0x00 910Sstevel@tonic-gate #define HV_MACH_DESC 0x01 921991Sheppo #define HV_MACH_SIR 0x02 932036Swentaoy #define MACH_SET_WATCHDOG 0x05 941991Sheppo 951991Sheppo #define HV_CPU_START 0x10 961991Sheppo #define HV_CPU_STOP 0x11 970Sstevel@tonic-gate #define HV_CPU_YIELD 0x12 981991Sheppo #define HV_CPU_QCONF 0x14 990Sstevel@tonic-gate #define HV_CPU_STATE 0x17 1001991Sheppo #define HV_CPU_SET_RTBA 0x18 1011991Sheppo 1020Sstevel@tonic-gate #define MMU_TSB_CTX0 0x20 1030Sstevel@tonic-gate #define MMU_TSB_CTXNON0 0x21 1040Sstevel@tonic-gate #define MMU_DEMAP_PAGE 0x22 1050Sstevel@tonic-gate #define MMU_DEMAP_CTX 0x23 1060Sstevel@tonic-gate #define MMU_DEMAP_ALL 0x24 1070Sstevel@tonic-gate #define MAP_PERM_ADDR 0x25 1080Sstevel@tonic-gate #define MMU_SET_INFOPTR 0x26 1091991Sheppo #define MMU_ENABLE 0x27 1100Sstevel@tonic-gate #define UNMAP_PERM_ADDR 0x28 1111991Sheppo 1120Sstevel@tonic-gate #define HV_MEM_SCRUB 0x31 1130Sstevel@tonic-gate #define HV_MEM_SYNC 0x32 1141991Sheppo 1150Sstevel@tonic-gate #define HV_INTR_SEND 0x42 1161991Sheppo 1170Sstevel@tonic-gate #define TOD_GET 0x50 1180Sstevel@tonic-gate #define TOD_SET 0x51 1191991Sheppo 1201991Sheppo #define CONS_GETCHAR 0x60 1211991Sheppo #define CONS_PUTCHAR 0x61 1222282Sjb145095 #define CONS_READ 0x62 1232282Sjb145095 #define CONS_WRITE 0x63 1240Sstevel@tonic-gate 125*3266Sjb145095 #define SOFT_STATE_SET 0x70 126*3266Sjb145095 #define SOFT_STATE_GET 0x71 127*3266Sjb145095 1280Sstevel@tonic-gate #define TTRACE_BUF_CONF 0x90 1290Sstevel@tonic-gate #define TTRACE_BUF_INFO 0x91 1300Sstevel@tonic-gate #define TTRACE_ENABLE 0x92 1310Sstevel@tonic-gate #define TTRACE_FREEZE 0x93 1320Sstevel@tonic-gate #define DUMP_BUF_UPDATE 0x94 1330Sstevel@tonic-gate 1340Sstevel@tonic-gate #define HVIO_INTR_DEVINO2SYSINO 0xa0 1350Sstevel@tonic-gate #define HVIO_INTR_GETVALID 0xa1 1360Sstevel@tonic-gate #define HVIO_INTR_SETVALID 0xa2 1370Sstevel@tonic-gate #define HVIO_INTR_GETSTATE 0xa3 1380Sstevel@tonic-gate #define HVIO_INTR_SETSTATE 0xa4 1390Sstevel@tonic-gate #define HVIO_INTR_GETTARGET 0xa5 1400Sstevel@tonic-gate #define HVIO_INTR_SETTARGET 0xa6 1410Sstevel@tonic-gate 1421991Sheppo #define VINTR_GET_COOKIE 0xa7 1431991Sheppo #define VINTR_SET_COOKIE 0xa8 1441991Sheppo #define VINTR_GET_VALID 0xa9 1451991Sheppo #define VINTR_SET_VALID 0xaa 1461991Sheppo #define VINTR_GET_STATE 0xab 1471991Sheppo #define VINTR_SET_STATE 0xac 1481991Sheppo #define VINTR_GET_TARGET 0xad 1491991Sheppo #define VINTR_SET_TARGET 0xae 1501991Sheppo 1511991Sheppo #define LDC_TX_QCONF 0xe0 1521991Sheppo #define LDC_TX_QINFO 0xe1 1531991Sheppo #define LDC_TX_GET_STATE 0xe2 1541991Sheppo #define LDC_TX_SET_QTAIL 0xe3 1551991Sheppo #define LDC_RX_QCONF 0xe4 1561991Sheppo #define LDC_RX_QINFO 0xe5 1571991Sheppo #define LDC_RX_GET_STATE 0xe6 1581991Sheppo #define LDC_RX_SET_QHEAD 0xe7 1591991Sheppo 1601991Sheppo #define LDC_SET_MAP_TABLE 0xea 1611991Sheppo #define LDC_GET_MAP_TABLE 0xeb 1621991Sheppo #define LDC_COPY 0xec 1631991Sheppo #define LDC_MAPIN 0xed 1641991Sheppo #define LDC_UNMAP 0xee 1651991Sheppo #define LDC_REVOKE 0xef 1661991Sheppo 1670Sstevel@tonic-gate #ifdef SET_MMU_STATS 1680Sstevel@tonic-gate #define MMU_STAT_AREA 0xfc 1690Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 1700Sstevel@tonic-gate 171624Sschwartz #define HV_RA2PA 0x200 172624Sschwartz #define HV_HPRIV 0x201 173624Sschwartz 1740Sstevel@tonic-gate /* 1751991Sheppo * Function numbers for CORE_TRAP. 1761991Sheppo */ 1771991Sheppo #define API_SET_VERSION 0x00 1781991Sheppo #define API_PUT_CHAR 0x01 1791991Sheppo #define API_EXIT 0x02 1801991Sheppo #define API_GET_VERSION 0x03 1811991Sheppo 1821991Sheppo 1831991Sheppo /* 184*3266Sjb145095 * Definitions for MACH_SOFT_STATE routines 185*3266Sjb145095 */ 186*3266Sjb145095 187*3266Sjb145095 #define SIS_NORMAL 0x01 188*3266Sjb145095 #define SIS_TRANSITION 0x02 189*3266Sjb145095 190*3266Sjb145095 /* 1910Sstevel@tonic-gate * Bits for MMU functions flags argument: 1920Sstevel@tonic-gate * arg3 of MMU_MAP_ADDR 1930Sstevel@tonic-gate * arg3 of MMU_DEMAP_CTX 1940Sstevel@tonic-gate * arg2 of MMU_DEMAP_ALL 1950Sstevel@tonic-gate */ 1960Sstevel@tonic-gate #define MAP_DTLB 0x1 1970Sstevel@tonic-gate #define MAP_ITLB 0x2 1980Sstevel@tonic-gate 1990Sstevel@tonic-gate 2000Sstevel@tonic-gate /* 2010Sstevel@tonic-gate * Interrupt state manipulation definitions. 2020Sstevel@tonic-gate */ 2030Sstevel@tonic-gate 2040Sstevel@tonic-gate #define HV_INTR_IDLE_STATE 0 2050Sstevel@tonic-gate #define HV_INTR_RECEIVED_STATE 1 2060Sstevel@tonic-gate #define HV_INTR_DELIVERED_STATE 2 2070Sstevel@tonic-gate 2080Sstevel@tonic-gate #define HV_INTR_NOTVALID 0 2090Sstevel@tonic-gate #define HV_INTR_VALID 1 2100Sstevel@tonic-gate 2110Sstevel@tonic-gate #ifndef _ASM 2120Sstevel@tonic-gate 2130Sstevel@tonic-gate /* 2140Sstevel@tonic-gate * TSB description structure for MMU_TSB_CTX0 and MMU_TSB_CTXNON0. 2150Sstevel@tonic-gate */ 2160Sstevel@tonic-gate typedef struct hv_tsb_info { 2170Sstevel@tonic-gate uint16_t hvtsb_idxpgsz; /* page size used to index TSB */ 2180Sstevel@tonic-gate uint16_t hvtsb_assoc; /* TSB associativity */ 2190Sstevel@tonic-gate uint32_t hvtsb_ntte; /* TSB size (#TTE entries) */ 2200Sstevel@tonic-gate uint32_t hvtsb_ctx_index; /* context reg index */ 2210Sstevel@tonic-gate uint32_t hvtsb_pgszs; /* sizes in use */ 2220Sstevel@tonic-gate uint64_t hvtsb_pa; /* real address of TSB base */ 2230Sstevel@tonic-gate uint64_t hvtsb_rsvd; /* reserved */ 2240Sstevel@tonic-gate } hv_tsb_info_t; 2250Sstevel@tonic-gate 2260Sstevel@tonic-gate #define HVTSB_SHARE_INDEX ((uint32_t)-1) 2270Sstevel@tonic-gate 2280Sstevel@tonic-gate #ifdef SET_MMU_STATS 2290Sstevel@tonic-gate #ifndef TTE4V_NPGSZ 2300Sstevel@tonic-gate #define TTE4V_NPGSZ 8 2310Sstevel@tonic-gate #endif /* TTE4V_NPGSZ */ 2320Sstevel@tonic-gate /* 2330Sstevel@tonic-gate * MMU statistics structure for MMU_STAT_AREA 2340Sstevel@tonic-gate */ 2350Sstevel@tonic-gate struct mmu_stat_one { 2360Sstevel@tonic-gate uint64_t hit_ctx0[TTE4V_NPGSZ]; 2370Sstevel@tonic-gate uint64_t hit_ctxn0[TTE4V_NPGSZ]; 2380Sstevel@tonic-gate uint64_t tsb_miss; 2390Sstevel@tonic-gate uint64_t tlb_miss; /* miss, no TSB set */ 2400Sstevel@tonic-gate uint64_t map_ctx0[TTE4V_NPGSZ]; 2410Sstevel@tonic-gate uint64_t map_ctxn0[TTE4V_NPGSZ]; 2420Sstevel@tonic-gate }; 2430Sstevel@tonic-gate 2440Sstevel@tonic-gate struct mmu_stat { 2450Sstevel@tonic-gate struct mmu_stat_one immu_stat; 2460Sstevel@tonic-gate struct mmu_stat_one dmmu_stat; 2470Sstevel@tonic-gate uint64_t set_ctx0; 2480Sstevel@tonic-gate uint64_t set_ctxn0; 2490Sstevel@tonic-gate }; 2500Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 2510Sstevel@tonic-gate 2521991Sheppo #endif /* ! _ASM */ 2530Sstevel@tonic-gate 2540Sstevel@tonic-gate /* 2550Sstevel@tonic-gate * CPU States 2560Sstevel@tonic-gate */ 2570Sstevel@tonic-gate #define CPU_STATE_INVALID 0x0 2581991Sheppo #define CPU_STATE_STOPPED 0x1 /* cpu not started */ 2591991Sheppo #define CPU_STATE_RUNNING 0x2 /* cpu running guest code */ 2600Sstevel@tonic-gate #define CPU_STATE_ERROR 0x3 /* cpu is in the error state */ 2610Sstevel@tonic-gate #define CPU_STATE_LAST_PUBLIC CPU_STATE_ERROR /* last valid state */ 2620Sstevel@tonic-gate 2630Sstevel@tonic-gate /* 2640Sstevel@tonic-gate * MMU fault status area 2650Sstevel@tonic-gate */ 2660Sstevel@tonic-gate 2670Sstevel@tonic-gate #define MMFSA_TYPE_ 0x00 /* fault type */ 2680Sstevel@tonic-gate #define MMFSA_ADDR_ 0x08 /* fault address */ 2690Sstevel@tonic-gate #define MMFSA_CTX_ 0x10 /* fault context */ 2700Sstevel@tonic-gate 2710Sstevel@tonic-gate #define MMFSA_I_ 0x00 /* start of fields for I */ 2720Sstevel@tonic-gate #define MMFSA_I_TYPE (MMFSA_I_ + MMFSA_TYPE_) /* instruction fault type */ 2730Sstevel@tonic-gate #define MMFSA_I_ADDR (MMFSA_I_ + MMFSA_ADDR_) /* instruction fault address */ 2740Sstevel@tonic-gate #define MMFSA_I_CTX (MMFSA_I_ + MMFSA_CTX_) /* instruction fault context */ 2750Sstevel@tonic-gate 2760Sstevel@tonic-gate #define MMFSA_D_ 0x40 /* start of fields for D */ 2770Sstevel@tonic-gate #define MMFSA_D_TYPE (MMFSA_D_ + MMFSA_TYPE_) /* data fault type */ 2780Sstevel@tonic-gate #define MMFSA_D_ADDR (MMFSA_D_ + MMFSA_ADDR_) /* data fault address */ 2790Sstevel@tonic-gate #define MMFSA_D_CTX (MMFSA_D_ + MMFSA_CTX_) /* data fault context */ 2800Sstevel@tonic-gate 2810Sstevel@tonic-gate #define MMFSA_F_FMISS 1 /* fast miss */ 2820Sstevel@tonic-gate #define MMFSA_F_FPROT 2 /* fast protection */ 2830Sstevel@tonic-gate #define MMFSA_F_MISS 3 /* mmu miss */ 2840Sstevel@tonic-gate #define MMFSA_F_INVRA 4 /* invalid RA */ 2850Sstevel@tonic-gate #define MMFSA_F_PRIV 5 /* privilege violation */ 2860Sstevel@tonic-gate #define MMFSA_F_PROT 6 /* protection violation */ 2870Sstevel@tonic-gate #define MMFSA_F_NFO 7 /* NFO access */ 2880Sstevel@tonic-gate #define MMFSA_F_SOPG 8 /* so page */ 2890Sstevel@tonic-gate #define MMFSA_F_INVVA 9 /* invalid VA */ 2900Sstevel@tonic-gate #define MMFSA_F_INVASI 10 /* invalid ASI */ 2910Sstevel@tonic-gate #define MMFSA_F_NCATM 11 /* non-cacheable atomic */ 2920Sstevel@tonic-gate #define MMFSA_F_PRVACT 12 /* privileged action */ 2930Sstevel@tonic-gate #define MMFSA_F_WPT 13 /* watchpoint hit */ 2940Sstevel@tonic-gate #define MMFSA_F_UNALIGN 14 /* unaligned access */ 2950Sstevel@tonic-gate #define MMFSA_F_INVPGSZ 15 /* invalid page size */ 2960Sstevel@tonic-gate 2970Sstevel@tonic-gate #define MMFSA_SIZE 0x80 /* in bytes, 64 byte aligned */ 2980Sstevel@tonic-gate 2990Sstevel@tonic-gate /* 3000Sstevel@tonic-gate * MMU fault status - MMFSA_IFS and MMFSA_DFS 3010Sstevel@tonic-gate */ 3020Sstevel@tonic-gate #define MMFS_FV 0x00000001 3030Sstevel@tonic-gate #define MMFS_OW 0x00000002 3040Sstevel@tonic-gate #define MMFS_W 0x00000004 3050Sstevel@tonic-gate #define MMFS_PR 0x00000008 3060Sstevel@tonic-gate #define MMFS_CT 0x00000030 3070Sstevel@tonic-gate #define MMFS_E 0x00000040 3080Sstevel@tonic-gate #define MMFS_FT 0x00003f80 3090Sstevel@tonic-gate #define MMFS_ME 0x00004000 3100Sstevel@tonic-gate #define MMFS_TM 0x00008000 3110Sstevel@tonic-gate #define MMFS_ASI 0x00ff0000 3120Sstevel@tonic-gate #define MMFS_NF 0x01000000 3130Sstevel@tonic-gate 3140Sstevel@tonic-gate /* 3150Sstevel@tonic-gate * DMA sync parameter definitions 3160Sstevel@tonic-gate */ 3170Sstevel@tonic-gate #define HVIO_DMA_SYNC_DIR_TO_DEV 0x01 3180Sstevel@tonic-gate #define HVIO_DMA_SYNC_DIR_FROM_DEV 0x02 3190Sstevel@tonic-gate 3201991Sheppo /* 3211991Sheppo * LDC Channel States 3221991Sheppo */ 3231991Sheppo #define LDC_CHANNEL_DOWN 0x0 3241991Sheppo #define LDC_CHANNEL_UP 0x1 3251991Sheppo #define LDC_CHANNEL_RESET 0x2 3261991Sheppo 3270Sstevel@tonic-gate #ifndef _ASM 3280Sstevel@tonic-gate 3290Sstevel@tonic-gate extern uint64_t hv_mmu_map_perm_addr(void *, int, uint64_t, int); 3300Sstevel@tonic-gate extern uint64_t hv_mmu_unmap_perm_addr(void *, int, int); 3311991Sheppo extern uint64_t hv_mach_exit(uint64_t exit_code); 3321991Sheppo extern uint64_t hv_mach_sir(void); 3331991Sheppo 3341991Sheppo extern uint64_t hv_cpu_start(uint64_t cpuid, uint64_t pc, uint64_t rtba, 3351991Sheppo uint64_t arg); 3361991Sheppo extern uint64_t hv_cpu_stop(uint64_t cpuid); 3371991Sheppo extern uint64_t hv_cpu_set_rtba(uint64_t *rtba); 3381991Sheppo 3390Sstevel@tonic-gate extern uint64_t hv_set_ctx0(uint64_t, uint64_t); 3400Sstevel@tonic-gate extern uint64_t hv_set_ctxnon0(uint64_t, uint64_t); 3411991Sheppo extern uint64_t hv_mmu_fault_area_conf(void *raddr); 3420Sstevel@tonic-gate #ifdef SET_MMU_STATS 3430Sstevel@tonic-gate extern uint64_t hv_mmu_set_stat_area(uint64_t, uint64_t); 3440Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 3450Sstevel@tonic-gate 3460Sstevel@tonic-gate extern uint64_t hv_cpu_qconf(int queue, uint64_t paddr, int size); 3471991Sheppo extern uint64_t hv_cpu_yield(void); 3480Sstevel@tonic-gate extern uint64_t hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state); 3490Sstevel@tonic-gate extern uint64_t hv_mem_scrub(uint64_t real_addr, uint64_t length, 3500Sstevel@tonic-gate uint64_t *scrubbed_len); 3510Sstevel@tonic-gate extern uint64_t hv_mem_sync(uint64_t real_addr, uint64_t length, 3520Sstevel@tonic-gate uint64_t *flushed_len); 3530Sstevel@tonic-gate 3540Sstevel@tonic-gate extern uint64_t hv_service_recv(uint64_t s_id, uint64_t buf_pa, 3550Sstevel@tonic-gate uint64_t size, uint64_t *recv_bytes); 3560Sstevel@tonic-gate extern uint64_t hv_service_send(uint64_t s_id, uint64_t buf_pa, 3570Sstevel@tonic-gate uint64_t size, uint64_t *send_bytes); 3580Sstevel@tonic-gate extern uint64_t hv_service_getstatus(uint64_t s_id, uint64_t *vreg); 359459Swh94709 extern uint64_t hv_service_setstatus(uint64_t s_id, uint64_t bits); 3600Sstevel@tonic-gate extern uint64_t hv_service_clrstatus(uint64_t s_id, uint64_t bits); 3610Sstevel@tonic-gate extern uint64_t hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep); 3620Sstevel@tonic-gate 3630Sstevel@tonic-gate extern uint64_t hv_ttrace_buf_info(uint64_t *, uint64_t *); 3640Sstevel@tonic-gate extern uint64_t hv_ttrace_buf_conf(uint64_t, uint64_t, uint64_t *); 3650Sstevel@tonic-gate extern uint64_t hv_ttrace_enable(uint64_t, uint64_t *); 3660Sstevel@tonic-gate extern uint64_t hv_ttrace_freeze(uint64_t, uint64_t *); 3670Sstevel@tonic-gate extern uint64_t hv_dump_buf_update(uint64_t, uint64_t, uint64_t *); 3682036Swentaoy extern uint64_t hv_mach_set_watchdog(uint64_t, uint64_t *); 3690Sstevel@tonic-gate 3700Sstevel@tonic-gate extern int64_t hv_cnputchar(uint8_t); 3710Sstevel@tonic-gate extern int64_t hv_cngetchar(uint8_t *); 3722282Sjb145095 extern int64_t hv_cnwrite(uint64_t, uint64_t, uint64_t *); 3732282Sjb145095 extern int64_t hv_cnread(uint64_t, uint64_t, int64_t *); 3740Sstevel@tonic-gate 3750Sstevel@tonic-gate extern uint64_t hv_tod_get(uint64_t *seconds); 3760Sstevel@tonic-gate extern uint64_t hv_tod_set(uint64_t); 3770Sstevel@tonic-gate 3780Sstevel@tonic-gate extern uint64_t hvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, 3790Sstevel@tonic-gate uint64_t *sysino); 3800Sstevel@tonic-gate extern uint64_t hvio_intr_getvalid(uint64_t sysino, 3811991Sheppo int *intr_valid_state); 3820Sstevel@tonic-gate extern uint64_t hvio_intr_setvalid(uint64_t sysino, 3831991Sheppo int intr_valid_state); 3840Sstevel@tonic-gate extern uint64_t hvio_intr_getstate(uint64_t sysino, 3851991Sheppo int *intr_state); 3860Sstevel@tonic-gate extern uint64_t hvio_intr_setstate(uint64_t sysino, int intr_state); 3870Sstevel@tonic-gate extern uint64_t hvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid); 3880Sstevel@tonic-gate extern uint64_t hvio_intr_settarget(uint64_t sysino, uint32_t cpuid); 389*3266Sjb145095 extern uint64_t hv_soft_state_set(uint64_t state, uint64_t string_ra); 390*3266Sjb145095 extern uint64_t hv_soft_state_get(uint64_t string_ra, uint64_t *state); 3911370Sschwartz 3921991Sheppo extern uint64_t hv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base, 3931991Sheppo uint64_t nentries); 3941991Sheppo extern uint64_t hv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base, 3951991Sheppo uint64_t *nentries); 3961991Sheppo extern uint64_t hv_ldc_tx_get_state(uint64_t channel, uint64_t *headp, 3971991Sheppo uint64_t *tailp, uint64_t *state); 3981991Sheppo extern uint64_t hv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail); 3991991Sheppo extern uint64_t hv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base, 4001991Sheppo uint64_t nentries); 4011991Sheppo extern uint64_t hv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base, 4021991Sheppo uint64_t *nentries); 4031991Sheppo extern uint64_t hv_ldc_rx_get_state(uint64_t channel, uint64_t *headp, 4041991Sheppo uint64_t *tailp, uint64_t *state); 4051991Sheppo extern uint64_t hv_ldc_rx_set_qhead(uint64_t channel, uint64_t head); 4061991Sheppo 4071991Sheppo extern uint64_t hv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra, 4081991Sheppo uint64_t tbl_entries); 4091991Sheppo extern uint64_t hv_ldc_get_map_table(uint64_t channel, uint64_t *tbl_ra, 4101991Sheppo uint64_t *tbl_entries); 4111991Sheppo extern uint64_t hv_ldc_copy(uint64_t channel, uint64_t request, 4121991Sheppo uint64_t cookie, uint64_t raddr, uint64_t length, uint64_t *lengthp); 4131991Sheppo extern uint64_t hv_ldc_mapin(uint64_t channel, uint64_t cookie, 4141991Sheppo uint64_t *raddr, uint64_t *perm); 4151991Sheppo extern uint64_t hv_ldc_unmap(uint64_t raddr); 4162531Snarayan extern uint64_t hv_ldc_revoke(uint64_t channel, uint64_t cookie, 4172531Snarayan uint64_t revoke_cookie); 4181991Sheppo extern uint64_t hv_api_get_version(uint64_t api_group, uint64_t *majorp, 4191991Sheppo uint64_t *minorp); 4201991Sheppo extern uint64_t hv_api_set_version(uint64_t api_group, uint64_t major, 4211991Sheppo uint64_t minor, uint64_t *supported_minor); 4221991Sheppo 4231991Sheppo extern uint64_t hvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino, 4241991Sheppo uint64_t *cookie); 4251991Sheppo extern uint64_t hvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino, 4261991Sheppo uint64_t cookie); 4271991Sheppo extern uint64_t hvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino, 4281991Sheppo int *intr_valid_state); 4291991Sheppo extern uint64_t hvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino, 4301991Sheppo int intr_valid_state); 4311991Sheppo extern uint64_t hvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino, 4321991Sheppo int *intr_state); 4331991Sheppo extern uint64_t hvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino, 4341991Sheppo int intr_state); 4351991Sheppo extern uint64_t hvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino, 4361991Sheppo uint32_t *cpuid); 4371991Sheppo extern uint64_t hvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino, 4381991Sheppo uint32_t cpuid); 4391991Sheppo 4401991Sheppo #endif /* ! _ASM */ 4411991Sheppo 4420Sstevel@tonic-gate 4430Sstevel@tonic-gate #ifdef __cplusplus 4440Sstevel@tonic-gate } 4450Sstevel@tonic-gate #endif 4460Sstevel@tonic-gate 4470Sstevel@tonic-gate #endif /* _SYS_HYPERVISOR_API_H */ 448