1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*
  28  * Hypervisor calls called by niu leaf driver.
  29 */
  30 
  31 #include <sys/asm_linkage.h>
  32 #include <sys/hypervisor_api.h>
  33 
  34 /*
  35  * NIU HV API v1.1 definitions
  36  */
  37 #define N2NIU_VR_GETINFO        0x148
  38 #define N2NIU_VR_GET_RX_MAP     0x14d
  39 #define N2NIU_VR_GET_TX_MAP     0x14e
  40 #define N2NIU_VRRX_SET_INO      0x150
  41 #define N2NIU_VRTX_SET_INO      0x151
  42 
  43 
  44         /*
  45          * vdds_hv_niu_vr_getinfo(uint32_t cookie, uint64_t &real_start,
  46          *     uint64_t &size)
  47          */
  48         ENTRY(vdds_hv_niu_vr_getinfo)
  49         mov     %o1, %g1
  50         mov     %o2, %g2
  51         mov     N2NIU_VR_GETINFO, %o5
  52         ta      FAST_TRAP
  53         stx     %o1, [%g1]
  54         retl
  55         stx     %o2, [%g2]
  56         SET_SIZE(vdds_hv_niu_vr_getinfo)
  57 
  58         /*
  59          * vdds_hv_niu_vr_get_rxmap(uint32_t cookie, uint64_t *dma_map)
  60          */
  61         ENTRY(vdds_hv_niu_vr_get_rxmap)
  62         mov     %o1, %g1
  63         mov     N2NIU_VR_GET_RX_MAP, %o5
  64         ta      FAST_TRAP
  65         retl
  66         stx     %o1, [%g1]
  67         SET_SIZE(vdds_hv_niu_vr_get_rxmap)
  68 
  69         /*
  70          * vdds_hv_niu_vr_get_txmap(uint32_t cookie, uint64_t *dma_map)
  71          */
  72         ENTRY(vdds_hv_niu_vr_get_txmap)
  73         mov     %o1, %g1
  74         mov     N2NIU_VR_GET_TX_MAP, %o5
  75         ta      FAST_TRAP
  76         retl
  77         stx     %o1, [%g1]
  78         SET_SIZE(vdds_hv_niu_vr_get_txmap)
  79 
  80         /*
  81          * vdds_hv_niu_vrrx_set_ino(uint32_t cookie, uint64_t vch_idx, uint32_t ino)
  82          */
  83         ENTRY(vdds_hv_niu_vrrx_set_ino)
  84         mov     N2NIU_VRRX_SET_INO, %o5
  85         ta      FAST_TRAP
  86         retl
  87         nop
  88         SET_SIZE(vdds_hv_niu_vrrx_set_ino)
  89 
  90         /*
  91          * vdds_hv_niu_vrtx_set_ino(uint32_t cookie, uint64_t vch_idx, uint32_t ino)
  92          */
  93         ENTRY(vdds_hv_niu_vrtx_set_ino)
  94         mov     N2NIU_VRTX_SET_INO, %o5
  95         ta      FAST_TRAP
  96         retl
  97         nop
  98         SET_SIZE(vdds_hv_niu_vrtx_set_ino)
  99