144bb982bSgovinda/* 244bb982bSgovinda * CDDL HEADER START 344bb982bSgovinda * 444bb982bSgovinda * 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. 744bb982bSgovinda * 844bb982bSgovinda * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 944bb982bSgovinda * or http://www.opensolaris.org/os/licensing. 1044bb982bSgovinda * See the License for the specific language governing permissions 1144bb982bSgovinda * and limitations under the License. 1244bb982bSgovinda * 1344bb982bSgovinda * When distributing Covered Code, include this CDDL HEADER in each 1444bb982bSgovinda * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1544bb982bSgovinda * If applicable, add the following below this CDDL HEADER, with the 1644bb982bSgovinda * fields enclosed by brackets "[]" replaced with your own identifying 1744bb982bSgovinda * information: Portions Copyright [yyyy] [name of copyright owner] 1844bb982bSgovinda * 1944bb982bSgovinda * CDDL HEADER END 2044bb982bSgovinda */ 2144bb982bSgovinda/* 22*fc256490SJason Beloro * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2344bb982bSgovinda * Use is subject to license terms. 2444bb982bSgovinda */ 2544bb982bSgovinda 2644bb982bSgovinda 2744bb982bSgovinda/* 2844bb982bSgovinda * Hypervisor calls called by px nexus driver. 2944bb982bSgovinda*/ 3044bb982bSgovinda 3144bb982bSgovinda#include <sys/asm_linkage.h> 3244bb982bSgovinda#include <sys/hypervisor_api.h> 330ad689d6Sschwartz#include <sys/dditypes.h> 3444bb982bSgovinda#include <px_ioapi.h> 350ad689d6Sschwartz#include "px_lib4v.h" 3644bb982bSgovinda 3744bb982bSgovinda#if defined(lint) || defined(__lint) 3844bb982bSgovinda 3944bb982bSgovinda/*ARGSUSED*/ 4044bb982bSgovindauint64_t 4144bb982bSgovindahvio_iommu_map(devhandle_t dev_hdl, tsbid_t tsbid, pages_t pages, 4244bb982bSgovinda io_attributes_t attr, io_page_list_t *io_page_list_p, 4344bb982bSgovinda pages_t *pages_mapped) 4444bb982bSgovinda{ return (0); } 4544bb982bSgovinda 4644bb982bSgovinda/*ARGSUSED*/ 4744bb982bSgovindauint64_t 4844bb982bSgovindahvio_iommu_demap(devhandle_t dev_hdl, tsbid_t tsbid, pages_t pages, 4944bb982bSgovinda pages_t *pages_demapped) 5044bb982bSgovinda{ return (0); } 5144bb982bSgovinda 5244bb982bSgovinda/*ARGSUSED*/ 5344bb982bSgovindauint64_t 5444bb982bSgovindahvio_iommu_getmap(devhandle_t dev_hdl, tsbid_t tsbid, io_attributes_t *attr_p, 5544bb982bSgovinda r_addr_t *r_addr_p) 5644bb982bSgovinda{ return (0); } 5744bb982bSgovinda 5844bb982bSgovinda/*ARGSUSED*/ 5944bb982bSgovindauint64_t 6044bb982bSgovindahvio_iommu_getbypass(devhandle_t dev_hdl, r_addr_t ra, io_attributes_t attr, 6144bb982bSgovinda io_addr_t *io_addr_p) 6244bb982bSgovinda{ return (0); } 6344bb982bSgovinda 6444bb982bSgovinda/*ARGSUSED*/ 6544bb982bSgovindauint64_t 6644bb982bSgovindahvio_peek(devhandle_t dev_hdl, r_addr_t ra, size_t size, uint32_t *status, 6744bb982bSgovinda uint64_t *data_p) 6844bb982bSgovinda{ return (0); } 6944bb982bSgovinda 7044bb982bSgovinda/*ARGSUSED*/ 7144bb982bSgovindauint64_t 7244bb982bSgovindahvio_poke(devhandle_t dev_hdl, r_addr_t ra, uint64_t sizes, uint64_t data, 7344bb982bSgovinda r_addr_t ra2, uint32_t *rdbk_status) 7444bb982bSgovinda{ return (0); } 7544bb982bSgovinda 7644bb982bSgovinda/*ARGSUSED*/ 7744bb982bSgovindauint64_t 7844bb982bSgovindahvio_dma_sync(devhandle_t dev_hdl, r_addr_t ra, size_t num_bytes, 790ad689d6Sschwartz io_sync_direction_t io_sync_direction, size_t *bytes_synched) 8044bb982bSgovinda{ return (0); } 8144bb982bSgovinda 8244bb982bSgovinda/*ARGSUSED*/ 8344bb982bSgovindauint64_t 8444bb982bSgovindahvio_msiq_conf(devhandle_t dev_hdl, msiqid_t msiq_id, r_addr_t ra, 8544bb982bSgovinda uint_t msiq_rec_cnt) 8644bb982bSgovinda{ return (0); } 8744bb982bSgovinda 8844bb982bSgovinda/*ARGSUSED*/ 8944bb982bSgovindauint64_t 9044bb982bSgovindahvio_msiq_info(devhandle_t dev_hdl, msiqid_t msiq_id, r_addr_t *r_addr_p, 9144bb982bSgovinda uint_t *msiq_rec_cnt_p) 9244bb982bSgovinda{ return (0); } 9344bb982bSgovinda 9444bb982bSgovinda/*ARGSUSED*/ 9544bb982bSgovindauint64_t 9644bb982bSgovindahvio_msiq_getvalid(devhandle_t dev_hdl, msiqid_t msiq_id, 9744bb982bSgovinda pci_msiq_valid_state_t *msiq_valid_state) 9844bb982bSgovinda{ return (0); } 9944bb982bSgovinda 10044bb982bSgovinda/*ARGSUSED*/ 10144bb982bSgovindauint64_t 10244bb982bSgovindahvio_msiq_setvalid(devhandle_t dev_hdl, msiqid_t msiq_id, 10344bb982bSgovinda pci_msiq_valid_state_t msiq_valid_state) 10444bb982bSgovinda{ return (0); } 10544bb982bSgovinda 10644bb982bSgovinda/*ARGSUSED*/ 10744bb982bSgovindauint64_t 10844bb982bSgovindahvio_msiq_getstate(devhandle_t dev_hdl, msiqid_t msiq_id, 10944bb982bSgovinda pci_msiq_state_t *msiq_state) 11044bb982bSgovinda{ return (0); } 11144bb982bSgovinda 11244bb982bSgovinda/*ARGSUSED*/ 11344bb982bSgovindauint64_t 11444bb982bSgovindahvio_msiq_setstate(devhandle_t dev_hdl, msiqid_t msiq_id, 11544bb982bSgovinda pci_msiq_state_t msiq_state) 11644bb982bSgovinda{ return (0); } 11744bb982bSgovinda 11844bb982bSgovinda/*ARGSUSED*/ 11944bb982bSgovindauint64_t 12044bb982bSgovindahvio_msiq_gethead(devhandle_t dev_hdl, msiqid_t msiq_id, 12144bb982bSgovinda msiqhead_t *msiq_head) 12244bb982bSgovinda{ return (0); } 12344bb982bSgovinda 12444bb982bSgovinda/*ARGSUSED*/ 12544bb982bSgovindauint64_t 12644bb982bSgovindahvio_msiq_sethead(devhandle_t dev_hdl, msiqid_t msiq_id, 12744bb982bSgovinda msiqhead_t msiq_head) 12844bb982bSgovinda{ return (0); } 12944bb982bSgovinda 13044bb982bSgovinda/*ARGSUSED*/ 13144bb982bSgovindauint64_t 13244bb982bSgovindahvio_msiq_gettail(devhandle_t dev_hdl, msiqid_t msiq_id, 13344bb982bSgovinda msiqtail_t *msiq_tail) 13444bb982bSgovinda{ return (0); } 13544bb982bSgovinda 13644bb982bSgovinda/*ARGSUSED*/ 13744bb982bSgovindauint64_t 13844bb982bSgovindahvio_msi_getmsiq(devhandle_t dev_hdl, msinum_t msi_num, 13944bb982bSgovinda msiqid_t *msiq_id) 14044bb982bSgovinda{ return (0); } 14144bb982bSgovinda 14244bb982bSgovinda/*ARGSUSED*/ 14344bb982bSgovindauint64_t 14444bb982bSgovindahvio_msi_setmsiq(devhandle_t dev_hdl, msinum_t msi_num, 14544bb982bSgovinda msiqid_t msiq_id, msi_type_t msitype) 14644bb982bSgovinda{ return (0); } 14744bb982bSgovinda 14844bb982bSgovinda/*ARGSUSED*/ 14944bb982bSgovindauint64_t 15044bb982bSgovindahvio_msi_getvalid(devhandle_t dev_hdl, msinum_t msi_num, 15144bb982bSgovinda pci_msi_valid_state_t *msi_valid_state) 15244bb982bSgovinda{ return (0); } 15344bb982bSgovinda 15444bb982bSgovinda/*ARGSUSED*/ 15544bb982bSgovindauint64_t 15644bb982bSgovindahvio_msi_setvalid(devhandle_t dev_hdl, msinum_t msi_num, 15744bb982bSgovinda pci_msi_valid_state_t msi_valid_state) 15844bb982bSgovinda{ return (0); } 15944bb982bSgovinda 16044bb982bSgovinda/*ARGSUSED*/ 16144bb982bSgovindauint64_t 16244bb982bSgovindahvio_msi_getstate(devhandle_t dev_hdl, msinum_t msi_num, 16344bb982bSgovinda pci_msi_state_t *msi_state) 16444bb982bSgovinda{ return (0); } 16544bb982bSgovinda 16644bb982bSgovinda/*ARGSUSED*/ 16744bb982bSgovindauint64_t 16844bb982bSgovindahvio_msi_setstate(devhandle_t dev_hdl, msinum_t msi_num, 16944bb982bSgovinda pci_msi_state_t msi_state) 17044bb982bSgovinda{ return (0); } 17144bb982bSgovinda 17244bb982bSgovinda/*ARGSUSED*/ 17344bb982bSgovindauint64_t 17444bb982bSgovindahvio_msg_getmsiq(devhandle_t dev_hdl, pcie_msg_type_t msg_type, 17544bb982bSgovinda msiqid_t *msiq_id) 17644bb982bSgovinda{ return (0); } 17744bb982bSgovinda 17844bb982bSgovinda/*ARGSUSED*/ 17944bb982bSgovindauint64_t 18044bb982bSgovindahvio_msg_setmsiq(devhandle_t dev_hdl, pcie_msg_type_t msg_type, 18144bb982bSgovinda msiqid_t msiq_id) 18244bb982bSgovinda{ return (0); } 18344bb982bSgovinda 18444bb982bSgovinda/*ARGSUSED*/ 18544bb982bSgovindauint64_t 18644bb982bSgovindahvio_msg_getvalid(devhandle_t dev_hdl, pcie_msg_type_t msg_type, 18744bb982bSgovinda pcie_msg_valid_state_t *msg_valid_state) 18844bb982bSgovinda{ return (0); } 18944bb982bSgovinda 19044bb982bSgovinda/*ARGSUSED*/ 19144bb982bSgovindauint64_t 19244bb982bSgovindahvio_msg_setvalid(devhandle_t dev_hdl, pcie_msg_type_t msg_type, 19344bb982bSgovinda pcie_msg_valid_state_t msg_valid_state) 19444bb982bSgovinda{ return (0); } 19544bb982bSgovinda 196*fc256490SJason Beloro/*ARGSUSED*/ 197*fc256490SJason Belorouint64_t 198*fc256490SJason Beloropci_error_send(devhandle_t dev_hdl, devino_t devino, pci_device_t bdf) 199*fc256490SJason Beloro{ return (0); } 200*fc256490SJason Beloro 20144bb982bSgovinda/* 20244bb982bSgovinda * First arg to both of these functions is a dummy, to accomodate how 20344bb982bSgovinda * hv_hpriv() works. 20444bb982bSgovinda */ 20544bb982bSgovinda/*ARGSUSED*/ 20644bb982bSgovindaint 20744bb982bSgovindapx_phys_acc_4v(uint64_t dummy, uint64_t from_addr, uint64_t to_addr) 20844bb982bSgovinda{ return (0); } 20944bb982bSgovinda 210*fc256490SJason Beloro/*ARGSUSED*/ 211*fc256490SJason Belorouint64_t 212*fc256490SJason Beloropci_iov_root_configured(devhandle_t dev_hdl) 213*fc256490SJason Beloro{ return (0); } 214*fc256490SJason Beloro 21544bb982bSgovinda#else /* lint || __lint */ 21644bb982bSgovinda 21744bb982bSgovinda /* 21844bb982bSgovinda * arg0 - devhandle 21944bb982bSgovinda * arg1 - tsbid 22044bb982bSgovinda * arg2 - pages 22144bb982bSgovinda * arg3 - io_attributes 22244bb982bSgovinda * arg4 - io_page_list_p 22344bb982bSgovinda * 22444bb982bSgovinda * ret1 - pages_mapped 22544bb982bSgovinda */ 22644bb982bSgovinda ENTRY(hvio_iommu_map) 22744bb982bSgovinda save %sp, -SA(MINFRAME64), %sp 22844bb982bSgovinda mov %i0, %o0 22944bb982bSgovinda mov %i1, %o1 23044bb982bSgovinda mov %i2, %o2 23144bb982bSgovinda mov %i3, %o3 23244bb982bSgovinda mov %i4, %o4 23344bb982bSgovinda mov HVIO_IOMMU_MAP, %o5 23444bb982bSgovinda ta FAST_TRAP 23544bb982bSgovinda brnz %o0, 1f 23644bb982bSgovinda mov %o0, %i0 23744bb982bSgovinda stuw %o1, [%i5] 23844bb982bSgovinda1: 23944bb982bSgovinda ret 24044bb982bSgovinda restore 24144bb982bSgovinda SET_SIZE(hvio_iommu_map) 24244bb982bSgovinda 24344bb982bSgovinda /* 24444bb982bSgovinda * arg0 - devhandle 24544bb982bSgovinda * arg1 - tsbid 24644bb982bSgovinda * arg2 - pages 24744bb982bSgovinda * 24844bb982bSgovinda * ret1 - pages_demapped 24944bb982bSgovinda */ 25044bb982bSgovinda ENTRY(hvio_iommu_demap) 25144bb982bSgovinda mov HVIO_IOMMU_DEMAP, %o5 25244bb982bSgovinda ta FAST_TRAP 25344bb982bSgovinda brz,a %o0, 1f 25444bb982bSgovinda stuw %o1, [%o3] 25544bb982bSgovinda1: retl 25644bb982bSgovinda nop 25744bb982bSgovinda SET_SIZE(hvio_iommu_demap) 25844bb982bSgovinda 25944bb982bSgovinda /* 26044bb982bSgovinda * arg0 - devhandle 26144bb982bSgovinda * arg1 - tsbid 26244bb982bSgovinda * 26344bb982bSgovinda * 26444bb982bSgovinda * ret0 - status 26544bb982bSgovinda * ret1 - io_attributes 26644bb982bSgovinda * ret2 - r_addr 26744bb982bSgovinda */ 26844bb982bSgovinda ENTRY(hvio_iommu_getmap) 26944bb982bSgovinda mov %o2, %o4 27044bb982bSgovinda mov HVIO_IOMMU_GETMAP, %o5 27144bb982bSgovinda ta FAST_TRAP 27244bb982bSgovinda brnz %o0, 1f 27344bb982bSgovinda nop 27444bb982bSgovinda stx %o2, [%o3] 27544bb982bSgovinda st %o1, [%o4] 27644bb982bSgovinda1: 27744bb982bSgovinda retl 27844bb982bSgovinda nop 27944bb982bSgovinda SET_SIZE(hvio_iommu_getmap) 28044bb982bSgovinda 28144bb982bSgovinda /* 28244bb982bSgovinda * arg0 - devhandle 28344bb982bSgovinda * arg1 - r_addr 28444bb982bSgovinda * arg2 - io_attributes 28544bb982bSgovinda * 28644bb982bSgovinda * 28744bb982bSgovinda * ret0 - status 28844bb982bSgovinda * ret1 - io_addr 28944bb982bSgovinda */ 29044bb982bSgovinda ENTRY(hvio_iommu_getbypass) 29144bb982bSgovinda mov HVIO_IOMMU_GETBYPASS, %o5 29244bb982bSgovinda ta FAST_TRAP 29344bb982bSgovinda brz,a %o0, 1f 29444bb982bSgovinda stx %o1, [%o3] 29544bb982bSgovinda1: retl 29644bb982bSgovinda nop 29744bb982bSgovinda SET_SIZE(hvio_iommu_getbypass) 29844bb982bSgovinda 29944bb982bSgovinda /* 30044bb982bSgovinda * arg0 - devhandle 30144bb982bSgovinda * arg1 - r_addr 30244bb982bSgovinda * arg2 - size 30344bb982bSgovinda * 30444bb982bSgovinda * ret1 - error_flag 30544bb982bSgovinda * ret2 - data 30644bb982bSgovinda */ 30744bb982bSgovinda ENTRY(hvio_peek) 30844bb982bSgovinda mov HVIO_PEEK, %o5 30944bb982bSgovinda ta FAST_TRAP 31044bb982bSgovinda brnz %o0, 1f 31144bb982bSgovinda nop 31244bb982bSgovinda stx %o2, [%o4] 31344bb982bSgovinda st %o1, [%o3] 31444bb982bSgovinda1: 31544bb982bSgovinda retl 31644bb982bSgovinda nop 31744bb982bSgovinda SET_SIZE(hvio_peek) 31844bb982bSgovinda 31944bb982bSgovinda /* 32044bb982bSgovinda * arg0 - devhandle 32144bb982bSgovinda * arg1 - r_addr 32244bb982bSgovinda * arg2 - sizes 32344bb982bSgovinda * arg3 - data 32444bb982bSgovinda * arg4 - r_addr2 32544bb982bSgovinda * 32644bb982bSgovinda * ret1 - error_flag 32744bb982bSgovinda */ 32844bb982bSgovinda ENTRY(hvio_poke) 32944bb982bSgovinda save %sp, -SA(MINFRAME64), %sp 33044bb982bSgovinda mov %i0, %o0 33144bb982bSgovinda mov %i1, %o1 33244bb982bSgovinda mov %i2, %o2 33344bb982bSgovinda mov %i3, %o3 33444bb982bSgovinda mov %i4, %o4 33544bb982bSgovinda mov HVIO_POKE, %o5 33644bb982bSgovinda ta FAST_TRAP 33744bb982bSgovinda brnz %o0, 1f 33844bb982bSgovinda mov %o0, %i0 33944bb982bSgovinda stuw %o1, [%i5] 34044bb982bSgovinda1: 34144bb982bSgovinda ret 34244bb982bSgovinda restore 34344bb982bSgovinda SET_SIZE(hvio_poke) 34444bb982bSgovinda 34544bb982bSgovinda /* 34644bb982bSgovinda * arg0 - devhandle 34744bb982bSgovinda * arg1 - r_addr 34844bb982bSgovinda * arg2 - num_bytes 34944bb982bSgovinda * arg3 - io_sync_direction 35044bb982bSgovinda * 35144bb982bSgovinda * ret0 - status 35244bb982bSgovinda * ret1 - bytes_synched 35344bb982bSgovinda */ 35444bb982bSgovinda ENTRY(hvio_dma_sync) 35544bb982bSgovinda mov HVIO_DMA_SYNC, %o5 35644bb982bSgovinda ta FAST_TRAP 35744bb982bSgovinda brz,a %o0, 1f 35844bb982bSgovinda stx %o1, [%o4] 35944bb982bSgovinda1: retl 36044bb982bSgovinda nop 36144bb982bSgovinda SET_SIZE(hvio_dma_sync) 36244bb982bSgovinda 36344bb982bSgovinda /* 36444bb982bSgovinda * arg0 - devhandle 36544bb982bSgovinda * arg1 - msiq_id 36644bb982bSgovinda * arg2 - r_addr 36744bb982bSgovinda * arg3 - nentries 36844bb982bSgovinda * 36944bb982bSgovinda * ret0 - status 37044bb982bSgovinda */ 37144bb982bSgovinda ENTRY(hvio_msiq_conf) 37244bb982bSgovinda mov HVIO_MSIQ_CONF, %o5 37344bb982bSgovinda ta FAST_TRAP 37444bb982bSgovinda retl 37544bb982bSgovinda nop 37644bb982bSgovinda SET_SIZE(hvio_msiq_conf) 37744bb982bSgovinda 37844bb982bSgovinda /* 37944bb982bSgovinda * arg0 - devhandle 38044bb982bSgovinda * arg1 - msiq_id 38144bb982bSgovinda * 38244bb982bSgovinda * ret0 - status 38344bb982bSgovinda * ret1 - r_addr 38444bb982bSgovinda * ret1 - nentries 38544bb982bSgovinda */ 38644bb982bSgovinda ENTRY(hvio_msiq_info) 38744bb982bSgovinda mov %o2, %o4 38844bb982bSgovinda mov HVIO_MSIQ_INFO, %o5 38944bb982bSgovinda ta FAST_TRAP 390c9eab9d4SDaniel Ice brnz %o0, 1f 39144bb982bSgovinda nop 39244bb982bSgovinda stx %o1, [%o4] 39344bb982bSgovinda stuw %o2, [%o3] 39444bb982bSgovinda1: retl 39544bb982bSgovinda nop 39644bb982bSgovinda SET_SIZE(hvio_msiq_info) 39744bb982bSgovinda 39844bb982bSgovinda /* 39944bb982bSgovinda * arg0 - devhandle 40044bb982bSgovinda * arg1 - msiq_id 40144bb982bSgovinda * 40244bb982bSgovinda * ret0 - status 40344bb982bSgovinda * ret1 - msiq_valid_state 40444bb982bSgovinda */ 40544bb982bSgovinda ENTRY(hvio_msiq_getvalid) 40644bb982bSgovinda mov HVIO_MSIQ_GETVALID, %o5 40744bb982bSgovinda ta FAST_TRAP 40844bb982bSgovinda brz,a %o0, 1f 40944bb982bSgovinda stuw %o1, [%o2] 41044bb982bSgovinda1: retl 41144bb982bSgovinda nop 41244bb982bSgovinda SET_SIZE(hvio_msiq_getvalid) 41344bb982bSgovinda 41444bb982bSgovinda /* 41544bb982bSgovinda * arg0 - devhandle 41644bb982bSgovinda * arg1 - msiq_id 41744bb982bSgovinda * arg2 - msiq_valid_state 41844bb982bSgovinda * 41944bb982bSgovinda * ret0 - status 42044bb982bSgovinda */ 42144bb982bSgovinda ENTRY(hvio_msiq_setvalid) 42244bb982bSgovinda mov HVIO_MSIQ_SETVALID, %o5 42344bb982bSgovinda ta FAST_TRAP 42444bb982bSgovinda retl 42544bb982bSgovinda nop 42644bb982bSgovinda SET_SIZE(hvio_msiq_setvalid) 42744bb982bSgovinda 42844bb982bSgovinda /* 42944bb982bSgovinda * arg0 - devhandle 43044bb982bSgovinda * arg1 - msiq_id 43144bb982bSgovinda * 43244bb982bSgovinda * ret0 - status 43344bb982bSgovinda * ret1 - msiq_state 43444bb982bSgovinda */ 43544bb982bSgovinda ENTRY(hvio_msiq_getstate) 43644bb982bSgovinda mov HVIO_MSIQ_GETSTATE, %o5 43744bb982bSgovinda ta FAST_TRAP 43844bb982bSgovinda brz,a %o0, 1f 43944bb982bSgovinda stuw %o1, [%o2] 44044bb982bSgovinda1: retl 44144bb982bSgovinda nop 44244bb982bSgovinda SET_SIZE(hvio_msiq_getstate) 44344bb982bSgovinda 44444bb982bSgovinda /* 44544bb982bSgovinda * arg0 - devhandle 44644bb982bSgovinda * arg1 - msiq_id 44744bb982bSgovinda * arg2 - msiq_state 44844bb982bSgovinda * 44944bb982bSgovinda * ret0 - status 45044bb982bSgovinda */ 45144bb982bSgovinda ENTRY(hvio_msiq_setstate) 45244bb982bSgovinda mov HVIO_MSIQ_SETSTATE, %o5 45344bb982bSgovinda ta FAST_TRAP 45444bb982bSgovinda retl 45544bb982bSgovinda nop 45644bb982bSgovinda SET_SIZE(hvio_msiq_setstate) 45744bb982bSgovinda 45844bb982bSgovinda /* 45944bb982bSgovinda * arg0 - devhandle 46044bb982bSgovinda * arg1 - msiq_id 46144bb982bSgovinda * 46244bb982bSgovinda * ret0 - status 46344bb982bSgovinda * ret1 - msiq_head 46444bb982bSgovinda */ 46544bb982bSgovinda ENTRY(hvio_msiq_gethead) 46644bb982bSgovinda mov HVIO_MSIQ_GETHEAD, %o5 46744bb982bSgovinda ta FAST_TRAP 46844bb982bSgovinda brz,a %o0, 1f 46944bb982bSgovinda stx %o1, [%o2] 47044bb982bSgovinda1: retl 47144bb982bSgovinda nop 47244bb982bSgovinda SET_SIZE(hvio_msiq_gethead) 47344bb982bSgovinda 47444bb982bSgovinda /* 47544bb982bSgovinda * arg0 - devhandle 47644bb982bSgovinda * arg1 - msiq_id 47744bb982bSgovinda * arg2 - msiq_head 47844bb982bSgovinda * 47944bb982bSgovinda * ret0 - status 48044bb982bSgovinda */ 48144bb982bSgovinda ENTRY(hvio_msiq_sethead) 48244bb982bSgovinda mov HVIO_MSIQ_SETHEAD, %o5 48344bb982bSgovinda ta FAST_TRAP 48444bb982bSgovinda retl 48544bb982bSgovinda nop 48644bb982bSgovinda SET_SIZE(hvio_msiq_sethead) 48744bb982bSgovinda 48844bb982bSgovinda /* 48944bb982bSgovinda * arg0 - devhandle 49044bb982bSgovinda * arg1 - msiq_id 49144bb982bSgovinda * 49244bb982bSgovinda * ret0 - status 49344bb982bSgovinda * ret1 - msiq_tail 49444bb982bSgovinda */ 49544bb982bSgovinda ENTRY(hvio_msiq_gettail) 49644bb982bSgovinda mov HVIO_MSIQ_GETTAIL, %o5 49744bb982bSgovinda ta FAST_TRAP 49844bb982bSgovinda brz,a %o0, 1f 49944bb982bSgovinda stx %o1, [%o2] 50044bb982bSgovinda1: retl 50144bb982bSgovinda nop 50244bb982bSgovinda SET_SIZE(hvio_msiq_gettail) 50344bb982bSgovinda 50444bb982bSgovinda /* 50544bb982bSgovinda * arg0 - devhandle 50644bb982bSgovinda * arg1 - msi_num 50744bb982bSgovinda * 50844bb982bSgovinda * ret0 - status 50944bb982bSgovinda * ret1 - msiq_id 51044bb982bSgovinda */ 51144bb982bSgovinda ENTRY(hvio_msi_getmsiq) 51244bb982bSgovinda mov HVIO_MSI_GETMSIQ, %o5 51344bb982bSgovinda ta FAST_TRAP 51444bb982bSgovinda brz,a %o0, 1f 51544bb982bSgovinda stuw %o1, [%o2] 51644bb982bSgovinda1: retl 51744bb982bSgovinda nop 51844bb982bSgovinda SET_SIZE(hvio_msi_getmsiq) 51944bb982bSgovinda 52044bb982bSgovinda /* 52144bb982bSgovinda * arg0 - devhandle 52244bb982bSgovinda * arg1 - msi_num 52344bb982bSgovinda * arg2 - msiq_id 52444bb982bSgovinda * arg2 - msitype 52544bb982bSgovinda * 52644bb982bSgovinda * ret0 - status 52744bb982bSgovinda */ 52844bb982bSgovinda ENTRY(hvio_msi_setmsiq) 52944bb982bSgovinda mov HVIO_MSI_SETMSIQ, %o5 53044bb982bSgovinda ta FAST_TRAP 53144bb982bSgovinda retl 53244bb982bSgovinda nop 53344bb982bSgovinda SET_SIZE(hvio_msi_setmsiq) 53444bb982bSgovinda 53544bb982bSgovinda /* 53644bb982bSgovinda * arg0 - devhandle 53744bb982bSgovinda * arg1 - msi_num 53844bb982bSgovinda * 53944bb982bSgovinda * ret0 - status 54044bb982bSgovinda * ret1 - msi_valid_state 54144bb982bSgovinda */ 54244bb982bSgovinda ENTRY(hvio_msi_getvalid) 54344bb982bSgovinda mov HVIO_MSI_GETVALID, %o5 54444bb982bSgovinda ta FAST_TRAP 54544bb982bSgovinda brz,a %o0, 1f 54644bb982bSgovinda stuw %o1, [%o2] 54744bb982bSgovinda1: retl 54844bb982bSgovinda nop 54944bb982bSgovinda SET_SIZE(hvio_msi_getvalid) 55044bb982bSgovinda 55144bb982bSgovinda /* 55244bb982bSgovinda * arg0 - devhandle 55344bb982bSgovinda * arg1 - msi_num 55444bb982bSgovinda * arg2 - msi_valid_state 55544bb982bSgovinda * 55644bb982bSgovinda * ret0 - status 55744bb982bSgovinda */ 55844bb982bSgovinda ENTRY(hvio_msi_setvalid) 55944bb982bSgovinda mov HVIO_MSI_SETVALID, %o5 56044bb982bSgovinda ta FAST_TRAP 56144bb982bSgovinda retl 56244bb982bSgovinda nop 56344bb982bSgovinda SET_SIZE(hvio_msi_setvalid) 56444bb982bSgovinda 56544bb982bSgovinda /* 56644bb982bSgovinda * arg0 - devhandle 56744bb982bSgovinda * arg1 - msi_num 56844bb982bSgovinda * 56944bb982bSgovinda * ret0 - status 57044bb982bSgovinda * ret1 - msi_state 57144bb982bSgovinda */ 57244bb982bSgovinda ENTRY(hvio_msi_getstate) 57344bb982bSgovinda mov HVIO_MSI_GETSTATE, %o5 57444bb982bSgovinda ta FAST_TRAP 57544bb982bSgovinda brz,a %o0, 1f 57644bb982bSgovinda stuw %o1, [%o2] 57744bb982bSgovinda1: retl 57844bb982bSgovinda nop 57944bb982bSgovinda SET_SIZE(hvio_msi_getstate) 58044bb982bSgovinda 58144bb982bSgovinda /* 58244bb982bSgovinda * arg0 - devhandle 58344bb982bSgovinda * arg1 - msi_num 58444bb982bSgovinda * arg2 - msi_state 58544bb982bSgovinda * 58644bb982bSgovinda * ret0 - status 58744bb982bSgovinda */ 58844bb982bSgovinda ENTRY(hvio_msi_setstate) 58944bb982bSgovinda mov HVIO_MSI_SETSTATE, %o5 59044bb982bSgovinda ta FAST_TRAP 59144bb982bSgovinda retl 59244bb982bSgovinda nop 59344bb982bSgovinda SET_SIZE(hvio_msi_setstate) 59444bb982bSgovinda 59544bb982bSgovinda /* 59644bb982bSgovinda * arg0 - devhandle 59744bb982bSgovinda * arg1 - msg_type 59844bb982bSgovinda * 59944bb982bSgovinda * ret0 - status 60044bb982bSgovinda * ret1 - msiq_id 60144bb982bSgovinda */ 60244bb982bSgovinda ENTRY(hvio_msg_getmsiq) 60344bb982bSgovinda mov HVIO_MSG_GETMSIQ, %o5 60444bb982bSgovinda ta FAST_TRAP 60544bb982bSgovinda brz,a %o0, 1f 60644bb982bSgovinda stuw %o1, [%o2] 60744bb982bSgovinda1: retl 60844bb982bSgovinda nop 60944bb982bSgovinda SET_SIZE(hvio_msg_getmsiq) 61044bb982bSgovinda 61144bb982bSgovinda /* 61244bb982bSgovinda * arg0 - devhandle 61344bb982bSgovinda * arg1 - msg_type 61444bb982bSgovinda * arg2 - msiq_id 61544bb982bSgovinda * 61644bb982bSgovinda * ret0 - status 61744bb982bSgovinda */ 61844bb982bSgovinda ENTRY(hvio_msg_setmsiq) 61944bb982bSgovinda mov HVIO_MSG_SETMSIQ, %o5 62044bb982bSgovinda ta FAST_TRAP 62144bb982bSgovinda retl 62244bb982bSgovinda nop 62344bb982bSgovinda SET_SIZE(hvio_msg_setmsiq) 62444bb982bSgovinda 62544bb982bSgovinda /* 62644bb982bSgovinda * arg0 - devhandle 62744bb982bSgovinda * arg1 - msg_type 62844bb982bSgovinda * 62944bb982bSgovinda * ret0 - status 63044bb982bSgovinda * ret1 - msg_valid_state 63144bb982bSgovinda */ 63244bb982bSgovinda ENTRY(hvio_msg_getvalid) 63344bb982bSgovinda mov HVIO_MSG_GETVALID, %o5 63444bb982bSgovinda ta FAST_TRAP 63544bb982bSgovinda brz,a %o0, 1f 63644bb982bSgovinda stuw %o1, [%o2] 63744bb982bSgovinda1: retl 63844bb982bSgovinda nop 63944bb982bSgovinda SET_SIZE(hvio_msg_getvalid) 64044bb982bSgovinda 64144bb982bSgovinda /* 64244bb982bSgovinda * arg0 - devhandle 64344bb982bSgovinda * arg1 - msg_type 64444bb982bSgovinda * arg2 - msg_valid_state 64544bb982bSgovinda * 64644bb982bSgovinda * ret0 - status 64744bb982bSgovinda */ 64844bb982bSgovinda ENTRY(hvio_msg_setvalid) 64944bb982bSgovinda mov HVIO_MSG_SETVALID, %o5 65044bb982bSgovinda ta FAST_TRAP 65144bb982bSgovinda retl 65244bb982bSgovinda nop 65344bb982bSgovinda SET_SIZE(hvio_msg_setvalid) 65444bb982bSgovinda 655*fc256490SJason Beloro /* 656*fc256490SJason Beloro * arg0 - devhandle 657*fc256490SJason Beloro * arg1 - devino 658*fc256490SJason Beloro * arg2 - pci_device 659*fc256490SJason Beloro * 660*fc256490SJason Beloro * ret0 - status 661*fc256490SJason Beloro */ 662*fc256490SJason Beloro ENTRY(pci_error_send) 663*fc256490SJason Beloro mov PCI_ERROR_SEND, %o5 664*fc256490SJason Beloro ta FAST_TRAP 665*fc256490SJason Beloro retl 666*fc256490SJason Beloro nop 667*fc256490SJason Beloro SET_SIZE(pci_error_send) 668*fc256490SJason Beloro 66944bb982bSgovinda#define SHIFT_REGS mov %o1,%o0; mov %o2,%o1; mov %o3,%o2; mov %o4,%o3 67044bb982bSgovinda 67144bb982bSgovinda! px_phys_acc_4v: Do physical address read. 67244bb982bSgovinda! 67344bb982bSgovinda! After SHIFT_REGS: 67444bb982bSgovinda! %o0 is "from" address 67544bb982bSgovinda! %o1 is "to" address 67644bb982bSgovinda! 67744bb982bSgovinda! Assumes 8 byte data and that alignment is correct. 67844bb982bSgovinda! 67944bb982bSgovinda! Always returns success (0) in %o0 68044bb982bSgovinda 68144bb982bSgovinda ! px_phys_acc_4v must not be split across pages. 68244bb982bSgovinda ! 68344bb982bSgovinda ! ATTN: Be sure that the alignment value is larger than the size of 68444bb982bSgovinda ! the px_phys_acc_4v function. 68544bb982bSgovinda ! 68644bb982bSgovinda .align 0x40 68744bb982bSgovinda 68844bb982bSgovinda ENTRY(px_phys_acc_4v) 68944bb982bSgovinda 69044bb982bSgovinda SHIFT_REGS 69144bb982bSgovinda ldx [%o0], %g1 69244bb982bSgovinda stx %g1, [%o1] 69344bb982bSgovinda membar #Sync ! Make sure the loads take 69444bb982bSgovinda mov %g0, %o0 69544bb982bSgovinda done 69644bb982bSgovinda SET_SIZE(px_phys_acc_4v) 69744bb982bSgovinda 698*fc256490SJason Beloro /* 699*fc256490SJason Beloro * arg0 - devhandle 700*fc256490SJason Beloro * 701*fc256490SJason Beloro * ret0 - status 702*fc256490SJason Beloro */ 703*fc256490SJason Beloro ENTRY(pci_iov_root_configured) 704*fc256490SJason Beloro mov PCI_IOV_ROOT_CONFIGURED, %o5 705*fc256490SJason Beloro ta FAST_TRAP 706*fc256490SJason Beloro retl 707*fc256490SJason Beloro nop 708*fc256490SJason Beloro SET_SIZE(pci_iov_root_configured) 709*fc256490SJason Beloro 71044bb982bSgovinda#endif /* lint || __lint */ 711