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 520Sstevel@tonic-gate /* 530Sstevel@tonic-gate * Error returns in %o0. 540Sstevel@tonic-gate * (Additional result is returned in %o1.) 550Sstevel@tonic-gate */ 560Sstevel@tonic-gate #define H_EOK 0 /* Successful return */ 570Sstevel@tonic-gate #define H_ENOCPU 1 /* Invalid CPU id */ 580Sstevel@tonic-gate #define H_ENORADDR 2 /* Invalid real address */ 590Sstevel@tonic-gate #define H_ENOINTR 3 /* Invalid interrupt id */ 600Sstevel@tonic-gate #define H_EBADPGSZ 4 /* Invalid pagesize encoding */ 610Sstevel@tonic-gate #define H_EBADTSB 5 /* Invalid TSB description */ 620Sstevel@tonic-gate #define H_EINVAL 6 /* Invalid argument */ 630Sstevel@tonic-gate #define H_EBADTRAP 7 /* Invalid function number */ 640Sstevel@tonic-gate #define H_EBADALIGN 8 /* Invalid address alignment */ 650Sstevel@tonic-gate #define H_EWOULDBLOCK 9 /* Cannot complete operation */ 660Sstevel@tonic-gate /* without blocking */ 670Sstevel@tonic-gate #define H_ENOACCESS 10 /* No access to resource */ 680Sstevel@tonic-gate #define H_EIO 11 /* I/O error */ 690Sstevel@tonic-gate #define H_ECPUERROR 12 /* CPU is in error state */ 700Sstevel@tonic-gate #define H_ENOTSUPPORTED 13 /* Function not supported */ 710Sstevel@tonic-gate #define H_ENOMAP 14 /* Mapping is not valid, */ 720Sstevel@tonic-gate /* no translation exists */ 73*1592Sgirish #define H_EBUSY 17 /* Resource busy */ 740Sstevel@tonic-gate 750Sstevel@tonic-gate #define H_BREAK -1 /* Console Break */ 760Sstevel@tonic-gate #define H_HUP -2 /* Console Break */ 771310Sha137994 781310Sha137994 /* 791310Sha137994 * Mondo CPU ID argument processing. 801310Sha137994 */ 811310Sha137994 #define HV_SEND_MONDO_ENTRYDONE 0xffff 821310Sha137994 830Sstevel@tonic-gate /* 840Sstevel@tonic-gate * Function numbers for FAST_TRAP. 850Sstevel@tonic-gate */ 860Sstevel@tonic-gate #define HV_MACH_EXIT 0x00 870Sstevel@tonic-gate #define HV_MACH_DESC 0x01 880Sstevel@tonic-gate #define HV_CPU_YIELD 0x12 890Sstevel@tonic-gate #define CPU_QCONF 0x14 900Sstevel@tonic-gate #define HV_CPU_STATE 0x17 910Sstevel@tonic-gate #define MMU_TSB_CTX0 0x20 920Sstevel@tonic-gate #define MMU_TSB_CTXNON0 0x21 930Sstevel@tonic-gate #define MMU_DEMAP_PAGE 0x22 940Sstevel@tonic-gate #define MMU_DEMAP_CTX 0x23 950Sstevel@tonic-gate #define MMU_DEMAP_ALL 0x24 960Sstevel@tonic-gate #define MAP_PERM_ADDR 0x25 970Sstevel@tonic-gate #define MMU_SET_INFOPTR 0x26 980Sstevel@tonic-gate #define UNMAP_PERM_ADDR 0x28 990Sstevel@tonic-gate #define HV_MEM_SCRUB 0x31 1000Sstevel@tonic-gate #define HV_MEM_SYNC 0x32 1010Sstevel@tonic-gate #define HV_INTR_SEND 0x42 1020Sstevel@tonic-gate #define TOD_GET 0x50 1030Sstevel@tonic-gate #define TOD_SET 0x51 1040Sstevel@tonic-gate #define CONS_READ 0x60 1050Sstevel@tonic-gate #define CONS_WRITE 0x61 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate #define SVC_SEND 0x80 1080Sstevel@tonic-gate #define SVC_RECV 0x81 1090Sstevel@tonic-gate #define SVC_GETSTATUS 0x82 1100Sstevel@tonic-gate #define SVC_SETSTATUS 0x83 1110Sstevel@tonic-gate #define SVC_CLRSTATUS 0x84 1120Sstevel@tonic-gate 1130Sstevel@tonic-gate #define TTRACE_BUF_CONF 0x90 1140Sstevel@tonic-gate #define TTRACE_BUF_INFO 0x91 1150Sstevel@tonic-gate #define TTRACE_ENABLE 0x92 1160Sstevel@tonic-gate #define TTRACE_FREEZE 0x93 1170Sstevel@tonic-gate 1180Sstevel@tonic-gate #define DUMP_BUF_UPDATE 0x94 1190Sstevel@tonic-gate 1200Sstevel@tonic-gate #define HVIO_INTR_DEVINO2SYSINO 0xa0 1210Sstevel@tonic-gate #define HVIO_INTR_GETVALID 0xa1 1220Sstevel@tonic-gate #define HVIO_INTR_SETVALID 0xa2 1230Sstevel@tonic-gate #define HVIO_INTR_GETSTATE 0xa3 1240Sstevel@tonic-gate #define HVIO_INTR_SETSTATE 0xa4 1250Sstevel@tonic-gate #define HVIO_INTR_GETTARGET 0xa5 1260Sstevel@tonic-gate #define HVIO_INTR_SETTARGET 0xa6 1270Sstevel@tonic-gate 1280Sstevel@tonic-gate #define HVIO_IOMMU_MAP 0xb0 1290Sstevel@tonic-gate #define HVIO_IOMMU_DEMAP 0xb1 1300Sstevel@tonic-gate #define HVIO_IOMMU_GETMAP 0xb2 1310Sstevel@tonic-gate #define HVIO_IOMMU_GETBYPASS 0xb3 1320Sstevel@tonic-gate 1330Sstevel@tonic-gate #define HVIO_CONFIG_GET 0xb4 1340Sstevel@tonic-gate #define HVIO_CONFIG_PUT 0xb5 1350Sstevel@tonic-gate 1360Sstevel@tonic-gate #define HVIO_PEEK 0xb6 1370Sstevel@tonic-gate #define HVIO_POKE 0xb7 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate #define HVIO_DMA_SYNC 0xb8 1400Sstevel@tonic-gate 1410Sstevel@tonic-gate #define HVIO_MSIQ_CONF 0xc0 1420Sstevel@tonic-gate #define HVIO_MSIQ_INFO 0xc1 1430Sstevel@tonic-gate #define HVIO_MSIQ_GETVALID 0xc2 1440Sstevel@tonic-gate #define HVIO_MSIQ_SETVALID 0xc3 1450Sstevel@tonic-gate #define HVIO_MSIQ_GETSTATE 0xc4 1460Sstevel@tonic-gate #define HVIO_MSIQ_SETSTATE 0xc5 1470Sstevel@tonic-gate #define HVIO_MSIQ_GETHEAD 0xc6 1480Sstevel@tonic-gate #define HVIO_MSIQ_SETHEAD 0xc7 1490Sstevel@tonic-gate #define HVIO_MSIQ_GETTAIL 0xc8 1500Sstevel@tonic-gate 1510Sstevel@tonic-gate #define HVIO_MSI_GETVALID 0xc9 1520Sstevel@tonic-gate #define HVIO_MSI_SETVALID 0xca 1530Sstevel@tonic-gate #define HVIO_MSI_GETMSIQ 0xcb 1540Sstevel@tonic-gate #define HVIO_MSI_SETMSIQ 0xcc 1550Sstevel@tonic-gate #define HVIO_MSI_GETSTATE 0xcd 1560Sstevel@tonic-gate #define HVIO_MSI_SETSTATE 0xce 1570Sstevel@tonic-gate 1580Sstevel@tonic-gate #define HVIO_MSG_GETMSIQ 0xd0 1590Sstevel@tonic-gate #define HVIO_MSG_SETMSIQ 0xd1 1600Sstevel@tonic-gate #define HVIO_MSG_GETVALID 0xd2 1610Sstevel@tonic-gate #define HVIO_MSG_SETVALID 0xd3 1620Sstevel@tonic-gate 1630Sstevel@tonic-gate #ifdef SET_MMU_STATS 1640Sstevel@tonic-gate #define MMU_STAT_AREA 0xfc 1650Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 1660Sstevel@tonic-gate 1670Sstevel@tonic-gate #define HV_NCS_REQUEST 0x110 1680Sstevel@tonic-gate 1691370Sschwartz #define FIRE_GET_PERFREG 0x120 1701370Sschwartz #define FIRE_SET_PERFREG 0x121 1711370Sschwartz 172624Sschwartz #define HV_RA2PA 0x200 173624Sschwartz #define HV_HPRIV 0x201 174624Sschwartz 1750Sstevel@tonic-gate /* 1760Sstevel@tonic-gate * Bits for MMU functions flags argument: 1770Sstevel@tonic-gate * arg3 of MMU_MAP_ADDR 1780Sstevel@tonic-gate * arg3 of MMU_DEMAP_CTX 1790Sstevel@tonic-gate * arg2 of MMU_DEMAP_ALL 1800Sstevel@tonic-gate */ 1810Sstevel@tonic-gate #define MAP_DTLB 0x1 1820Sstevel@tonic-gate #define MAP_ITLB 0x2 1830Sstevel@tonic-gate 1840Sstevel@tonic-gate 1850Sstevel@tonic-gate /* 1860Sstevel@tonic-gate * Interrupt state manipulation definitions. 1870Sstevel@tonic-gate */ 1880Sstevel@tonic-gate 1890Sstevel@tonic-gate #define HV_INTR_IDLE_STATE 0 1900Sstevel@tonic-gate #define HV_INTR_RECEIVED_STATE 1 1910Sstevel@tonic-gate #define HV_INTR_DELIVERED_STATE 2 1920Sstevel@tonic-gate 1930Sstevel@tonic-gate #define HV_INTR_NOTVALID 0 1940Sstevel@tonic-gate #define HV_INTR_VALID 1 1950Sstevel@tonic-gate 1960Sstevel@tonic-gate #ifndef _ASM 1970Sstevel@tonic-gate 1980Sstevel@tonic-gate /* 1990Sstevel@tonic-gate * TSB description structure for MMU_TSB_CTX0 and MMU_TSB_CTXNON0. 2000Sstevel@tonic-gate */ 2010Sstevel@tonic-gate typedef struct hv_tsb_info { 2020Sstevel@tonic-gate uint16_t hvtsb_idxpgsz; /* page size used to index TSB */ 2030Sstevel@tonic-gate uint16_t hvtsb_assoc; /* TSB associativity */ 2040Sstevel@tonic-gate uint32_t hvtsb_ntte; /* TSB size (#TTE entries) */ 2050Sstevel@tonic-gate uint32_t hvtsb_ctx_index; /* context reg index */ 2060Sstevel@tonic-gate uint32_t hvtsb_pgszs; /* sizes in use */ 2070Sstevel@tonic-gate uint64_t hvtsb_pa; /* real address of TSB base */ 2080Sstevel@tonic-gate uint64_t hvtsb_rsvd; /* reserved */ 2090Sstevel@tonic-gate } hv_tsb_info_t; 2100Sstevel@tonic-gate 2110Sstevel@tonic-gate #define HVTSB_SHARE_INDEX ((uint32_t)-1) 2120Sstevel@tonic-gate 2130Sstevel@tonic-gate #ifdef SET_MMU_STATS 2140Sstevel@tonic-gate #ifndef TTE4V_NPGSZ 2150Sstevel@tonic-gate #define TTE4V_NPGSZ 8 2160Sstevel@tonic-gate #endif /* TTE4V_NPGSZ */ 2170Sstevel@tonic-gate /* 2180Sstevel@tonic-gate * MMU statistics structure for MMU_STAT_AREA 2190Sstevel@tonic-gate */ 2200Sstevel@tonic-gate struct mmu_stat_one { 2210Sstevel@tonic-gate uint64_t hit_ctx0[TTE4V_NPGSZ]; 2220Sstevel@tonic-gate uint64_t hit_ctxn0[TTE4V_NPGSZ]; 2230Sstevel@tonic-gate uint64_t tsb_miss; 2240Sstevel@tonic-gate uint64_t tlb_miss; /* miss, no TSB set */ 2250Sstevel@tonic-gate uint64_t map_ctx0[TTE4V_NPGSZ]; 2260Sstevel@tonic-gate uint64_t map_ctxn0[TTE4V_NPGSZ]; 2270Sstevel@tonic-gate }; 2280Sstevel@tonic-gate 2290Sstevel@tonic-gate struct mmu_stat { 2300Sstevel@tonic-gate struct mmu_stat_one immu_stat; 2310Sstevel@tonic-gate struct mmu_stat_one dmmu_stat; 2320Sstevel@tonic-gate uint64_t set_ctx0; 2330Sstevel@tonic-gate uint64_t set_ctxn0; 2340Sstevel@tonic-gate }; 2350Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 2360Sstevel@tonic-gate 2370Sstevel@tonic-gate #endif /* _ASM */ 2380Sstevel@tonic-gate 2390Sstevel@tonic-gate /* 2400Sstevel@tonic-gate * CPU States 2410Sstevel@tonic-gate */ 2420Sstevel@tonic-gate #define CPU_STATE_INVALID 0x0 2430Sstevel@tonic-gate #define CPU_STATE_IDLE 0x1 /* cpu not started */ 2440Sstevel@tonic-gate #define CPU_STATE_GUEST 0x2 /* cpu running guest code */ 2450Sstevel@tonic-gate #define CPU_STATE_ERROR 0x3 /* cpu is in the error state */ 2460Sstevel@tonic-gate #define CPU_STATE_LAST_PUBLIC CPU_STATE_ERROR /* last valid state */ 2470Sstevel@tonic-gate 2480Sstevel@tonic-gate /* 2490Sstevel@tonic-gate * MMU fault status area 2500Sstevel@tonic-gate */ 2510Sstevel@tonic-gate 2520Sstevel@tonic-gate #define MMFSA_TYPE_ 0x00 /* fault type */ 2530Sstevel@tonic-gate #define MMFSA_ADDR_ 0x08 /* fault address */ 2540Sstevel@tonic-gate #define MMFSA_CTX_ 0x10 /* fault context */ 2550Sstevel@tonic-gate 2560Sstevel@tonic-gate #define MMFSA_I_ 0x00 /* start of fields for I */ 2570Sstevel@tonic-gate #define MMFSA_I_TYPE (MMFSA_I_ + MMFSA_TYPE_) /* instruction fault type */ 2580Sstevel@tonic-gate #define MMFSA_I_ADDR (MMFSA_I_ + MMFSA_ADDR_) /* instruction fault address */ 2590Sstevel@tonic-gate #define MMFSA_I_CTX (MMFSA_I_ + MMFSA_CTX_) /* instruction fault context */ 2600Sstevel@tonic-gate 2610Sstevel@tonic-gate #define MMFSA_D_ 0x40 /* start of fields for D */ 2620Sstevel@tonic-gate #define MMFSA_D_TYPE (MMFSA_D_ + MMFSA_TYPE_) /* data fault type */ 2630Sstevel@tonic-gate #define MMFSA_D_ADDR (MMFSA_D_ + MMFSA_ADDR_) /* data fault address */ 2640Sstevel@tonic-gate #define MMFSA_D_CTX (MMFSA_D_ + MMFSA_CTX_) /* data fault context */ 2650Sstevel@tonic-gate 2660Sstevel@tonic-gate #define MMFSA_F_FMISS 1 /* fast miss */ 2670Sstevel@tonic-gate #define MMFSA_F_FPROT 2 /* fast protection */ 2680Sstevel@tonic-gate #define MMFSA_F_MISS 3 /* mmu miss */ 2690Sstevel@tonic-gate #define MMFSA_F_INVRA 4 /* invalid RA */ 2700Sstevel@tonic-gate #define MMFSA_F_PRIV 5 /* privilege violation */ 2710Sstevel@tonic-gate #define MMFSA_F_PROT 6 /* protection violation */ 2720Sstevel@tonic-gate #define MMFSA_F_NFO 7 /* NFO access */ 2730Sstevel@tonic-gate #define MMFSA_F_SOPG 8 /* so page */ 2740Sstevel@tonic-gate #define MMFSA_F_INVVA 9 /* invalid VA */ 2750Sstevel@tonic-gate #define MMFSA_F_INVASI 10 /* invalid ASI */ 2760Sstevel@tonic-gate #define MMFSA_F_NCATM 11 /* non-cacheable atomic */ 2770Sstevel@tonic-gate #define MMFSA_F_PRVACT 12 /* privileged action */ 2780Sstevel@tonic-gate #define MMFSA_F_WPT 13 /* watchpoint hit */ 2790Sstevel@tonic-gate #define MMFSA_F_UNALIGN 14 /* unaligned access */ 2800Sstevel@tonic-gate #define MMFSA_F_INVPGSZ 15 /* invalid page size */ 2810Sstevel@tonic-gate 2820Sstevel@tonic-gate #define MMFSA_SIZE 0x80 /* in bytes, 64 byte aligned */ 2830Sstevel@tonic-gate 2840Sstevel@tonic-gate /* 2850Sstevel@tonic-gate * MMU fault status - MMFSA_IFS and MMFSA_DFS 2860Sstevel@tonic-gate */ 2870Sstevel@tonic-gate #define MMFS_FV 0x00000001 2880Sstevel@tonic-gate #define MMFS_OW 0x00000002 2890Sstevel@tonic-gate #define MMFS_W 0x00000004 2900Sstevel@tonic-gate #define MMFS_PR 0x00000008 2910Sstevel@tonic-gate #define MMFS_CT 0x00000030 2920Sstevel@tonic-gate #define MMFS_E 0x00000040 2930Sstevel@tonic-gate #define MMFS_FT 0x00003f80 2940Sstevel@tonic-gate #define MMFS_ME 0x00004000 2950Sstevel@tonic-gate #define MMFS_TM 0x00008000 2960Sstevel@tonic-gate #define MMFS_ASI 0x00ff0000 2970Sstevel@tonic-gate #define MMFS_NF 0x01000000 2980Sstevel@tonic-gate 2990Sstevel@tonic-gate /* 3000Sstevel@tonic-gate * DMA sync parameter definitions 3010Sstevel@tonic-gate */ 3020Sstevel@tonic-gate #define HVIO_DMA_SYNC_DIR_TO_DEV 0x01 3030Sstevel@tonic-gate #define HVIO_DMA_SYNC_DIR_FROM_DEV 0x02 3040Sstevel@tonic-gate 3051370Sschwartz /* 3061370Sschwartz * Performance counter register definitions. 3071370Sschwartz */ 3081370Sschwartz #define HVIO_FIRE_PERFREG_JBC_SEL 0 3091370Sschwartz #define HVIO_FIRE_PERFREG_JBC_CNT0 1 3101370Sschwartz #define HVIO_FIRE_PERFREG_JBC_CNT1 2 3111370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_IMU_SEL 3 3121370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_IMU_CNT0 4 3131370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_IMU_CNT1 5 3141370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_MMU_SEL 6 3151370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_MMU_CNT0 7 3161370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_MMU_CNT1 8 3171370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_TLU_SEL 9 3181370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_TLU_CNT0 10 3191370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_TLU_CNT1 11 3201370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_TLU_CNT2 12 3211370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_LNK_SEL 13 3221370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_LNK_CNT1 14 3231370Sschwartz #define HVIO_FIRE_PERFREG_PCIE_LNK_CNT2 15 3241370Sschwartz 3250Sstevel@tonic-gate #ifndef _ASM 3260Sstevel@tonic-gate 3270Sstevel@tonic-gate extern uint64_t hv_mmu_map_perm_addr(void *, int, uint64_t, int); 3280Sstevel@tonic-gate extern uint64_t hv_mmu_unmap_perm_addr(void *, int, int); 3290Sstevel@tonic-gate extern uint64_t hv_set_ctx0(uint64_t, uint64_t); 3300Sstevel@tonic-gate extern uint64_t hv_set_ctxnon0(uint64_t, uint64_t); 3310Sstevel@tonic-gate #ifdef SET_MMU_STATS 3320Sstevel@tonic-gate extern uint64_t hv_mmu_set_stat_area(uint64_t, uint64_t); 3330Sstevel@tonic-gate #endif /* SET_MMU_STATS */ 3340Sstevel@tonic-gate 3350Sstevel@tonic-gate extern uint64_t hv_cpu_qconf(int queue, uint64_t paddr, int size); 3360Sstevel@tonic-gate extern uint64_t hv_cpu_yield(); 3370Sstevel@tonic-gate 3380Sstevel@tonic-gate extern uint64_t hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state); 3390Sstevel@tonic-gate extern uint64_t hv_mem_scrub(uint64_t real_addr, uint64_t length, 3400Sstevel@tonic-gate uint64_t *scrubbed_len); 3410Sstevel@tonic-gate extern uint64_t hv_mem_sync(uint64_t real_addr, uint64_t length, 3420Sstevel@tonic-gate uint64_t *flushed_len); 3430Sstevel@tonic-gate 3440Sstevel@tonic-gate extern uint64_t hv_service_recv(uint64_t s_id, uint64_t buf_pa, 3450Sstevel@tonic-gate uint64_t size, uint64_t *recv_bytes); 3460Sstevel@tonic-gate extern uint64_t hv_service_send(uint64_t s_id, uint64_t buf_pa, 3470Sstevel@tonic-gate uint64_t size, uint64_t *send_bytes); 3480Sstevel@tonic-gate extern uint64_t hv_service_getstatus(uint64_t s_id, uint64_t *vreg); 349459Swh94709 extern uint64_t hv_service_setstatus(uint64_t s_id, uint64_t bits); 3500Sstevel@tonic-gate extern uint64_t hv_service_clrstatus(uint64_t s_id, uint64_t bits); 3510Sstevel@tonic-gate 3520Sstevel@tonic-gate extern uint64_t hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep); 3530Sstevel@tonic-gate 3540Sstevel@tonic-gate extern uint64_t hv_ttrace_buf_info(uint64_t *, uint64_t *); 3550Sstevel@tonic-gate extern uint64_t hv_ttrace_buf_conf(uint64_t, uint64_t, uint64_t *); 3560Sstevel@tonic-gate extern uint64_t hv_ttrace_enable(uint64_t, uint64_t *); 3570Sstevel@tonic-gate extern uint64_t hv_ttrace_freeze(uint64_t, uint64_t *); 3580Sstevel@tonic-gate extern uint64_t hv_dump_buf_update(uint64_t, uint64_t, uint64_t *); 3590Sstevel@tonic-gate 3600Sstevel@tonic-gate extern int64_t hv_cnputchar(uint8_t); 3610Sstevel@tonic-gate extern int64_t hv_cngetchar(uint8_t *); 3620Sstevel@tonic-gate 3630Sstevel@tonic-gate extern uint64_t hv_tod_get(uint64_t *seconds); 3640Sstevel@tonic-gate extern uint64_t hv_tod_set(uint64_t); 3650Sstevel@tonic-gate 3660Sstevel@tonic-gate extern uint64_t hvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, 3670Sstevel@tonic-gate uint64_t *sysino); 3680Sstevel@tonic-gate extern uint64_t hvio_intr_getvalid(uint64_t sysino, 3690Sstevel@tonic-gate int *intr_valid_state); 3700Sstevel@tonic-gate extern uint64_t hvio_intr_setvalid(uint64_t sysino, 3710Sstevel@tonic-gate int intr_valid_state); 3720Sstevel@tonic-gate extern uint64_t hvio_intr_getstate(uint64_t sysino, 3730Sstevel@tonic-gate int *intr_state); 3740Sstevel@tonic-gate extern uint64_t hvio_intr_setstate(uint64_t sysino, int intr_state); 3750Sstevel@tonic-gate extern uint64_t hvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid); 3760Sstevel@tonic-gate extern uint64_t hvio_intr_settarget(uint64_t sysino, uint32_t cpuid); 3771370Sschwartz 3780Sstevel@tonic-gate #endif 3790Sstevel@tonic-gate 3800Sstevel@tonic-gate #ifdef __cplusplus 3810Sstevel@tonic-gate } 3820Sstevel@tonic-gate #endif 3830Sstevel@tonic-gate 3840Sstevel@tonic-gate #endif /* _SYS_HYPERVISOR_API_H */ 385