1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_DDI_ISA_H 28*0Sstevel@tonic-gate #define _SYS_DDI_ISA_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #include <sys/isa_defs.h> 33*0Sstevel@tonic-gate #include <sys/dditypes.h> 34*0Sstevel@tonic-gate #include <sys/ndifm.h> 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate #ifdef __cplusplus 37*0Sstevel@tonic-gate extern "C" { 38*0Sstevel@tonic-gate #endif 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #ifdef _KERNEL 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate /* 43*0Sstevel@tonic-gate * These are the data access functions which the platform 44*0Sstevel@tonic-gate * can choose to define as functions or macro's. 45*0Sstevel@tonic-gate */ 46*0Sstevel@tonic-gate 47*0Sstevel@tonic-gate /* 48*0Sstevel@tonic-gate * DDI interfaces defined as macro's 49*0Sstevel@tonic-gate */ 50*0Sstevel@tonic-gate 51*0Sstevel@tonic-gate /* 52*0Sstevel@tonic-gate * DDI interfaces defined as functions 53*0Sstevel@tonic-gate */ 54*0Sstevel@tonic-gate 55*0Sstevel@tonic-gate #ifdef __STDC__ 56*0Sstevel@tonic-gate 57*0Sstevel@tonic-gate #ifdef _LP64 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate uint8_t 60*0Sstevel@tonic-gate ddi_mem_get8(ddi_acc_handle_t handle, uint8_t *host_addr); 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate uint16_t 63*0Sstevel@tonic-gate ddi_mem_get16(ddi_acc_handle_t handle, uint16_t *host_addr); 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate uint32_t 66*0Sstevel@tonic-gate ddi_mem_get32(ddi_acc_handle_t handle, uint32_t *host_addr); 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gate uint64_t 69*0Sstevel@tonic-gate ddi_mem_get64(ddi_acc_handle_t handle, uint64_t *host_addr); 70*0Sstevel@tonic-gate 71*0Sstevel@tonic-gate void 72*0Sstevel@tonic-gate ddi_mem_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr, 73*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 74*0Sstevel@tonic-gate 75*0Sstevel@tonic-gate void 76*0Sstevel@tonic-gate ddi_mem_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr, 77*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 78*0Sstevel@tonic-gate 79*0Sstevel@tonic-gate void 80*0Sstevel@tonic-gate ddi_mem_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr, 81*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 82*0Sstevel@tonic-gate 83*0Sstevel@tonic-gate void 84*0Sstevel@tonic-gate ddi_mem_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr, 85*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gate void 88*0Sstevel@tonic-gate ddi_mem_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value); 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate void 91*0Sstevel@tonic-gate ddi_mem_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value); 92*0Sstevel@tonic-gate 93*0Sstevel@tonic-gate void 94*0Sstevel@tonic-gate ddi_mem_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value); 95*0Sstevel@tonic-gate 96*0Sstevel@tonic-gate void 97*0Sstevel@tonic-gate ddi_mem_put64(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value); 98*0Sstevel@tonic-gate 99*0Sstevel@tonic-gate void 100*0Sstevel@tonic-gate ddi_mem_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr, 101*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 102*0Sstevel@tonic-gate 103*0Sstevel@tonic-gate void 104*0Sstevel@tonic-gate ddi_mem_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr, 105*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 106*0Sstevel@tonic-gate 107*0Sstevel@tonic-gate void 108*0Sstevel@tonic-gate ddi_mem_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr, 109*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 110*0Sstevel@tonic-gate 111*0Sstevel@tonic-gate void 112*0Sstevel@tonic-gate ddi_mem_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr, 113*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 114*0Sstevel@tonic-gate 115*0Sstevel@tonic-gate uint8_t 116*0Sstevel@tonic-gate ddi_io_get8(ddi_acc_handle_t handle, uint8_t *dev_addr); 117*0Sstevel@tonic-gate 118*0Sstevel@tonic-gate uint16_t 119*0Sstevel@tonic-gate ddi_io_get16(ddi_acc_handle_t handle, uint16_t *dev_addr); 120*0Sstevel@tonic-gate 121*0Sstevel@tonic-gate uint32_t 122*0Sstevel@tonic-gate ddi_io_get32(ddi_acc_handle_t handle, uint32_t *dev_addr); 123*0Sstevel@tonic-gate 124*0Sstevel@tonic-gate void 125*0Sstevel@tonic-gate ddi_io_rep_get8(ddi_acc_handle_t handle, 126*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, size_t repcount); 127*0Sstevel@tonic-gate 128*0Sstevel@tonic-gate void 129*0Sstevel@tonic-gate ddi_io_rep_get16(ddi_acc_handle_t handle, 130*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, size_t repcount); 131*0Sstevel@tonic-gate 132*0Sstevel@tonic-gate void 133*0Sstevel@tonic-gate ddi_io_rep_get32(ddi_acc_handle_t handle, 134*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, size_t repcount); 135*0Sstevel@tonic-gate 136*0Sstevel@tonic-gate void 137*0Sstevel@tonic-gate ddi_io_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value); 138*0Sstevel@tonic-gate 139*0Sstevel@tonic-gate void 140*0Sstevel@tonic-gate ddi_io_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value); 141*0Sstevel@tonic-gate 142*0Sstevel@tonic-gate void 143*0Sstevel@tonic-gate ddi_io_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value); 144*0Sstevel@tonic-gate 145*0Sstevel@tonic-gate void 146*0Sstevel@tonic-gate ddi_io_rep_put8(ddi_acc_handle_t handle, 147*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, size_t repcount); 148*0Sstevel@tonic-gate 149*0Sstevel@tonic-gate void 150*0Sstevel@tonic-gate ddi_io_rep_put16(ddi_acc_handle_t handle, 151*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, size_t repcount); 152*0Sstevel@tonic-gate 153*0Sstevel@tonic-gate void 154*0Sstevel@tonic-gate ddi_io_rep_put32(ddi_acc_handle_t handle, 155*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, size_t repcount); 156*0Sstevel@tonic-gate 157*0Sstevel@tonic-gate #else /* _ILP32 */ 158*0Sstevel@tonic-gate 159*0Sstevel@tonic-gate uint8_t 160*0Sstevel@tonic-gate ddi_mem_getb(ddi_acc_handle_t handle, uint8_t *host_addr); 161*0Sstevel@tonic-gate #define ddi_mem_get8 ddi_mem_getb 162*0Sstevel@tonic-gate 163*0Sstevel@tonic-gate uint16_t 164*0Sstevel@tonic-gate ddi_mem_getw(ddi_acc_handle_t handle, uint16_t *host_addr); 165*0Sstevel@tonic-gate #define ddi_mem_get16 ddi_mem_getw 166*0Sstevel@tonic-gate 167*0Sstevel@tonic-gate uint32_t 168*0Sstevel@tonic-gate ddi_mem_getl(ddi_acc_handle_t handle, uint32_t *host_addr); 169*0Sstevel@tonic-gate #define ddi_mem_get32 ddi_mem_getl 170*0Sstevel@tonic-gate 171*0Sstevel@tonic-gate uint64_t 172*0Sstevel@tonic-gate ddi_mem_getll(ddi_acc_handle_t handle, uint64_t *host_addr); 173*0Sstevel@tonic-gate #define ddi_mem_get64 ddi_mem_getll 174*0Sstevel@tonic-gate 175*0Sstevel@tonic-gate void 176*0Sstevel@tonic-gate ddi_mem_rep_getb(ddi_acc_handle_t handle, uint8_t *host_addr, 177*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 178*0Sstevel@tonic-gate #define ddi_mem_rep_get8 ddi_mem_rep_getb 179*0Sstevel@tonic-gate 180*0Sstevel@tonic-gate void 181*0Sstevel@tonic-gate ddi_mem_rep_getw(ddi_acc_handle_t handle, uint16_t *host_addr, 182*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 183*0Sstevel@tonic-gate #define ddi_mem_rep_get16 ddi_mem_rep_getw 184*0Sstevel@tonic-gate 185*0Sstevel@tonic-gate void 186*0Sstevel@tonic-gate ddi_mem_rep_getl(ddi_acc_handle_t handle, uint32_t *host_addr, 187*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 188*0Sstevel@tonic-gate #define ddi_mem_rep_get32 ddi_mem_rep_getl 189*0Sstevel@tonic-gate 190*0Sstevel@tonic-gate void 191*0Sstevel@tonic-gate ddi_mem_rep_getll(ddi_acc_handle_t handle, uint64_t *host_addr, 192*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 193*0Sstevel@tonic-gate #define ddi_mem_rep_get64 ddi_mem_rep_getll 194*0Sstevel@tonic-gate 195*0Sstevel@tonic-gate void 196*0Sstevel@tonic-gate ddi_mem_putb(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value); 197*0Sstevel@tonic-gate #define ddi_mem_put8 ddi_mem_putb 198*0Sstevel@tonic-gate 199*0Sstevel@tonic-gate void 200*0Sstevel@tonic-gate ddi_mem_putw(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value); 201*0Sstevel@tonic-gate #define ddi_mem_put16 ddi_mem_putw 202*0Sstevel@tonic-gate 203*0Sstevel@tonic-gate void 204*0Sstevel@tonic-gate ddi_mem_putl(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value); 205*0Sstevel@tonic-gate #define ddi_mem_put32 ddi_mem_putl 206*0Sstevel@tonic-gate 207*0Sstevel@tonic-gate void 208*0Sstevel@tonic-gate ddi_mem_putll(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value); 209*0Sstevel@tonic-gate #define ddi_mem_put64 ddi_mem_putll 210*0Sstevel@tonic-gate 211*0Sstevel@tonic-gate void 212*0Sstevel@tonic-gate ddi_mem_rep_putb(ddi_acc_handle_t handle, uint8_t *host_addr, 213*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 214*0Sstevel@tonic-gate #define ddi_mem_rep_put8 ddi_mem_rep_putb 215*0Sstevel@tonic-gate 216*0Sstevel@tonic-gate void 217*0Sstevel@tonic-gate ddi_mem_rep_putw(ddi_acc_handle_t handle, uint16_t *host_addr, 218*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 219*0Sstevel@tonic-gate #define ddi_mem_rep_put16 ddi_mem_rep_putw 220*0Sstevel@tonic-gate 221*0Sstevel@tonic-gate void 222*0Sstevel@tonic-gate ddi_mem_rep_putl(ddi_acc_handle_t handle, uint32_t *host_addr, 223*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 224*0Sstevel@tonic-gate #define ddi_mem_rep_put32 ddi_mem_rep_putl 225*0Sstevel@tonic-gate 226*0Sstevel@tonic-gate void 227*0Sstevel@tonic-gate ddi_mem_rep_putll(ddi_acc_handle_t handle, uint64_t *host_addr, 228*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 229*0Sstevel@tonic-gate #define ddi_mem_rep_put64 ddi_mem_rep_putll 230*0Sstevel@tonic-gate 231*0Sstevel@tonic-gate uint8_t 232*0Sstevel@tonic-gate ddi_io_getb(ddi_acc_handle_t handle, uint8_t *dev_addr); 233*0Sstevel@tonic-gate #define ddi_io_get8 ddi_io_getb 234*0Sstevel@tonic-gate 235*0Sstevel@tonic-gate uint16_t 236*0Sstevel@tonic-gate ddi_io_getw(ddi_acc_handle_t handle, uint16_t *dev_addr); 237*0Sstevel@tonic-gate #define ddi_io_get16 ddi_io_getw 238*0Sstevel@tonic-gate 239*0Sstevel@tonic-gate uint32_t 240*0Sstevel@tonic-gate ddi_io_getl(ddi_acc_handle_t handle, uint32_t *dev_addr); 241*0Sstevel@tonic-gate #define ddi_io_get32 ddi_io_getl 242*0Sstevel@tonic-gate 243*0Sstevel@tonic-gate void 244*0Sstevel@tonic-gate ddi_io_rep_getb(ddi_acc_handle_t handle, 245*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, size_t repcount); 246*0Sstevel@tonic-gate #define ddi_io_rep_get8 ddi_io_rep_getb 247*0Sstevel@tonic-gate 248*0Sstevel@tonic-gate void 249*0Sstevel@tonic-gate ddi_io_rep_getw(ddi_acc_handle_t handle, 250*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, size_t repcount); 251*0Sstevel@tonic-gate #define ddi_io_rep_get16 ddi_io_rep_getw 252*0Sstevel@tonic-gate 253*0Sstevel@tonic-gate void 254*0Sstevel@tonic-gate ddi_io_rep_getl(ddi_acc_handle_t handle, 255*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, size_t repcount); 256*0Sstevel@tonic-gate #define ddi_io_rep_get32 ddi_io_rep_getl 257*0Sstevel@tonic-gate 258*0Sstevel@tonic-gate void 259*0Sstevel@tonic-gate ddi_io_putb(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value); 260*0Sstevel@tonic-gate #define ddi_io_put8 ddi_io_putb 261*0Sstevel@tonic-gate 262*0Sstevel@tonic-gate void 263*0Sstevel@tonic-gate ddi_io_putw(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value); 264*0Sstevel@tonic-gate #define ddi_io_put16 ddi_io_putw 265*0Sstevel@tonic-gate 266*0Sstevel@tonic-gate void 267*0Sstevel@tonic-gate ddi_io_putl(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value); 268*0Sstevel@tonic-gate #define ddi_io_put32 ddi_io_putl 269*0Sstevel@tonic-gate 270*0Sstevel@tonic-gate void 271*0Sstevel@tonic-gate ddi_io_rep_putb(ddi_acc_handle_t handle, 272*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, size_t repcount); 273*0Sstevel@tonic-gate #define ddi_io_rep_put8 ddi_io_rep_putb 274*0Sstevel@tonic-gate 275*0Sstevel@tonic-gate void 276*0Sstevel@tonic-gate ddi_io_rep_putw(ddi_acc_handle_t handle, 277*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, size_t repcount); 278*0Sstevel@tonic-gate #define ddi_io_rep_put16 ddi_io_rep_putw 279*0Sstevel@tonic-gate 280*0Sstevel@tonic-gate void 281*0Sstevel@tonic-gate ddi_io_rep_putl(ddi_acc_handle_t handle, 282*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, size_t repcount); 283*0Sstevel@tonic-gate #define ddi_io_rep_put32 ddi_io_rep_putl 284*0Sstevel@tonic-gate 285*0Sstevel@tonic-gate #endif /* _LP64 */ 286*0Sstevel@tonic-gate 287*0Sstevel@tonic-gate /* 288*0Sstevel@tonic-gate * ahi_acc_attr flags 289*0Sstevel@tonic-gate */ 290*0Sstevel@tonic-gate #define DDI_ACCATTR_CONFIG_SPACE 0x1 291*0Sstevel@tonic-gate #define DDI_ACCATTR_IO_SPACE 0x2 292*0Sstevel@tonic-gate #define DDI_ACCATTR_CPU_VADDR 0x4 293*0Sstevel@tonic-gate #define DDI_ACCATTR_DIRECT 0x8 294*0Sstevel@tonic-gate 295*0Sstevel@tonic-gate typedef struct ddi_acc_impl { 296*0Sstevel@tonic-gate ddi_acc_hdl_t ahi_common; 297*0Sstevel@tonic-gate uint_t ahi_acc_attr; 298*0Sstevel@tonic-gate ulong_t ahi_io_port_base; 299*0Sstevel@tonic-gate 300*0Sstevel@tonic-gate uint8_t 301*0Sstevel@tonic-gate (*ahi_get8)(struct ddi_acc_impl *handle, uint8_t *addr); 302*0Sstevel@tonic-gate uint16_t 303*0Sstevel@tonic-gate (*ahi_get16)(struct ddi_acc_impl *handle, uint16_t *addr); 304*0Sstevel@tonic-gate uint32_t 305*0Sstevel@tonic-gate (*ahi_get32)(struct ddi_acc_impl *handle, uint32_t *addr); 306*0Sstevel@tonic-gate uint64_t 307*0Sstevel@tonic-gate (*ahi_get64)(struct ddi_acc_impl *handle, uint64_t *addr); 308*0Sstevel@tonic-gate 309*0Sstevel@tonic-gate void (*ahi_put8)(struct ddi_acc_impl *handle, uint8_t *addr, 310*0Sstevel@tonic-gate uint8_t value); 311*0Sstevel@tonic-gate void (*ahi_put16)(struct ddi_acc_impl *handle, uint16_t *addr, 312*0Sstevel@tonic-gate uint16_t value); 313*0Sstevel@tonic-gate void (*ahi_put32)(struct ddi_acc_impl *handle, uint32_t *addr, 314*0Sstevel@tonic-gate uint32_t value); 315*0Sstevel@tonic-gate void (*ahi_put64)(struct ddi_acc_impl *handle, uint64_t *addr, 316*0Sstevel@tonic-gate uint64_t value); 317*0Sstevel@tonic-gate 318*0Sstevel@tonic-gate void (*ahi_rep_get8)(struct ddi_acc_impl *handle, 319*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, 320*0Sstevel@tonic-gate size_t repcount, uint_t flags); 321*0Sstevel@tonic-gate void (*ahi_rep_get16)(struct ddi_acc_impl *handle, 322*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, 323*0Sstevel@tonic-gate size_t repcount, uint_t flags); 324*0Sstevel@tonic-gate void (*ahi_rep_get32)(struct ddi_acc_impl *handle, 325*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, 326*0Sstevel@tonic-gate size_t repcount, uint_t flags); 327*0Sstevel@tonic-gate void (*ahi_rep_get64)(struct ddi_acc_impl *handle, 328*0Sstevel@tonic-gate uint64_t *host_addr, uint64_t *dev_addr, 329*0Sstevel@tonic-gate size_t repcount, uint_t flags); 330*0Sstevel@tonic-gate 331*0Sstevel@tonic-gate void (*ahi_rep_put8)(struct ddi_acc_impl *handle, 332*0Sstevel@tonic-gate uint8_t *host_addr, uint8_t *dev_addr, 333*0Sstevel@tonic-gate size_t repcount, uint_t flags); 334*0Sstevel@tonic-gate void (*ahi_rep_put16)(struct ddi_acc_impl *handle, 335*0Sstevel@tonic-gate uint16_t *host_addr, uint16_t *dev_addr, 336*0Sstevel@tonic-gate size_t repcount, uint_t flags); 337*0Sstevel@tonic-gate void (*ahi_rep_put32)(struct ddi_acc_impl *handle, 338*0Sstevel@tonic-gate uint32_t *host_addr, uint32_t *dev_addr, 339*0Sstevel@tonic-gate size_t repcount, uint_t flags); 340*0Sstevel@tonic-gate void (*ahi_rep_put64)(struct ddi_acc_impl *handle, 341*0Sstevel@tonic-gate uint64_t *host_addr, uint64_t *dev_addr, 342*0Sstevel@tonic-gate size_t repcount, uint_t flags); 343*0Sstevel@tonic-gate 344*0Sstevel@tonic-gate int (*ahi_fault_check)(struct ddi_acc_impl *handle); 345*0Sstevel@tonic-gate void (*ahi_fault_notify)(struct ddi_acc_impl *handle); 346*0Sstevel@tonic-gate uint32_t ahi_fault; 347*0Sstevel@tonic-gate ndi_err_t *ahi_err; 348*0Sstevel@tonic-gate } ddi_acc_impl_t; 349*0Sstevel@tonic-gate 350*0Sstevel@tonic-gate 351*0Sstevel@tonic-gate /* 352*0Sstevel@tonic-gate * Input functions to memory mapped IO 353*0Sstevel@tonic-gate */ 354*0Sstevel@tonic-gate uint8_t 355*0Sstevel@tonic-gate i_ddi_vaddr_get8(ddi_acc_impl_t *hdlp, uint8_t *addr); 356*0Sstevel@tonic-gate 357*0Sstevel@tonic-gate uint16_t 358*0Sstevel@tonic-gate i_ddi_vaddr_get16(ddi_acc_impl_t *hdlp, uint16_t *addr); 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gate uint32_t 361*0Sstevel@tonic-gate i_ddi_vaddr_get32(ddi_acc_impl_t *hdlp, uint32_t *addr); 362*0Sstevel@tonic-gate 363*0Sstevel@tonic-gate uint64_t 364*0Sstevel@tonic-gate i_ddi_vaddr_get64(ddi_acc_impl_t *hdlp, uint64_t *addr); 365*0Sstevel@tonic-gate 366*0Sstevel@tonic-gate uint16_t 367*0Sstevel@tonic-gate i_ddi_vaddr_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr); 368*0Sstevel@tonic-gate 369*0Sstevel@tonic-gate uint32_t 370*0Sstevel@tonic-gate i_ddi_vaddr_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr); 371*0Sstevel@tonic-gate 372*0Sstevel@tonic-gate uint64_t 373*0Sstevel@tonic-gate i_ddi_vaddr_swap_get64(ddi_acc_impl_t *hdlp, uint64_t *addr); 374*0Sstevel@tonic-gate 375*0Sstevel@tonic-gate /* 376*0Sstevel@tonic-gate * Output functions to memory mapped IO 377*0Sstevel@tonic-gate */ 378*0Sstevel@tonic-gate void 379*0Sstevel@tonic-gate i_ddi_vaddr_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value); 380*0Sstevel@tonic-gate 381*0Sstevel@tonic-gate void 382*0Sstevel@tonic-gate i_ddi_vaddr_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value); 383*0Sstevel@tonic-gate 384*0Sstevel@tonic-gate void 385*0Sstevel@tonic-gate i_ddi_vaddr_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value); 386*0Sstevel@tonic-gate 387*0Sstevel@tonic-gate void 388*0Sstevel@tonic-gate i_ddi_vaddr_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value); 389*0Sstevel@tonic-gate 390*0Sstevel@tonic-gate void 391*0Sstevel@tonic-gate i_ddi_vaddr_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value); 392*0Sstevel@tonic-gate 393*0Sstevel@tonic-gate void 394*0Sstevel@tonic-gate i_ddi_vaddr_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value); 395*0Sstevel@tonic-gate 396*0Sstevel@tonic-gate void 397*0Sstevel@tonic-gate i_ddi_vaddr_swap_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value); 398*0Sstevel@tonic-gate 399*0Sstevel@tonic-gate /* 400*0Sstevel@tonic-gate * Repeated input functions for memory mapped IO 401*0Sstevel@tonic-gate */ 402*0Sstevel@tonic-gate void 403*0Sstevel@tonic-gate i_ddi_vaddr_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, 404*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 405*0Sstevel@tonic-gate 406*0Sstevel@tonic-gate void 407*0Sstevel@tonic-gate i_ddi_vaddr_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 408*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 409*0Sstevel@tonic-gate 410*0Sstevel@tonic-gate void 411*0Sstevel@tonic-gate i_ddi_vaddr_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 412*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 413*0Sstevel@tonic-gate 414*0Sstevel@tonic-gate void 415*0Sstevel@tonic-gate i_ddi_vaddr_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr, 416*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 417*0Sstevel@tonic-gate 418*0Sstevel@tonic-gate void 419*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 420*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 421*0Sstevel@tonic-gate 422*0Sstevel@tonic-gate void 423*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 424*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 425*0Sstevel@tonic-gate 426*0Sstevel@tonic-gate void 427*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr, 428*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 429*0Sstevel@tonic-gate 430*0Sstevel@tonic-gate /* 431*0Sstevel@tonic-gate * Repeated output functions for memory mapped IO 432*0Sstevel@tonic-gate */ 433*0Sstevel@tonic-gate void 434*0Sstevel@tonic-gate i_ddi_vaddr_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, 435*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 436*0Sstevel@tonic-gate 437*0Sstevel@tonic-gate void 438*0Sstevel@tonic-gate i_ddi_vaddr_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 439*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 440*0Sstevel@tonic-gate 441*0Sstevel@tonic-gate void 442*0Sstevel@tonic-gate i_ddi_vaddr_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr, 443*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 444*0Sstevel@tonic-gate 445*0Sstevel@tonic-gate void 446*0Sstevel@tonic-gate i_ddi_vaddr_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr, 447*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 448*0Sstevel@tonic-gate 449*0Sstevel@tonic-gate void 450*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 451*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 452*0Sstevel@tonic-gate 453*0Sstevel@tonic-gate void 454*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr, 455*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 456*0Sstevel@tonic-gate 457*0Sstevel@tonic-gate void 458*0Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr, 459*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 460*0Sstevel@tonic-gate 461*0Sstevel@tonic-gate /* 462*0Sstevel@tonic-gate * Input functions to IO space 463*0Sstevel@tonic-gate */ 464*0Sstevel@tonic-gate uint8_t 465*0Sstevel@tonic-gate i_ddi_io_get8(ddi_acc_impl_t *hdlp, uint8_t *addr); 466*0Sstevel@tonic-gate 467*0Sstevel@tonic-gate uint16_t 468*0Sstevel@tonic-gate i_ddi_io_get16(ddi_acc_impl_t *hdlp, uint16_t *addr); 469*0Sstevel@tonic-gate 470*0Sstevel@tonic-gate uint32_t 471*0Sstevel@tonic-gate i_ddi_io_get32(ddi_acc_impl_t *hdlp, uint32_t *addr); 472*0Sstevel@tonic-gate 473*0Sstevel@tonic-gate uint64_t 474*0Sstevel@tonic-gate i_ddi_io_get64(ddi_acc_impl_t *hdlp, uint64_t *addr); 475*0Sstevel@tonic-gate 476*0Sstevel@tonic-gate uint16_t 477*0Sstevel@tonic-gate i_ddi_io_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr); 478*0Sstevel@tonic-gate 479*0Sstevel@tonic-gate uint32_t 480*0Sstevel@tonic-gate i_ddi_io_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr); 481*0Sstevel@tonic-gate 482*0Sstevel@tonic-gate uint64_t 483*0Sstevel@tonic-gate i_ddi_io_swap_get64(ddi_acc_impl_t *hdlp, uint64_t *addr); 484*0Sstevel@tonic-gate 485*0Sstevel@tonic-gate /* 486*0Sstevel@tonic-gate * Output functions to IO space 487*0Sstevel@tonic-gate */ 488*0Sstevel@tonic-gate void 489*0Sstevel@tonic-gate i_ddi_io_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value); 490*0Sstevel@tonic-gate 491*0Sstevel@tonic-gate void 492*0Sstevel@tonic-gate i_ddi_io_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value); 493*0Sstevel@tonic-gate 494*0Sstevel@tonic-gate void 495*0Sstevel@tonic-gate i_ddi_io_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value); 496*0Sstevel@tonic-gate 497*0Sstevel@tonic-gate void 498*0Sstevel@tonic-gate i_ddi_io_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value); 499*0Sstevel@tonic-gate 500*0Sstevel@tonic-gate void 501*0Sstevel@tonic-gate i_ddi_io_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value); 502*0Sstevel@tonic-gate 503*0Sstevel@tonic-gate void 504*0Sstevel@tonic-gate i_ddi_io_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value); 505*0Sstevel@tonic-gate 506*0Sstevel@tonic-gate void 507*0Sstevel@tonic-gate i_ddi_io_swap_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value); 508*0Sstevel@tonic-gate 509*0Sstevel@tonic-gate /* 510*0Sstevel@tonic-gate * Repeated input functions for IO space 511*0Sstevel@tonic-gate */ 512*0Sstevel@tonic-gate void 513*0Sstevel@tonic-gate i_ddi_io_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, uint8_t *dev_addr, 514*0Sstevel@tonic-gate size_t repcount, uint_t flags); 515*0Sstevel@tonic-gate 516*0Sstevel@tonic-gate void 517*0Sstevel@tonic-gate i_ddi_io_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 518*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 519*0Sstevel@tonic-gate 520*0Sstevel@tonic-gate void 521*0Sstevel@tonic-gate i_ddi_io_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 522*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 523*0Sstevel@tonic-gate 524*0Sstevel@tonic-gate void 525*0Sstevel@tonic-gate i_ddi_io_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr, 526*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 527*0Sstevel@tonic-gate 528*0Sstevel@tonic-gate void 529*0Sstevel@tonic-gate i_ddi_io_swap_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, 530*0Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags); 531*0Sstevel@tonic-gate 532*0Sstevel@tonic-gate void 533*0Sstevel@tonic-gate i_ddi_io_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 534*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 535*0Sstevel@tonic-gate 536*0Sstevel@tonic-gate void 537*0Sstevel@tonic-gate i_ddi_io_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 538*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 539*0Sstevel@tonic-gate 540*0Sstevel@tonic-gate void 541*0Sstevel@tonic-gate i_ddi_io_swap_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr, 542*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 543*0Sstevel@tonic-gate 544*0Sstevel@tonic-gate /* 545*0Sstevel@tonic-gate * Repeated output functions for IO space 546*0Sstevel@tonic-gate */ 547*0Sstevel@tonic-gate void 548*0Sstevel@tonic-gate i_ddi_io_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, uint8_t *dev_addr, 549*0Sstevel@tonic-gate size_t repcount, uint_t flags); 550*0Sstevel@tonic-gate 551*0Sstevel@tonic-gate void 552*0Sstevel@tonic-gate i_ddi_io_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 553*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 554*0Sstevel@tonic-gate 555*0Sstevel@tonic-gate void 556*0Sstevel@tonic-gate i_ddi_io_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr, uint32_t *dev_addr, 557*0Sstevel@tonic-gate size_t repcount, uint_t flags); 558*0Sstevel@tonic-gate 559*0Sstevel@tonic-gate void 560*0Sstevel@tonic-gate i_ddi_io_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr, uint64_t *dev_addr, 561*0Sstevel@tonic-gate size_t repcount, uint_t flags); 562*0Sstevel@tonic-gate void 563*0Sstevel@tonic-gate i_ddi_io_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 564*0Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags); 565*0Sstevel@tonic-gate 566*0Sstevel@tonic-gate void 567*0Sstevel@tonic-gate i_ddi_io_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr, 568*0Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags); 569*0Sstevel@tonic-gate 570*0Sstevel@tonic-gate void 571*0Sstevel@tonic-gate i_ddi_io_swap_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr, 572*0Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags); 573*0Sstevel@tonic-gate 574*0Sstevel@tonic-gate int 575*0Sstevel@tonic-gate i_ddi_vaddr_get(ddi_acc_impl_t *hdlp, caddr_t host_addr, 576*0Sstevel@tonic-gate caddr_t dev_addr, size_t wordsz, size_t count, ulong_t dev_addrtype); 577*0Sstevel@tonic-gate 578*0Sstevel@tonic-gate int 579*0Sstevel@tonic-gate i_ddi_vaddr_put(ddi_acc_impl_t *hdlp, caddr_t host_addr, 580*0Sstevel@tonic-gate caddr_t dev_addr, size_t wordsz, size_t count, ulong_t dev_addrtype); 581*0Sstevel@tonic-gate 582*0Sstevel@tonic-gate int 583*0Sstevel@tonic-gate i_ddi_io_get(ddi_acc_impl_t *hdlp, caddr_t host_addr, 584*0Sstevel@tonic-gate caddr_t dev_addr, size_t wordsz, size_t count, ulong_t dev_addrtype); 585*0Sstevel@tonic-gate 586*0Sstevel@tonic-gate int 587*0Sstevel@tonic-gate i_ddi_io_put(ddi_acc_impl_t *hdlp, caddr_t host_addr, 588*0Sstevel@tonic-gate caddr_t dev_addr, size_t wordsz, size_t count, ulong_t dev_addrtype); 589*0Sstevel@tonic-gate 590*0Sstevel@tonic-gate uchar_t 591*0Sstevel@tonic-gate i_pci_getb(int b, int d, int f, int r); 592*0Sstevel@tonic-gate 593*0Sstevel@tonic-gate ushort_t 594*0Sstevel@tonic-gate i_pci_getw(int b, int d, int f, int r); 595*0Sstevel@tonic-gate 596*0Sstevel@tonic-gate ulong_t 597*0Sstevel@tonic-gate i_pci_getl(int b, int d, int f, int r); 598*0Sstevel@tonic-gate 599*0Sstevel@tonic-gate void 600*0Sstevel@tonic-gate i_pci_putb(int b, int d, int f, int r, uchar_t v); 601*0Sstevel@tonic-gate 602*0Sstevel@tonic-gate void 603*0Sstevel@tonic-gate i_pci_putw(int b, int d, int f, int r, ushort_t v); 604*0Sstevel@tonic-gate 605*0Sstevel@tonic-gate void 606*0Sstevel@tonic-gate i_pci_putl(int b, int d, int f, int r, ulong_t v); 607*0Sstevel@tonic-gate 608*0Sstevel@tonic-gate /* 609*0Sstevel@tonic-gate * Default fault-checking and notification functions 610*0Sstevel@tonic-gate */ 611*0Sstevel@tonic-gate int 612*0Sstevel@tonic-gate i_ddi_acc_fault_check(ddi_acc_impl_t *hdlp); 613*0Sstevel@tonic-gate 614*0Sstevel@tonic-gate void 615*0Sstevel@tonic-gate i_ddi_acc_fault_notify(ddi_acc_impl_t *hdlp); 616*0Sstevel@tonic-gate 617*0Sstevel@tonic-gate #endif /* __STDC__ */ 618*0Sstevel@tonic-gate 619*0Sstevel@tonic-gate #endif /* _KERNEL */ 620*0Sstevel@tonic-gate 621*0Sstevel@tonic-gate #ifdef __cplusplus 622*0Sstevel@tonic-gate } 623*0Sstevel@tonic-gate #endif 624*0Sstevel@tonic-gate 625*0Sstevel@tonic-gate #endif /* _SYS_DDI_ISA_H */ 626