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 5*1106Smrj * Common Development and Distribution License (the "License"). 6*1106Smrj * 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 */ 21*1106Smrj 220Sstevel@tonic-gate/* 23545Skalai * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 280Sstevel@tonic-gate 290Sstevel@tonic-gate#if defined(lint) || defined(__lint) 300Sstevel@tonic-gate#include <sys/types.h> 310Sstevel@tonic-gate#include <sys/sunddi.h> 320Sstevel@tonic-gate#else 330Sstevel@tonic-gate#include <sys/asm_linkage.h> 340Sstevel@tonic-gate#include <sys/asm_misc.h> 350Sstevel@tonic-gate#include "assym.h" 360Sstevel@tonic-gate#endif 370Sstevel@tonic-gate 380Sstevel@tonic-gate#if defined(lint) || defined(__lint) 390Sstevel@tonic-gate 400Sstevel@tonic-gate/*ARGSUSED*/ 410Sstevel@tonic-gateuint8_t 420Sstevel@tonic-gateddi_get8(ddi_acc_handle_t handle, uint8_t *addr) 430Sstevel@tonic-gate{ 440Sstevel@tonic-gate return (0); 450Sstevel@tonic-gate} 460Sstevel@tonic-gate 470Sstevel@tonic-gate/*ARGSUSED*/ 480Sstevel@tonic-gateuint8_t 490Sstevel@tonic-gateddi_mem_get8(ddi_acc_handle_t handle, uint8_t *addr) 500Sstevel@tonic-gate{ 510Sstevel@tonic-gate return (0); 520Sstevel@tonic-gate} 530Sstevel@tonic-gate 540Sstevel@tonic-gate/*ARGSUSED*/ 550Sstevel@tonic-gateuint8_t 560Sstevel@tonic-gateddi_io_get8(ddi_acc_handle_t handle, uint8_t *dev_addr) 570Sstevel@tonic-gate{ 580Sstevel@tonic-gate return (0); 590Sstevel@tonic-gate} 600Sstevel@tonic-gate 610Sstevel@tonic-gate/*ARGSUSED*/ 620Sstevel@tonic-gateuint16_t 630Sstevel@tonic-gateddi_get16(ddi_acc_handle_t handle, uint16_t *addr) 640Sstevel@tonic-gate{ 650Sstevel@tonic-gate return (0); 660Sstevel@tonic-gate} 670Sstevel@tonic-gate 680Sstevel@tonic-gate/*ARGSUSED*/ 690Sstevel@tonic-gateuint16_t 700Sstevel@tonic-gateddi_mem_get16(ddi_acc_handle_t handle, uint16_t *addr) 710Sstevel@tonic-gate{ 720Sstevel@tonic-gate return (0); 730Sstevel@tonic-gate} 740Sstevel@tonic-gate 750Sstevel@tonic-gate/*ARGSUSED*/ 760Sstevel@tonic-gateuint16_t 770Sstevel@tonic-gateddi_io_get16(ddi_acc_handle_t handle, uint16_t *dev_addr) 780Sstevel@tonic-gate{ 790Sstevel@tonic-gate return (0); 800Sstevel@tonic-gate} 810Sstevel@tonic-gate 820Sstevel@tonic-gate/*ARGSUSED*/ 830Sstevel@tonic-gateuint32_t 840Sstevel@tonic-gateddi_get32(ddi_acc_handle_t handle, uint32_t *addr) 850Sstevel@tonic-gate{ 860Sstevel@tonic-gate return (0); 870Sstevel@tonic-gate} 880Sstevel@tonic-gate 890Sstevel@tonic-gate/*ARGSUSED*/ 900Sstevel@tonic-gateuint32_t 910Sstevel@tonic-gateddi_mem_get32(ddi_acc_handle_t handle, uint32_t *addr) 920Sstevel@tonic-gate{ 930Sstevel@tonic-gate return (0); 940Sstevel@tonic-gate} 950Sstevel@tonic-gate 960Sstevel@tonic-gate/*ARGSUSED*/ 970Sstevel@tonic-gateuint32_t 980Sstevel@tonic-gateddi_io_get32(ddi_acc_handle_t handle, uint32_t *dev_addr) 990Sstevel@tonic-gate{ 1000Sstevel@tonic-gate return (0); 1010Sstevel@tonic-gate} 1020Sstevel@tonic-gate 1030Sstevel@tonic-gate/*ARGSUSED*/ 1040Sstevel@tonic-gateuint64_t 1050Sstevel@tonic-gateddi_get64(ddi_acc_handle_t handle, uint64_t *addr) 1060Sstevel@tonic-gate{ 1070Sstevel@tonic-gate return (0); 1080Sstevel@tonic-gate} 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate/*ARGSUSED*/ 1110Sstevel@tonic-gateuint64_t 1120Sstevel@tonic-gateddi_mem_get64(ddi_acc_handle_t handle, uint64_t *addr) 1130Sstevel@tonic-gate{ 1140Sstevel@tonic-gate return (0); 1150Sstevel@tonic-gate} 1160Sstevel@tonic-gate 1170Sstevel@tonic-gate/*ARGSUSED*/ 1180Sstevel@tonic-gatevoid 1190Sstevel@tonic-gateddi_put8(ddi_acc_handle_t handle, uint8_t *addr, uint8_t value) 1200Sstevel@tonic-gate{} 1210Sstevel@tonic-gate 1220Sstevel@tonic-gate/*ARGSUSED*/ 1230Sstevel@tonic-gatevoid 1240Sstevel@tonic-gateddi_mem_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value) 1250Sstevel@tonic-gate{} 1260Sstevel@tonic-gate 1270Sstevel@tonic-gate/*ARGSUSED*/ 1280Sstevel@tonic-gatevoid 1290Sstevel@tonic-gateddi_io_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value) 1300Sstevel@tonic-gate{} 1310Sstevel@tonic-gate 1320Sstevel@tonic-gate/*ARGSUSED*/ 1330Sstevel@tonic-gatevoid 1340Sstevel@tonic-gateddi_put16(ddi_acc_handle_t handle, uint16_t *addr, uint16_t value) 1350Sstevel@tonic-gate{} 1360Sstevel@tonic-gate 1370Sstevel@tonic-gate/*ARGSUSED*/ 1380Sstevel@tonic-gatevoid 1390Sstevel@tonic-gateddi_mem_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value) 1400Sstevel@tonic-gate{} 1410Sstevel@tonic-gate 1420Sstevel@tonic-gate/*ARGSUSED*/ 1430Sstevel@tonic-gatevoid 1440Sstevel@tonic-gateddi_io_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value) 1450Sstevel@tonic-gate{} 1460Sstevel@tonic-gate 1470Sstevel@tonic-gate/*ARGSUSED*/ 1480Sstevel@tonic-gatevoid 1490Sstevel@tonic-gateddi_put32(ddi_acc_handle_t handle, uint32_t *addr, uint32_t value) 1500Sstevel@tonic-gate{} 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate/*ARGSUSED*/ 1530Sstevel@tonic-gatevoid 1540Sstevel@tonic-gateddi_mem_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value) 1550Sstevel@tonic-gate{} 1560Sstevel@tonic-gate 1570Sstevel@tonic-gate/*ARGSUSED*/ 1580Sstevel@tonic-gatevoid 1590Sstevel@tonic-gateddi_io_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value) 1600Sstevel@tonic-gate{} 1610Sstevel@tonic-gate 1620Sstevel@tonic-gate/*ARGSUSED*/ 1630Sstevel@tonic-gatevoid 1640Sstevel@tonic-gateddi_put64(ddi_acc_handle_t handle, uint64_t *addr, uint64_t value) 1650Sstevel@tonic-gate{} 1660Sstevel@tonic-gate 1670Sstevel@tonic-gate/*ARGSUSED*/ 1680Sstevel@tonic-gatevoid 1690Sstevel@tonic-gateddi_mem_put64(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value) 1700Sstevel@tonic-gate{} 1710Sstevel@tonic-gate 1720Sstevel@tonic-gate/*ARGSUSED*/ 1730Sstevel@tonic-gatevoid 1740Sstevel@tonic-gateddi_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr, uint8_t *dev_addr, 1750Sstevel@tonic-gate size_t repcount, uint_t flags) 1760Sstevel@tonic-gate{} 1770Sstevel@tonic-gate 1780Sstevel@tonic-gate/*ARGSUSED*/ 1790Sstevel@tonic-gatevoid 1800Sstevel@tonic-gateddi_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr, uint16_t *dev_addr, 1810Sstevel@tonic-gate size_t repcount, uint_t flags) 1820Sstevel@tonic-gate{} 1830Sstevel@tonic-gate 1840Sstevel@tonic-gate/*ARGSUSED*/ 1850Sstevel@tonic-gatevoid 1860Sstevel@tonic-gateddi_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr, uint32_t *dev_addr, 1870Sstevel@tonic-gate size_t repcount, uint_t flags) 1880Sstevel@tonic-gate{} 1890Sstevel@tonic-gate 1900Sstevel@tonic-gate/*ARGSUSED*/ 1910Sstevel@tonic-gatevoid 1920Sstevel@tonic-gateddi_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr, uint64_t *dev_addr, 1930Sstevel@tonic-gate size_t repcount, uint_t flags) 1940Sstevel@tonic-gate{} 1950Sstevel@tonic-gate 1960Sstevel@tonic-gate/*ARGSUSED*/ 1970Sstevel@tonic-gatevoid 1980Sstevel@tonic-gateddi_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr, uint8_t *dev_addr, 1990Sstevel@tonic-gate size_t repcount, uint_t flags) 2000Sstevel@tonic-gate{} 2010Sstevel@tonic-gate 2020Sstevel@tonic-gate/*ARGSUSED*/ 2030Sstevel@tonic-gatevoid 2040Sstevel@tonic-gateddi_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr, uint16_t *dev_addr, 2050Sstevel@tonic-gate size_t repcount, uint_t flags) 2060Sstevel@tonic-gate{} 2070Sstevel@tonic-gate 2080Sstevel@tonic-gate/*ARGSUSED*/ 2090Sstevel@tonic-gatevoid 2100Sstevel@tonic-gateddi_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr, uint32_t *dev_addr, 2110Sstevel@tonic-gate size_t repcount, uint_t flags) 2120Sstevel@tonic-gate{} 2130Sstevel@tonic-gate 2140Sstevel@tonic-gate/*ARGSUSED*/ 2150Sstevel@tonic-gatevoid 2160Sstevel@tonic-gateddi_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr, uint64_t *dev_addr, 2170Sstevel@tonic-gate size_t repcount, uint_t flags) 2180Sstevel@tonic-gate{} 2190Sstevel@tonic-gate 2200Sstevel@tonic-gate/*ARGSUSED*/ 2210Sstevel@tonic-gatevoid 2220Sstevel@tonic-gateddi_mem_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr, 2230Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags) 2240Sstevel@tonic-gate{} 2250Sstevel@tonic-gate 2260Sstevel@tonic-gate/*ARGSUSED*/ 2270Sstevel@tonic-gatevoid 2280Sstevel@tonic-gateddi_mem_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr, 2290Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags) 2300Sstevel@tonic-gate{} 2310Sstevel@tonic-gate 2320Sstevel@tonic-gate/*ARGSUSED*/ 2330Sstevel@tonic-gatevoid 2340Sstevel@tonic-gateddi_mem_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr, 2350Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags) 2360Sstevel@tonic-gate{} 2370Sstevel@tonic-gate 2380Sstevel@tonic-gate/*ARGSUSED*/ 2390Sstevel@tonic-gatevoid 2400Sstevel@tonic-gateddi_mem_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr, 2410Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags) 2420Sstevel@tonic-gate{} 2430Sstevel@tonic-gate 2440Sstevel@tonic-gate/*ARGSUSED*/ 2450Sstevel@tonic-gatevoid 2460Sstevel@tonic-gateddi_mem_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr, 2470Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags) 2480Sstevel@tonic-gate{} 2490Sstevel@tonic-gate 2500Sstevel@tonic-gate/*ARGSUSED*/ 2510Sstevel@tonic-gatevoid 2520Sstevel@tonic-gateddi_mem_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr, 2530Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags) 2540Sstevel@tonic-gate{} 2550Sstevel@tonic-gate 2560Sstevel@tonic-gate/*ARGSUSED*/ 2570Sstevel@tonic-gatevoid 2580Sstevel@tonic-gateddi_mem_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr, 2590Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags) 2600Sstevel@tonic-gate{} 2610Sstevel@tonic-gate 2620Sstevel@tonic-gate/*ARGSUSED*/ 2630Sstevel@tonic-gatevoid 2640Sstevel@tonic-gateddi_mem_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr, 2650Sstevel@tonic-gate uint64_t *dev_addr, size_t repcount, uint_t flags) 2660Sstevel@tonic-gate{} 2670Sstevel@tonic-gate 2680Sstevel@tonic-gate#else /* lint */ 2690Sstevel@tonic-gate 2700Sstevel@tonic-gate 2710Sstevel@tonic-gate#if defined(__amd64) 2720Sstevel@tonic-gate 273*1106Smrj ENTRY(ddi_get8) 274*1106Smrj ALTENTRY(ddi_getb) 2750Sstevel@tonic-gate ALTENTRY(ddi_mem_getb) 2760Sstevel@tonic-gate ALTENTRY(ddi_mem_get8) 2770Sstevel@tonic-gate ALTENTRY(ddi_io_getb) 2780Sstevel@tonic-gate ALTENTRY(ddi_io_get8) 2790Sstevel@tonic-gate movl ACC_ATTR(%rdi), %edx 2800Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx 2810Sstevel@tonic-gate jne 1f 2820Sstevel@tonic-gate movq %rsi, %rdx 2830Sstevel@tonic-gate xorq %rax, %rax 2840Sstevel@tonic-gate inb (%dx) 2850Sstevel@tonic-gate ret 2860Sstevel@tonic-gate1: 2870Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx 2880Sstevel@tonic-gate jne 2f 2890Sstevel@tonic-gate movzbq (%rsi), %rax 2900Sstevel@tonic-gate ret 2910Sstevel@tonic-gate2: 2920Sstevel@tonic-gate jmp *ACC_GETB(%rdi) 293*1106Smrj SET_SIZE(ddi_get8) 2940Sstevel@tonic-gate SET_SIZE(ddi_getb) 2950Sstevel@tonic-gate SET_SIZE(ddi_mem_getb) 2960Sstevel@tonic-gate SET_SIZE(ddi_mem_get8) 2970Sstevel@tonic-gate SET_SIZE(ddi_io_getb) 2980Sstevel@tonic-gate SET_SIZE(ddi_io_get8) 2990Sstevel@tonic-gate 3000Sstevel@tonic-gate#elif defined(__i386) 3010Sstevel@tonic-gate 302*1106Smrj ENTRY(ddi_get8) 303*1106Smrj ALTENTRY(ddi_getb) 3040Sstevel@tonic-gate ALTENTRY(ddi_mem_getb) 3050Sstevel@tonic-gate ALTENTRY(ddi_mem_get8) 3060Sstevel@tonic-gate ALTENTRY(ddi_io_getb) 3070Sstevel@tonic-gate ALTENTRY(ddi_io_get8) 3080Sstevel@tonic-gate movl 4(%esp), %eax 3090Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 3100Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 3110Sstevel@tonic-gate jne 1f 3120Sstevel@tonic-gate movl 8(%esp), %edx 3130Sstevel@tonic-gate xorl %eax, %eax 3140Sstevel@tonic-gate inb (%dx) 3150Sstevel@tonic-gate ret 3160Sstevel@tonic-gate1: 3170Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 3180Sstevel@tonic-gate jne 2f 3190Sstevel@tonic-gate movl 8(%esp), %eax 3200Sstevel@tonic-gate movzbl (%eax), %eax 3210Sstevel@tonic-gate ret 3220Sstevel@tonic-gate2: 3230Sstevel@tonic-gate jmp *ACC_GETB(%eax) 324*1106Smrj SET_SIZE(ddi_get8) 3250Sstevel@tonic-gate SET_SIZE(ddi_getb) 3260Sstevel@tonic-gate SET_SIZE(ddi_mem_getb) 3270Sstevel@tonic-gate SET_SIZE(ddi_mem_get8) 3280Sstevel@tonic-gate SET_SIZE(ddi_io_getb) 3290Sstevel@tonic-gate SET_SIZE(ddi_io_get8) 3300Sstevel@tonic-gate 3310Sstevel@tonic-gate#endif /* __i386 */ 3320Sstevel@tonic-gate 3330Sstevel@tonic-gate#if defined(__amd64) 3340Sstevel@tonic-gate 335*1106Smrj ENTRY(ddi_get16) 336*1106Smrj ALTENTRY(ddi_getw) 3370Sstevel@tonic-gate ALTENTRY(ddi_mem_getw) 3380Sstevel@tonic-gate ALTENTRY(ddi_mem_get16) 3390Sstevel@tonic-gate ALTENTRY(ddi_io_getw) 3400Sstevel@tonic-gate ALTENTRY(ddi_io_get16) 3410Sstevel@tonic-gate movl ACC_ATTR(%rdi), %edx 3420Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx 3430Sstevel@tonic-gate jne 3f 3440Sstevel@tonic-gate movq %rsi, %rdx 3450Sstevel@tonic-gate xorq %rax, %rax 3460Sstevel@tonic-gate inw (%dx) 3470Sstevel@tonic-gate ret 3480Sstevel@tonic-gate3: 3490Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx 3500Sstevel@tonic-gate jne 4f 3510Sstevel@tonic-gate movzwq (%rsi), %rax 3520Sstevel@tonic-gate ret 3530Sstevel@tonic-gate4: 3540Sstevel@tonic-gate jmp *ACC_GETW(%rdi) 355*1106Smrj SET_SIZE(ddi_get16) 3560Sstevel@tonic-gate SET_SIZE(ddi_getw) 3570Sstevel@tonic-gate SET_SIZE(ddi_mem_getw) 3580Sstevel@tonic-gate SET_SIZE(ddi_mem_get16) 3590Sstevel@tonic-gate SET_SIZE(ddi_io_getw) 3600Sstevel@tonic-gate SET_SIZE(ddi_io_get16) 3610Sstevel@tonic-gate 3620Sstevel@tonic-gate#elif defined(__i386) 3630Sstevel@tonic-gate 364*1106Smrj ENTRY(ddi_get16) 365*1106Smrj ALTENTRY(ddi_getw) 3660Sstevel@tonic-gate ALTENTRY(ddi_mem_getw) 3670Sstevel@tonic-gate ALTENTRY(ddi_mem_get16) 3680Sstevel@tonic-gate ALTENTRY(ddi_io_getw) 3690Sstevel@tonic-gate ALTENTRY(ddi_io_get16) 3700Sstevel@tonic-gate movl 4(%esp), %eax 3710Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 3720Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 3730Sstevel@tonic-gate jne 3f 3740Sstevel@tonic-gate movl 8(%esp), %edx 3750Sstevel@tonic-gate xorl %eax, %eax 3760Sstevel@tonic-gate inw (%dx) 3770Sstevel@tonic-gate ret 3780Sstevel@tonic-gate3: 3790Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 3800Sstevel@tonic-gate jne 4f 3810Sstevel@tonic-gate movl 8(%esp), %eax 3820Sstevel@tonic-gate movzwl (%eax), %eax 3830Sstevel@tonic-gate ret 3840Sstevel@tonic-gate4: 3850Sstevel@tonic-gate jmp *ACC_GETW(%eax) 386*1106Smrj SET_SIZE(ddi_get16) 3870Sstevel@tonic-gate SET_SIZE(ddi_getw) 3880Sstevel@tonic-gate SET_SIZE(ddi_mem_getw) 3890Sstevel@tonic-gate SET_SIZE(ddi_mem_get16) 3900Sstevel@tonic-gate SET_SIZE(ddi_io_getw) 3910Sstevel@tonic-gate SET_SIZE(ddi_io_get16) 3920Sstevel@tonic-gate 3930Sstevel@tonic-gate#endif /* __i386 */ 3940Sstevel@tonic-gate 3950Sstevel@tonic-gate#if defined(__amd64) 3960Sstevel@tonic-gate 397*1106Smrj ENTRY(ddi_get32) 398*1106Smrj ALTENTRY(ddi_getl) 3990Sstevel@tonic-gate ALTENTRY(ddi_mem_getl) 4000Sstevel@tonic-gate ALTENTRY(ddi_mem_get32) 4010Sstevel@tonic-gate ALTENTRY(ddi_io_getl) 4020Sstevel@tonic-gate ALTENTRY(ddi_io_get32) 4030Sstevel@tonic-gate movl ACC_ATTR(%rdi), %edx 4040Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx 4050Sstevel@tonic-gate jne 5f 4060Sstevel@tonic-gate movq %rsi, %rdx 4070Sstevel@tonic-gate inl (%dx) 4080Sstevel@tonic-gate ret 4090Sstevel@tonic-gate5: 4100Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx 4110Sstevel@tonic-gate jne 6f 4120Sstevel@tonic-gate movl (%rsi), %eax 4130Sstevel@tonic-gate ret 4140Sstevel@tonic-gate6: 4150Sstevel@tonic-gate jmp *ACC_GETL(%rdi) 416*1106Smrj SET_SIZE(ddi_get32) 4170Sstevel@tonic-gate SET_SIZE(ddi_getl) 4180Sstevel@tonic-gate SET_SIZE(ddi_mem_getl) 4190Sstevel@tonic-gate SET_SIZE(ddi_mem_get32) 4200Sstevel@tonic-gate SET_SIZE(ddi_io_getl) 4210Sstevel@tonic-gate SET_SIZE(ddi_io_get32) 4220Sstevel@tonic-gate 4230Sstevel@tonic-gate#elif defined(__i386) 4240Sstevel@tonic-gate 425*1106Smrj ENTRY(ddi_get32) 426*1106Smrj ALTENTRY(ddi_getl) 4270Sstevel@tonic-gate ALTENTRY(ddi_mem_getl) 4280Sstevel@tonic-gate ALTENTRY(ddi_mem_get32) 4290Sstevel@tonic-gate ALTENTRY(ddi_io_getl) 4300Sstevel@tonic-gate ALTENTRY(ddi_io_get32) 4310Sstevel@tonic-gate movl 4(%esp), %eax 4320Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 4330Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 4340Sstevel@tonic-gate jne 5f 4350Sstevel@tonic-gate movl 8(%esp), %edx 4360Sstevel@tonic-gate inl (%dx) 4370Sstevel@tonic-gate ret 4380Sstevel@tonic-gate5: 4390Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 4400Sstevel@tonic-gate jne 6f 4410Sstevel@tonic-gate movl 8(%esp), %eax 4420Sstevel@tonic-gate movl (%eax), %eax 4430Sstevel@tonic-gate ret 4440Sstevel@tonic-gate6: 4450Sstevel@tonic-gate jmp *ACC_GETL(%eax) 446*1106Smrj SET_SIZE(ddi_get32) 4470Sstevel@tonic-gate SET_SIZE(ddi_getl) 4480Sstevel@tonic-gate SET_SIZE(ddi_mem_getl) 4490Sstevel@tonic-gate SET_SIZE(ddi_mem_get32) 4500Sstevel@tonic-gate SET_SIZE(ddi_io_getl) 4510Sstevel@tonic-gate SET_SIZE(ddi_io_get32) 4520Sstevel@tonic-gate 4530Sstevel@tonic-gate#endif /* __i386 */ 4540Sstevel@tonic-gate 4550Sstevel@tonic-gate#if defined(__amd64) 4560Sstevel@tonic-gate 457*1106Smrj ENTRY(ddi_get64) 458*1106Smrj ALTENTRY(ddi_getll) 4590Sstevel@tonic-gate ALTENTRY(ddi_mem_getll) 4600Sstevel@tonic-gate ALTENTRY(ddi_mem_get64) 4610Sstevel@tonic-gate jmp *ACC_GETLL(%rdi) 462*1106Smrj SET_SIZE(ddi_get64) 4630Sstevel@tonic-gate SET_SIZE(ddi_getll) 4640Sstevel@tonic-gate SET_SIZE(ddi_mem_getll) 4650Sstevel@tonic-gate SET_SIZE(ddi_mem_get64) 4660Sstevel@tonic-gate 4670Sstevel@tonic-gate#elif defined(__i386) 4680Sstevel@tonic-gate 469*1106Smrj ENTRY(ddi_get64) 470*1106Smrj ALTENTRY(ddi_getll) 4710Sstevel@tonic-gate ALTENTRY(ddi_mem_getll) 4720Sstevel@tonic-gate ALTENTRY(ddi_mem_get64) 4730Sstevel@tonic-gate movl 4(%esp), %eax 4740Sstevel@tonic-gate jmp *ACC_GETLL(%eax) 475*1106Smrj SET_SIZE(ddi_get64) 4760Sstevel@tonic-gate SET_SIZE(ddi_getll) 4770Sstevel@tonic-gate SET_SIZE(ddi_mem_getll) 4780Sstevel@tonic-gate SET_SIZE(ddi_mem_get64) 4790Sstevel@tonic-gate 4800Sstevel@tonic-gate#endif /* __i386 */ 4810Sstevel@tonic-gate 4820Sstevel@tonic-gate#if defined(__amd64) 4830Sstevel@tonic-gate 484*1106Smrj ENTRY(ddi_put8) 485*1106Smrj ALTENTRY(ddi_putb) 4860Sstevel@tonic-gate ALTENTRY(ddi_mem_putb) 4870Sstevel@tonic-gate ALTENTRY(ddi_mem_put8) 4880Sstevel@tonic-gate ALTENTRY(ddi_io_putb) 4890Sstevel@tonic-gate ALTENTRY(ddi_io_put8) 4900Sstevel@tonic-gate movl ACC_ATTR(%rdi), %ecx 4910Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 4920Sstevel@tonic-gate jne 7f 4930Sstevel@tonic-gate movq %rdx, %rax 4940Sstevel@tonic-gate movq %rsi, %rdx 4950Sstevel@tonic-gate outb (%dx) 4960Sstevel@tonic-gate ret 4970Sstevel@tonic-gate7: 4980Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 4990Sstevel@tonic-gate jne 8f 5000Sstevel@tonic-gate movb %dl, (%rsi) 5010Sstevel@tonic-gate ret 5020Sstevel@tonic-gate8: 5030Sstevel@tonic-gate jmp *ACC_PUTB(%rdi) 504*1106Smrj SET_SIZE(ddi_put8) 5050Sstevel@tonic-gate SET_SIZE(ddi_putb) 5060Sstevel@tonic-gate SET_SIZE(ddi_mem_putb) 5070Sstevel@tonic-gate SET_SIZE(ddi_mem_put8) 5080Sstevel@tonic-gate SET_SIZE(ddi_io_putb) 5090Sstevel@tonic-gate SET_SIZE(ddi_io_put8) 5100Sstevel@tonic-gate 5110Sstevel@tonic-gate#elif defined(__i386) 5120Sstevel@tonic-gate 513*1106Smrj ENTRY(ddi_put8) 514*1106Smrj ALTENTRY(ddi_putb) 5150Sstevel@tonic-gate ALTENTRY(ddi_mem_putb) 5160Sstevel@tonic-gate ALTENTRY(ddi_mem_put8) 5170Sstevel@tonic-gate ALTENTRY(ddi_io_putb) 5180Sstevel@tonic-gate ALTENTRY(ddi_io_put8) 5190Sstevel@tonic-gate movl 4(%esp), %eax 5200Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 5210Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 5220Sstevel@tonic-gate jne 7f 5230Sstevel@tonic-gate movl 12(%esp), %eax 5240Sstevel@tonic-gate movl 8(%esp), %edx 5250Sstevel@tonic-gate outb (%dx) 5260Sstevel@tonic-gate ret 5270Sstevel@tonic-gate7: 5280Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 5290Sstevel@tonic-gate jne 8f 5300Sstevel@tonic-gate movl 8(%esp), %eax 5310Sstevel@tonic-gate movl 12(%esp), %ecx 5320Sstevel@tonic-gate movb %cl, (%eax) 5330Sstevel@tonic-gate ret 5340Sstevel@tonic-gate8: 5350Sstevel@tonic-gate jmp *ACC_PUTB(%eax) 536*1106Smrj SET_SIZE(ddi_put8) 5370Sstevel@tonic-gate SET_SIZE(ddi_putb) 5380Sstevel@tonic-gate SET_SIZE(ddi_mem_putb) 5390Sstevel@tonic-gate SET_SIZE(ddi_mem_put8) 5400Sstevel@tonic-gate SET_SIZE(ddi_io_putb) 5410Sstevel@tonic-gate SET_SIZE(ddi_io_put8) 5420Sstevel@tonic-gate 5430Sstevel@tonic-gate#endif /* __i386 */ 5440Sstevel@tonic-gate 5450Sstevel@tonic-gate#if defined(__amd64) 5460Sstevel@tonic-gate 547*1106Smrj ENTRY(ddi_put16) 548*1106Smrj ALTENTRY(ddi_putw) 5490Sstevel@tonic-gate ALTENTRY(ddi_mem_putw) 5500Sstevel@tonic-gate ALTENTRY(ddi_mem_put16) 5510Sstevel@tonic-gate ALTENTRY(ddi_io_putw) 5520Sstevel@tonic-gate ALTENTRY(ddi_io_put16) 5530Sstevel@tonic-gate movl ACC_ATTR(%rdi), %ecx 5540Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 5550Sstevel@tonic-gate jne 8f 5560Sstevel@tonic-gate movq %rdx, %rax 5570Sstevel@tonic-gate movq %rsi, %rdx 5580Sstevel@tonic-gate outw (%dx) 5590Sstevel@tonic-gate ret 5600Sstevel@tonic-gate8: 5610Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 5620Sstevel@tonic-gate jne 9f 5630Sstevel@tonic-gate movw %dx, (%rsi) 5640Sstevel@tonic-gate ret 5650Sstevel@tonic-gate9: 5660Sstevel@tonic-gate jmp *ACC_PUTW(%rdi) 567*1106Smrj SET_SIZE(ddi_put16) 5680Sstevel@tonic-gate SET_SIZE(ddi_putw) 5690Sstevel@tonic-gate SET_SIZE(ddi_mem_putw) 5700Sstevel@tonic-gate SET_SIZE(ddi_mem_put16) 5710Sstevel@tonic-gate SET_SIZE(ddi_io_putw) 5720Sstevel@tonic-gate SET_SIZE(ddi_io_put16) 5730Sstevel@tonic-gate 5740Sstevel@tonic-gate#elif defined(__i386) 5750Sstevel@tonic-gate 576*1106Smrj ENTRY(ddi_put16) 577*1106Smrj ALTENTRY(ddi_putw) 5780Sstevel@tonic-gate ALTENTRY(ddi_mem_putw) 5790Sstevel@tonic-gate ALTENTRY(ddi_mem_put16) 5800Sstevel@tonic-gate ALTENTRY(ddi_io_putw) 5810Sstevel@tonic-gate ALTENTRY(ddi_io_put16) 5820Sstevel@tonic-gate movl 4(%esp), %eax 5830Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 5840Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 5850Sstevel@tonic-gate jne 8f 5860Sstevel@tonic-gate movl 12(%esp), %eax 5870Sstevel@tonic-gate movl 8(%esp), %edx 5880Sstevel@tonic-gate outw (%dx) 5890Sstevel@tonic-gate ret 5900Sstevel@tonic-gate8: 5910Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 5920Sstevel@tonic-gate jne 9f 5930Sstevel@tonic-gate movl 8(%esp), %eax 5940Sstevel@tonic-gate movl 12(%esp), %ecx 5950Sstevel@tonic-gate movw %cx, (%eax) 5960Sstevel@tonic-gate ret 5970Sstevel@tonic-gate9: 5980Sstevel@tonic-gate jmp *ACC_PUTW(%eax) 599*1106Smrj SET_SIZE(ddi_put16) 6000Sstevel@tonic-gate SET_SIZE(ddi_putw) 6010Sstevel@tonic-gate SET_SIZE(ddi_mem_putw) 6020Sstevel@tonic-gate SET_SIZE(ddi_mem_put16) 6030Sstevel@tonic-gate SET_SIZE(ddi_io_putw) 6040Sstevel@tonic-gate SET_SIZE(ddi_io_put16) 6050Sstevel@tonic-gate 6060Sstevel@tonic-gate#endif /* __i386 */ 6070Sstevel@tonic-gate 6080Sstevel@tonic-gate#if defined(__amd64) 6090Sstevel@tonic-gate 610*1106Smrj ENTRY(ddi_put32) 611*1106Smrj ALTENTRY(ddi_putl) 6120Sstevel@tonic-gate ALTENTRY(ddi_mem_putl) 6130Sstevel@tonic-gate ALTENTRY(ddi_mem_put32) 6140Sstevel@tonic-gate ALTENTRY(ddi_io_putl) 6150Sstevel@tonic-gate ALTENTRY(ddi_io_put32) 6160Sstevel@tonic-gate movl ACC_ATTR(%rdi), %ecx 6170Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 6180Sstevel@tonic-gate jne 8f 6190Sstevel@tonic-gate movq %rdx, %rax 6200Sstevel@tonic-gate movq %rsi, %rdx 6210Sstevel@tonic-gate outl (%dx) 6220Sstevel@tonic-gate ret 6230Sstevel@tonic-gate8: 6240Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 6250Sstevel@tonic-gate jne 9f 6260Sstevel@tonic-gate movl %edx, (%rsi) 6270Sstevel@tonic-gate ret 6280Sstevel@tonic-gate9: 6290Sstevel@tonic-gate jmp *ACC_PUTL(%rdi) 630*1106Smrj SET_SIZE(ddi_put32) 6310Sstevel@tonic-gate SET_SIZE(ddi_putl) 6320Sstevel@tonic-gate SET_SIZE(ddi_mem_putl) 6330Sstevel@tonic-gate SET_SIZE(ddi_mem_put32) 6340Sstevel@tonic-gate SET_SIZE(ddi_io_putl) 6350Sstevel@tonic-gate SET_SIZE(ddi_io_put32) 6360Sstevel@tonic-gate 6370Sstevel@tonic-gate#elif defined(__i386) 6380Sstevel@tonic-gate 639*1106Smrj ENTRY(ddi_put32) 640*1106Smrj ALTENTRY(ddi_putl) 6410Sstevel@tonic-gate ALTENTRY(ddi_mem_putl) 6420Sstevel@tonic-gate ALTENTRY(ddi_mem_put32) 6430Sstevel@tonic-gate ALTENTRY(ddi_io_putl) 6440Sstevel@tonic-gate ALTENTRY(ddi_io_put32) 6450Sstevel@tonic-gate movl 4(%esp), %eax 6460Sstevel@tonic-gate movl ACC_ATTR(%eax), %ecx 6470Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx 6480Sstevel@tonic-gate jne 8f 6490Sstevel@tonic-gate movl 12(%esp), %eax 6500Sstevel@tonic-gate movl 8(%esp), %edx 6510Sstevel@tonic-gate outl (%dx) 6520Sstevel@tonic-gate ret 6530Sstevel@tonic-gate8: 6540Sstevel@tonic-gate cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx 6550Sstevel@tonic-gate jne 9f 6560Sstevel@tonic-gate movl 8(%esp), %eax 6570Sstevel@tonic-gate movl 12(%esp), %ecx 6580Sstevel@tonic-gate movl %ecx, (%eax) 6590Sstevel@tonic-gate ret 6600Sstevel@tonic-gate9: 6610Sstevel@tonic-gate jmp *ACC_PUTL(%eax) 662*1106Smrj SET_SIZE(ddi_put32) 6630Sstevel@tonic-gate SET_SIZE(ddi_putl) 6640Sstevel@tonic-gate SET_SIZE(ddi_mem_putl) 6650Sstevel@tonic-gate SET_SIZE(ddi_mem_put32) 6660Sstevel@tonic-gate SET_SIZE(ddi_io_putl) 6670Sstevel@tonic-gate SET_SIZE(ddi_io_put32) 6680Sstevel@tonic-gate 6690Sstevel@tonic-gate#endif /* __i386 */ 6700Sstevel@tonic-gate 6710Sstevel@tonic-gate#if defined(__amd64) 6720Sstevel@tonic-gate 673*1106Smrj ENTRY(ddi_put64) 674*1106Smrj ALTENTRY(ddi_putll) 6750Sstevel@tonic-gate ALTENTRY(ddi_mem_putll) 6760Sstevel@tonic-gate ALTENTRY(ddi_mem_put64) 6770Sstevel@tonic-gate jmp *ACC_PUTLL(%rdi) 678*1106Smrj SET_SIZE(ddi_put64) 6790Sstevel@tonic-gate SET_SIZE(ddi_putll) 6800Sstevel@tonic-gate SET_SIZE(ddi_mem_putll) 6810Sstevel@tonic-gate SET_SIZE(ddi_mem_put64) 6820Sstevel@tonic-gate 6830Sstevel@tonic-gate#elif defined(__i386) 6840Sstevel@tonic-gate 685*1106Smrj ENTRY(ddi_put64) 686*1106Smrj ALTENTRY(ddi_putll) 6870Sstevel@tonic-gate ALTENTRY(ddi_mem_putll) 6880Sstevel@tonic-gate ALTENTRY(ddi_mem_put64) 6890Sstevel@tonic-gate movl 4(%esp), %eax 6900Sstevel@tonic-gate jmp *ACC_PUTLL(%eax) 691*1106Smrj SET_SIZE(ddi_put64) 6920Sstevel@tonic-gate SET_SIZE(ddi_putll) 6930Sstevel@tonic-gate SET_SIZE(ddi_mem_putll) 6940Sstevel@tonic-gate SET_SIZE(ddi_mem_put64) 6950Sstevel@tonic-gate 6960Sstevel@tonic-gate#endif /* __i386 */ 6970Sstevel@tonic-gate 6980Sstevel@tonic-gate#if defined(__amd64) 6990Sstevel@tonic-gate 700*1106Smrj ENTRY(ddi_rep_get8) 701*1106Smrj ALTENTRY(ddi_rep_getb) 7020Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getb) 7030Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get8) 7040Sstevel@tonic-gate jmp *ACC_REP_GETB(%rdi) 705*1106Smrj SET_SIZE(ddi_rep_get8) 7060Sstevel@tonic-gate SET_SIZE(ddi_rep_getb) 7070Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getb) 7080Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get8) 7090Sstevel@tonic-gate 7100Sstevel@tonic-gate#elif defined(__i386) 7110Sstevel@tonic-gate 712*1106Smrj ENTRY(ddi_rep_get8) 713*1106Smrj ALTENTRY(ddi_rep_getb) 7140Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getb) 7150Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get8) 7160Sstevel@tonic-gate movl 4(%esp), %eax 7170Sstevel@tonic-gate jmp *ACC_REP_GETB(%eax) 718*1106Smrj SET_SIZE(ddi_rep_get8) 7190Sstevel@tonic-gate SET_SIZE(ddi_rep_getb) 7200Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getb) 7210Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get8) 7220Sstevel@tonic-gate 7230Sstevel@tonic-gate#endif /* __i386 */ 7240Sstevel@tonic-gate 7250Sstevel@tonic-gate#if defined(__amd64) 7260Sstevel@tonic-gate 727*1106Smrj ENTRY(ddi_rep_get16) 728*1106Smrj ALTENTRY(ddi_rep_getw) 7290Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getw) 7300Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get16) 7310Sstevel@tonic-gate jmp *ACC_REP_GETW(%rdi) 732*1106Smrj SET_SIZE(ddi_rep_get16) 7330Sstevel@tonic-gate SET_SIZE(ddi_rep_getw) 7340Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getw) 7350Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get16) 7360Sstevel@tonic-gate 7370Sstevel@tonic-gate#elif defined(__i386) 7380Sstevel@tonic-gate 739*1106Smrj ENTRY(ddi_rep_get16) 740*1106Smrj ALTENTRY(ddi_rep_getw) 7410Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getw) 7420Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get16) 7430Sstevel@tonic-gate movl 4(%esp), %eax 7440Sstevel@tonic-gate jmp *ACC_REP_GETW(%eax) 745*1106Smrj SET_SIZE(ddi_rep_get16) 7460Sstevel@tonic-gate SET_SIZE(ddi_rep_getw) 7470Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getw) 7480Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get16) 7490Sstevel@tonic-gate 7500Sstevel@tonic-gate#endif /* __i386 */ 7510Sstevel@tonic-gate 7520Sstevel@tonic-gate#if defined(__amd64) 7530Sstevel@tonic-gate 754*1106Smrj ENTRY(ddi_rep_get32) 755*1106Smrj ALTENTRY(ddi_rep_getl) 7560Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getl) 7570Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get32) 7580Sstevel@tonic-gate jmp *ACC_REP_GETL(%rdi) 759*1106Smrj SET_SIZE(ddi_rep_get32) 7600Sstevel@tonic-gate SET_SIZE(ddi_rep_getl) 7610Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getl) 7620Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get32) 7630Sstevel@tonic-gate 7640Sstevel@tonic-gate#elif defined(__i386) 7650Sstevel@tonic-gate 766*1106Smrj ENTRY(ddi_rep_get32) 767*1106Smrj ALTENTRY(ddi_rep_getl) 7680Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getl) 7690Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get32) 7700Sstevel@tonic-gate movl 4(%esp), %eax 7710Sstevel@tonic-gate jmp *ACC_REP_GETL(%eax) 772*1106Smrj SET_SIZE(ddi_rep_get32) 7730Sstevel@tonic-gate SET_SIZE(ddi_rep_getl) 7740Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getl) 7750Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get32) 7760Sstevel@tonic-gate 7770Sstevel@tonic-gate#endif /* __i386 */ 7780Sstevel@tonic-gate 7790Sstevel@tonic-gate#if defined(__amd64) 7800Sstevel@tonic-gate 781*1106Smrj ENTRY(ddi_rep_get64) 782*1106Smrj ALTENTRY(ddi_rep_getll) 7830Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getll) 7840Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get64) 7850Sstevel@tonic-gate jmp *ACC_REP_GETLL(%rdi) 786*1106Smrj SET_SIZE(ddi_rep_get64) 7870Sstevel@tonic-gate SET_SIZE(ddi_rep_getll) 7880Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getll) 7890Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get64) 7900Sstevel@tonic-gate 7910Sstevel@tonic-gate#elif defined(__i386) 7920Sstevel@tonic-gate 793*1106Smrj ENTRY(ddi_rep_get64) 794*1106Smrj ALTENTRY(ddi_rep_getll) 7950Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_getll) 7960Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_get64) 7970Sstevel@tonic-gate movl 4(%esp), %eax 7980Sstevel@tonic-gate jmp *ACC_REP_GETLL(%eax) 799*1106Smrj SET_SIZE(ddi_rep_get64) 8000Sstevel@tonic-gate SET_SIZE(ddi_rep_getll) 8010Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_getll) 8020Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_get64) 8030Sstevel@tonic-gate 8040Sstevel@tonic-gate#endif /* __i386 */ 8050Sstevel@tonic-gate 8060Sstevel@tonic-gate#if defined(__amd64) 8070Sstevel@tonic-gate 808*1106Smrj ENTRY(ddi_rep_put8) 809*1106Smrj ALTENTRY(ddi_rep_putb) 8100Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putb) 8110Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put8) 8120Sstevel@tonic-gate jmp *ACC_REP_PUTB(%rdi) 813*1106Smrj SET_SIZE(ddi_rep_put8) 8140Sstevel@tonic-gate SET_SIZE(ddi_rep_putb) 8150Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putb) 8160Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put8) 8170Sstevel@tonic-gate 8180Sstevel@tonic-gate#elif defined(__i386) 8190Sstevel@tonic-gate 820*1106Smrj ENTRY(ddi_rep_put8) 821*1106Smrj ALTENTRY(ddi_rep_putb) 8220Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putb) 8230Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put8) 8240Sstevel@tonic-gate movl 4(%esp), %eax 8250Sstevel@tonic-gate jmp *ACC_REP_PUTB(%eax) 826*1106Smrj SET_SIZE(ddi_rep_put8) 8270Sstevel@tonic-gate SET_SIZE(ddi_rep_putb) 8280Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putb) 8290Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put8) 8300Sstevel@tonic-gate 8310Sstevel@tonic-gate#endif /* __i386 */ 8320Sstevel@tonic-gate 8330Sstevel@tonic-gate#if defined(__amd64) 8340Sstevel@tonic-gate 835*1106Smrj ENTRY(ddi_rep_put16) 836*1106Smrj ALTENTRY(ddi_rep_putw) 8370Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putw) 8380Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put16) 8390Sstevel@tonic-gate jmp *ACC_REP_PUTW(%rdi) 840*1106Smrj SET_SIZE(ddi_rep_put16) 8410Sstevel@tonic-gate SET_SIZE(ddi_rep_putw) 8420Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putw) 8430Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put16) 8440Sstevel@tonic-gate 8450Sstevel@tonic-gate#elif defined(__i386) 8460Sstevel@tonic-gate 847*1106Smrj ENTRY(ddi_rep_put16) 848*1106Smrj ALTENTRY(ddi_rep_putw) 8490Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putw) 8500Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put16) 8510Sstevel@tonic-gate movl 4(%esp), %eax 8520Sstevel@tonic-gate jmp *ACC_REP_PUTW(%eax) 853*1106Smrj SET_SIZE(ddi_rep_put16) 8540Sstevel@tonic-gate SET_SIZE(ddi_rep_putw) 8550Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putw) 8560Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put16) 8570Sstevel@tonic-gate 8580Sstevel@tonic-gate#endif /* __i386 */ 8590Sstevel@tonic-gate 8600Sstevel@tonic-gate#if defined(__amd64) 8610Sstevel@tonic-gate 862*1106Smrj ENTRY(ddi_rep_put32) 863*1106Smrj ALTENTRY(ddi_rep_putl) 8640Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putl) 8650Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put32) 8660Sstevel@tonic-gate jmp *ACC_REP_PUTL(%rdi) 867*1106Smrj SET_SIZE(ddi_rep_put32) 8680Sstevel@tonic-gate SET_SIZE(ddi_rep_putl) 8690Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putl) 8700Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put32) 8710Sstevel@tonic-gate 8720Sstevel@tonic-gate#elif defined(__i386) 8730Sstevel@tonic-gate 874*1106Smrj ENTRY(ddi_rep_put32) 875*1106Smrj ALTENTRY(ddi_rep_putl) 8760Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putl) 8770Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put32) 8780Sstevel@tonic-gate movl 4(%esp), %eax 8790Sstevel@tonic-gate jmp *ACC_REP_PUTL(%eax) 880*1106Smrj SET_SIZE(ddi_rep_put32) 8810Sstevel@tonic-gate SET_SIZE(ddi_rep_putl) 8820Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putl) 8830Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put32) 8840Sstevel@tonic-gate 8850Sstevel@tonic-gate#endif /* __i386 */ 8860Sstevel@tonic-gate 8870Sstevel@tonic-gate#if defined(__amd64) 8880Sstevel@tonic-gate 889*1106Smrj ENTRY(ddi_rep_put64) 890*1106Smrj ALTENTRY(ddi_rep_putll) 8910Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putll) 8920Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put64) 8930Sstevel@tonic-gate jmp *ACC_REP_PUTLL(%rdi) 894*1106Smrj SET_SIZE(ddi_rep_put64) 8950Sstevel@tonic-gate SET_SIZE(ddi_rep_putll) 8960Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putll) 8970Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put64) 8980Sstevel@tonic-gate 8990Sstevel@tonic-gate#elif defined(__i386) 9000Sstevel@tonic-gate 901*1106Smrj ENTRY(ddi_rep_put64) 902*1106Smrj ALTENTRY(ddi_rep_putll) 9030Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_putll) 9040Sstevel@tonic-gate ALTENTRY(ddi_mem_rep_put64) 9050Sstevel@tonic-gate movl 4(%esp), %eax 9060Sstevel@tonic-gate jmp *ACC_REP_PUTLL(%eax) 907*1106Smrj SET_SIZE(ddi_rep_put64) 9080Sstevel@tonic-gate SET_SIZE(ddi_rep_putll) 9090Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_putll) 9100Sstevel@tonic-gate SET_SIZE(ddi_mem_rep_put64) 9110Sstevel@tonic-gate 9120Sstevel@tonic-gate#endif /* __i386 */ 9130Sstevel@tonic-gate 9140Sstevel@tonic-gate#endif /* lint */ 9150Sstevel@tonic-gate 9160Sstevel@tonic-gate#if defined(lint) || defined(__lint) 9170Sstevel@tonic-gate 9180Sstevel@tonic-gate/*ARGSUSED*/ 9190Sstevel@tonic-gateuint8_t 9200Sstevel@tonic-gatei_ddi_vaddr_get8(ddi_acc_impl_t *hdlp, uint8_t *addr) 9210Sstevel@tonic-gate{ 9220Sstevel@tonic-gate return (*addr); 9230Sstevel@tonic-gate} 9240Sstevel@tonic-gate 9250Sstevel@tonic-gate/*ARGSUSED*/ 9260Sstevel@tonic-gateuint16_t 9270Sstevel@tonic-gatei_ddi_vaddr_get16(ddi_acc_impl_t *hdlp, uint16_t *addr) 9280Sstevel@tonic-gate{ 9290Sstevel@tonic-gate return (*addr); 9300Sstevel@tonic-gate} 9310Sstevel@tonic-gate 9320Sstevel@tonic-gate/*ARGSUSED*/ 9330Sstevel@tonic-gateuint32_t 9340Sstevel@tonic-gatei_ddi_vaddr_get32(ddi_acc_impl_t *hdlp, uint32_t *addr) 9350Sstevel@tonic-gate{ 9360Sstevel@tonic-gate return (*addr); 9370Sstevel@tonic-gate} 9380Sstevel@tonic-gate 9390Sstevel@tonic-gate/*ARGSUSED*/ 9400Sstevel@tonic-gateuint64_t 9410Sstevel@tonic-gatei_ddi_vaddr_get64(ddi_acc_impl_t *hdlp, uint64_t *addr) 9420Sstevel@tonic-gate{ 9430Sstevel@tonic-gate return (*addr); 9440Sstevel@tonic-gate} 9450Sstevel@tonic-gate 9460Sstevel@tonic-gate#else /* lint */ 9470Sstevel@tonic-gate 9480Sstevel@tonic-gate#if defined(__amd64) 9490Sstevel@tonic-gate 9500Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get8) 9510Sstevel@tonic-gate movzbq (%rsi), %rax 9520Sstevel@tonic-gate ret 9530Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get8) 9540Sstevel@tonic-gate 9550Sstevel@tonic-gate#elif defined(__i386) 9560Sstevel@tonic-gate 9570Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get8) 9580Sstevel@tonic-gate movl 8(%esp), %eax 9590Sstevel@tonic-gate movzbl (%eax), %eax 9600Sstevel@tonic-gate ret 9610Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get8) 9620Sstevel@tonic-gate 9630Sstevel@tonic-gate#endif /* __i386 */ 9640Sstevel@tonic-gate 9650Sstevel@tonic-gate#if defined(__amd64) 9660Sstevel@tonic-gate 9670Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get16) 9680Sstevel@tonic-gate movzwq (%rsi), %rax 9690Sstevel@tonic-gate ret 9700Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get16) 9710Sstevel@tonic-gate 9720Sstevel@tonic-gate#elif defined(__i386) 9730Sstevel@tonic-gate 9740Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get16) 9750Sstevel@tonic-gate movl 8(%esp), %eax 9760Sstevel@tonic-gate movzwl (%eax), %eax 9770Sstevel@tonic-gate ret 9780Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get16) 9790Sstevel@tonic-gate 9800Sstevel@tonic-gate#endif /* __i386 */ 9810Sstevel@tonic-gate 9820Sstevel@tonic-gate#if defined(__amd64) 9830Sstevel@tonic-gate 9840Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get32) 9850Sstevel@tonic-gate movl (%rsi), %eax 9860Sstevel@tonic-gate ret 9870Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get32) 9880Sstevel@tonic-gate 9890Sstevel@tonic-gate#elif defined(__i386) 9900Sstevel@tonic-gate 9910Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get32) 9920Sstevel@tonic-gate movl 8(%esp), %eax 9930Sstevel@tonic-gate movl (%eax), %eax 9940Sstevel@tonic-gate ret 9950Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get32) 9960Sstevel@tonic-gate 9970Sstevel@tonic-gate#endif /* __i386 */ 9980Sstevel@tonic-gate 9990Sstevel@tonic-gate#if defined(__amd64) 10000Sstevel@tonic-gate 10010Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get64) 10020Sstevel@tonic-gate movq (%rsi), %rax 10030Sstevel@tonic-gate ret 10040Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get64) 10050Sstevel@tonic-gate 10060Sstevel@tonic-gate#elif defined(__i386) 10070Sstevel@tonic-gate 10080Sstevel@tonic-gate ENTRY(i_ddi_vaddr_get64) 10090Sstevel@tonic-gate movl 8(%esp), %ecx 10100Sstevel@tonic-gate movl (%ecx), %eax 10110Sstevel@tonic-gate movl 4(%ecx), %edx 10120Sstevel@tonic-gate ret 10130Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_get64) 10140Sstevel@tonic-gate 10150Sstevel@tonic-gate#endif /* __i386 */ 10160Sstevel@tonic-gate 10170Sstevel@tonic-gate#endif /* lint */ 10180Sstevel@tonic-gate 10190Sstevel@tonic-gate 10200Sstevel@tonic-gate#if defined(lint) || defined(__lint) 10210Sstevel@tonic-gate 10220Sstevel@tonic-gate/*ARGSUSED*/ 10230Sstevel@tonic-gateuint8_t 10240Sstevel@tonic-gatei_ddi_io_get8(ddi_acc_impl_t *hdlp, uint8_t *addr) 10250Sstevel@tonic-gate{ 10260Sstevel@tonic-gate return (0); 10270Sstevel@tonic-gate} 10280Sstevel@tonic-gate 10290Sstevel@tonic-gate/*ARGSUSED*/ 10300Sstevel@tonic-gateuint16_t 10310Sstevel@tonic-gatei_ddi_io_get16(ddi_acc_impl_t *hdlp, uint16_t *addr) 10320Sstevel@tonic-gate{ 10330Sstevel@tonic-gate return (0); 10340Sstevel@tonic-gate} 10350Sstevel@tonic-gate 10360Sstevel@tonic-gate/*ARGSUSED*/ 10370Sstevel@tonic-gateuint32_t 10380Sstevel@tonic-gatei_ddi_io_get32(ddi_acc_impl_t *hdlp, uint32_t *addr) 10390Sstevel@tonic-gate{ 10400Sstevel@tonic-gate return (0); 10410Sstevel@tonic-gate} 10420Sstevel@tonic-gate 10430Sstevel@tonic-gate#else /* lint */ 10440Sstevel@tonic-gate 10450Sstevel@tonic-gate#if defined(__amd64) 10460Sstevel@tonic-gate 10470Sstevel@tonic-gate ENTRY(i_ddi_io_get8) 10480Sstevel@tonic-gate movq %rsi, %rdx 10490Sstevel@tonic-gate inb (%dx) 10500Sstevel@tonic-gate movzbq %al, %rax 10510Sstevel@tonic-gate ret 10520Sstevel@tonic-gate SET_SIZE(i_ddi_io_get8) 10530Sstevel@tonic-gate 10540Sstevel@tonic-gate#elif defined(__i386) 10550Sstevel@tonic-gate 10560Sstevel@tonic-gate ENTRY(i_ddi_io_get8) 10570Sstevel@tonic-gate movl 8(%esp), %edx 10580Sstevel@tonic-gate inb (%dx) 10590Sstevel@tonic-gate movzbl %al, %eax 10600Sstevel@tonic-gate ret 10610Sstevel@tonic-gate SET_SIZE(i_ddi_io_get8) 10620Sstevel@tonic-gate 10630Sstevel@tonic-gate#endif /* __i386 */ 10640Sstevel@tonic-gate 10650Sstevel@tonic-gate#if defined(__amd64) 10660Sstevel@tonic-gate 10670Sstevel@tonic-gate ENTRY(i_ddi_io_get16) 10680Sstevel@tonic-gate movq %rsi, %rdx 10690Sstevel@tonic-gate inw (%dx) 10700Sstevel@tonic-gate movzwq %ax, %rax 10710Sstevel@tonic-gate ret 10720Sstevel@tonic-gate SET_SIZE(i_ddi_io_get16) 10730Sstevel@tonic-gate 10740Sstevel@tonic-gate#elif defined(__i386) 10750Sstevel@tonic-gate 10760Sstevel@tonic-gate ENTRY(i_ddi_io_get16) 10770Sstevel@tonic-gate movl 8(%esp), %edx 10780Sstevel@tonic-gate inw (%dx) 10790Sstevel@tonic-gate movzwl %ax, %eax 10800Sstevel@tonic-gate ret 10810Sstevel@tonic-gate SET_SIZE(i_ddi_io_get16) 10820Sstevel@tonic-gate 10830Sstevel@tonic-gate#endif /* __i386 */ 10840Sstevel@tonic-gate 10850Sstevel@tonic-gate#if defined(__amd64) 10860Sstevel@tonic-gate 10870Sstevel@tonic-gate ENTRY(i_ddi_io_get32) 10880Sstevel@tonic-gate movq %rsi, %rdx 10890Sstevel@tonic-gate inl (%dx) 10900Sstevel@tonic-gate ret 10910Sstevel@tonic-gate SET_SIZE(i_ddi_io_get32) 10920Sstevel@tonic-gate 10930Sstevel@tonic-gate#elif defined(__i386) 10940Sstevel@tonic-gate 10950Sstevel@tonic-gate ENTRY(i_ddi_io_get32) 10960Sstevel@tonic-gate movl 8(%esp), %edx 10970Sstevel@tonic-gate inl (%dx) 10980Sstevel@tonic-gate ret 10990Sstevel@tonic-gate SET_SIZE(i_ddi_io_get32) 11000Sstevel@tonic-gate 11010Sstevel@tonic-gate#endif /* __i386 */ 11020Sstevel@tonic-gate 11030Sstevel@tonic-gate#endif /* lint */ 11040Sstevel@tonic-gate 11050Sstevel@tonic-gate#if defined(lint) || defined(__lint) 11060Sstevel@tonic-gate 11070Sstevel@tonic-gate/*ARGSUSED*/ 11080Sstevel@tonic-gatevoid 11090Sstevel@tonic-gatei_ddi_vaddr_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value) 11100Sstevel@tonic-gate{ 11110Sstevel@tonic-gate *addr = value; 11120Sstevel@tonic-gate} 11130Sstevel@tonic-gate 11140Sstevel@tonic-gate/*ARGSUSED*/ 11150Sstevel@tonic-gatevoid 11160Sstevel@tonic-gatei_ddi_vaddr_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value) 11170Sstevel@tonic-gate{ 11180Sstevel@tonic-gate *addr = value; 11190Sstevel@tonic-gate} 11200Sstevel@tonic-gate 11210Sstevel@tonic-gate/*ARGSUSED*/ 11220Sstevel@tonic-gatevoid 11230Sstevel@tonic-gatei_ddi_vaddr_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value) 11240Sstevel@tonic-gate{ 11250Sstevel@tonic-gate *(uint32_t *)addr = value; 11260Sstevel@tonic-gate} 11270Sstevel@tonic-gate 11280Sstevel@tonic-gate/*ARGSUSED*/ 11290Sstevel@tonic-gatevoid 11300Sstevel@tonic-gatei_ddi_vaddr_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value) 11310Sstevel@tonic-gate{ 11320Sstevel@tonic-gate *addr = value; 11330Sstevel@tonic-gate} 11340Sstevel@tonic-gate 11350Sstevel@tonic-gate#else /* lint */ 11360Sstevel@tonic-gate 11370Sstevel@tonic-gate#if defined(__amd64) 11380Sstevel@tonic-gate 11390Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put8) 11400Sstevel@tonic-gate movb %dl, (%rsi) 11410Sstevel@tonic-gate ret 11420Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put8) 11430Sstevel@tonic-gate 11440Sstevel@tonic-gate#elif defined(__i386) 11450Sstevel@tonic-gate 11460Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put8) 11470Sstevel@tonic-gate movl 8(%esp), %eax 11480Sstevel@tonic-gate movb 12(%esp), %cl 11490Sstevel@tonic-gate movb %cl, (%eax) 11500Sstevel@tonic-gate ret 11510Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put8) 11520Sstevel@tonic-gate 11530Sstevel@tonic-gate#endif /* __i386 */ 11540Sstevel@tonic-gate 11550Sstevel@tonic-gate#if defined(__amd64) 11560Sstevel@tonic-gate 11570Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put16) 11580Sstevel@tonic-gate movw %dx, (%rsi) 11590Sstevel@tonic-gate ret 11600Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put16) 11610Sstevel@tonic-gate 11620Sstevel@tonic-gate#elif defined(__i386) 11630Sstevel@tonic-gate 11640Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put16) 11650Sstevel@tonic-gate movl 8(%esp), %eax 11660Sstevel@tonic-gate movl 12(%esp), %ecx 11670Sstevel@tonic-gate movw %cx, (%eax) 11680Sstevel@tonic-gate ret 11690Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put16) 11700Sstevel@tonic-gate 11710Sstevel@tonic-gate#endif /* __i386 */ 11720Sstevel@tonic-gate 11730Sstevel@tonic-gate#if defined(__amd64) 11740Sstevel@tonic-gate 11750Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put32) 11760Sstevel@tonic-gate movl %edx, (%rsi) 11770Sstevel@tonic-gate ret 11780Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put32) 11790Sstevel@tonic-gate 11800Sstevel@tonic-gate#elif defined(__i386) 11810Sstevel@tonic-gate 11820Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put32) 11830Sstevel@tonic-gate movl 8(%esp), %eax 11840Sstevel@tonic-gate movl 12(%esp), %ecx 11850Sstevel@tonic-gate movl %ecx, (%eax) 11860Sstevel@tonic-gate ret 11870Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put32) 11880Sstevel@tonic-gate 11890Sstevel@tonic-gate#endif /* __i386 */ 11900Sstevel@tonic-gate 11910Sstevel@tonic-gate#if defined(__amd64) 11920Sstevel@tonic-gate 11930Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put64) 11940Sstevel@tonic-gate movq %rdx, (%rsi) 11950Sstevel@tonic-gate ret 11960Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put64) 11970Sstevel@tonic-gate 11980Sstevel@tonic-gate#elif defined(__i386) 11990Sstevel@tonic-gate 12000Sstevel@tonic-gate ENTRY(i_ddi_vaddr_put64) 12010Sstevel@tonic-gate movl 8(%esp), %ecx 12020Sstevel@tonic-gate movl 12(%esp), %edx 12030Sstevel@tonic-gate movl 16(%esp), %eax 12040Sstevel@tonic-gate movl %edx, (%ecx) 12050Sstevel@tonic-gate movl %eax, 4(%ecx) 12060Sstevel@tonic-gate ret 12070Sstevel@tonic-gate SET_SIZE(i_ddi_vaddr_put64) 12080Sstevel@tonic-gate 12090Sstevel@tonic-gate#endif /* __i386 */ 12100Sstevel@tonic-gate 12110Sstevel@tonic-gate#endif /* lint */ 12120Sstevel@tonic-gate 12130Sstevel@tonic-gate#if defined(lint) || defined(__lint) 12140Sstevel@tonic-gate 12150Sstevel@tonic-gate/*ARGSUSED*/ 12160Sstevel@tonic-gatevoid 12170Sstevel@tonic-gatei_ddi_io_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value) 12180Sstevel@tonic-gate{} 12190Sstevel@tonic-gate 12200Sstevel@tonic-gate/*ARGSUSED*/ 12210Sstevel@tonic-gatevoid 12220Sstevel@tonic-gatei_ddi_io_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value) 12230Sstevel@tonic-gate{} 12240Sstevel@tonic-gate 12250Sstevel@tonic-gate/*ARGSUSED*/ 12260Sstevel@tonic-gatevoid 12270Sstevel@tonic-gatei_ddi_io_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value) 12280Sstevel@tonic-gate{} 12290Sstevel@tonic-gate 12300Sstevel@tonic-gate#else /* lint */ 12310Sstevel@tonic-gate 12320Sstevel@tonic-gate#if defined(__amd64) 12330Sstevel@tonic-gate 12340Sstevel@tonic-gate ENTRY(i_ddi_io_put8) 12350Sstevel@tonic-gate movq %rdx, %rax 12360Sstevel@tonic-gate movq %rsi, %rdx 12370Sstevel@tonic-gate outb (%dx) 12380Sstevel@tonic-gate ret 12390Sstevel@tonic-gate SET_SIZE(i_ddi_io_put8) 12400Sstevel@tonic-gate 12410Sstevel@tonic-gate#elif defined(__i386) 12420Sstevel@tonic-gate 12430Sstevel@tonic-gate ENTRY(i_ddi_io_put8) 12440Sstevel@tonic-gate movl 12(%esp), %eax 12450Sstevel@tonic-gate movl 8(%esp), %edx 12460Sstevel@tonic-gate outb (%dx) 12470Sstevel@tonic-gate ret 12480Sstevel@tonic-gate SET_SIZE(i_ddi_io_put8) 12490Sstevel@tonic-gate 12500Sstevel@tonic-gate#endif /* __i386 */ 12510Sstevel@tonic-gate 12520Sstevel@tonic-gate#if defined(__amd64) 12530Sstevel@tonic-gate 12540Sstevel@tonic-gate ENTRY(i_ddi_io_put16) 12550Sstevel@tonic-gate movq %rdx, %rax 12560Sstevel@tonic-gate movq %rsi, %rdx 12570Sstevel@tonic-gate outw (%dx) 12580Sstevel@tonic-gate ret 12590Sstevel@tonic-gate SET_SIZE(i_ddi_io_put16) 12600Sstevel@tonic-gate 12610Sstevel@tonic-gate#elif defined(__i386) 12620Sstevel@tonic-gate 12630Sstevel@tonic-gate ENTRY(i_ddi_io_put16) 12640Sstevel@tonic-gate movl 12(%esp), %eax 12650Sstevel@tonic-gate movl 8(%esp), %edx 12660Sstevel@tonic-gate outw (%dx) 12670Sstevel@tonic-gate ret 12680Sstevel@tonic-gate SET_SIZE(i_ddi_io_put16) 12690Sstevel@tonic-gate 12700Sstevel@tonic-gate#endif /* __i386 */ 12710Sstevel@tonic-gate 12720Sstevel@tonic-gate#if defined(__amd64) 12730Sstevel@tonic-gate 12740Sstevel@tonic-gate ENTRY(i_ddi_io_put32) 12750Sstevel@tonic-gate movq %rdx, %rax 12760Sstevel@tonic-gate movq %rsi, %rdx 12770Sstevel@tonic-gate outl (%dx) 12780Sstevel@tonic-gate ret 12790Sstevel@tonic-gate SET_SIZE(i_ddi_io_put32) 12800Sstevel@tonic-gate 12810Sstevel@tonic-gate#elif defined(__i386) 12820Sstevel@tonic-gate 12830Sstevel@tonic-gate ENTRY(i_ddi_io_put32) 12840Sstevel@tonic-gate movl 12(%esp), %eax 12850Sstevel@tonic-gate movl 8(%esp), %edx 12860Sstevel@tonic-gate outl (%dx) 12870Sstevel@tonic-gate ret 12880Sstevel@tonic-gate SET_SIZE(i_ddi_io_put32) 12890Sstevel@tonic-gate 12900Sstevel@tonic-gate#endif /* __i386 */ 12910Sstevel@tonic-gate 12920Sstevel@tonic-gate#endif /* lint */ 12930Sstevel@tonic-gate 12940Sstevel@tonic-gate#if defined(lint) || defined(__lint) 12950Sstevel@tonic-gate 12960Sstevel@tonic-gate/*ARGSUSED*/ 12970Sstevel@tonic-gatevoid 12980Sstevel@tonic-gatei_ddi_io_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, 12990Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags) 13000Sstevel@tonic-gate{} 13010Sstevel@tonic-gate 13020Sstevel@tonic-gate/*ARGSUSED*/ 13030Sstevel@tonic-gatevoid 13040Sstevel@tonic-gatei_ddi_io_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 13050Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags) 13060Sstevel@tonic-gate{} 13070Sstevel@tonic-gate 13080Sstevel@tonic-gate/*ARGSUSED*/ 13090Sstevel@tonic-gatevoid 13100Sstevel@tonic-gatei_ddi_io_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 13110Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags) 13120Sstevel@tonic-gate{} 13130Sstevel@tonic-gate 13140Sstevel@tonic-gate#else /* lint */ 13150Sstevel@tonic-gate 13160Sstevel@tonic-gate#if defined(__amd64) 13170Sstevel@tonic-gate 13180Sstevel@tonic-gate /* 13190Sstevel@tonic-gate * Incoming arguments 13200Sstevel@tonic-gate * 13210Sstevel@tonic-gate * %rdi : hdlp 13220Sstevel@tonic-gate * %rsi : host_addr 13230Sstevel@tonic-gate * %rdx : dev_addr 13240Sstevel@tonic-gate * %rcx : repcount 13250Sstevel@tonic-gate * %r8 : flags 13260Sstevel@tonic-gate * 13270Sstevel@tonic-gate * This routine will destroy values in %rdx, %rsi, %rcx. 13280Sstevel@tonic-gate */ 13290Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get8) 13300Sstevel@tonic-gate 13310Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 13320Sstevel@tonic-gate je gb_ioadv 13330Sstevel@tonic-gate movq %rsi, %rdi 13340Sstevel@tonic-gate rep 13350Sstevel@tonic-gate insb 13360Sstevel@tonic-gate ret 13370Sstevel@tonic-gate 13380Sstevel@tonic-gategb_ioadv: 13390Sstevel@tonic-gate andq %rcx, %rcx 13400Sstevel@tonic-gate jz gb_ioadv_done 13410Sstevel@tonic-gategb_ioadv2: 13420Sstevel@tonic-gate inb (%dx) 13430Sstevel@tonic-gate movb %al, (%rsi) 13440Sstevel@tonic-gate incq %rdx 13450Sstevel@tonic-gate incq %rsi 13460Sstevel@tonic-gate decq %rcx 13470Sstevel@tonic-gate jg gb_ioadv2 13480Sstevel@tonic-gate 13490Sstevel@tonic-gategb_ioadv_done: 1350545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1351545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 13520Sstevel@tonic-gate 13530Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get8) 13540Sstevel@tonic-gate 13550Sstevel@tonic-gate#elif defined(__i386) 13560Sstevel@tonic-gate 13570Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get8) 13580Sstevel@tonic-gate pushl %edi 13590Sstevel@tonic-gate 13600Sstevel@tonic-gate movl 12(%esp),%edi / get host_addr 13610Sstevel@tonic-gate movl 16(%esp),%edx / get port 13620Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 13630Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 13640Sstevel@tonic-gate je gb_ioadv 13650Sstevel@tonic-gate 13660Sstevel@tonic-gate rep 13670Sstevel@tonic-gate insb 13680Sstevel@tonic-gate popl %edi 13690Sstevel@tonic-gate ret 13700Sstevel@tonic-gate 13710Sstevel@tonic-gategb_ioadv: 13720Sstevel@tonic-gate andl %ecx, %ecx 13730Sstevel@tonic-gate jz gb_ioadv_done 13740Sstevel@tonic-gategb_ioadv2: 13750Sstevel@tonic-gate inb (%dx) 13760Sstevel@tonic-gate movb %al,(%edi) 13770Sstevel@tonic-gate incl %edi 13780Sstevel@tonic-gate incl %edx 13790Sstevel@tonic-gate decl %ecx 13800Sstevel@tonic-gate jg gb_ioadv2 13810Sstevel@tonic-gate 13820Sstevel@tonic-gategb_ioadv_done: 13830Sstevel@tonic-gate popl %edi 13840Sstevel@tonic-gate ret 13850Sstevel@tonic-gate 13860Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get8) 13870Sstevel@tonic-gate 13880Sstevel@tonic-gate#endif /* __i386 */ 13890Sstevel@tonic-gate 13900Sstevel@tonic-gate#if defined(__amd64) 13910Sstevel@tonic-gate 13920Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get16) 13930Sstevel@tonic-gate 13940Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 13950Sstevel@tonic-gate je gw_ioadv 13960Sstevel@tonic-gate 13970Sstevel@tonic-gate movq %rsi, %rdi 13980Sstevel@tonic-gate rep 13990Sstevel@tonic-gate insw 14000Sstevel@tonic-gate ret 14010Sstevel@tonic-gate 14020Sstevel@tonic-gategw_ioadv: 14030Sstevel@tonic-gate andq %rcx, %rcx 14040Sstevel@tonic-gate jz gw_ioadv_done 14050Sstevel@tonic-gategw_ioadv2: 14060Sstevel@tonic-gate inw (%dx) 14070Sstevel@tonic-gate movw %ax,(%rsi) 14080Sstevel@tonic-gate addq $2, %rsi 14090Sstevel@tonic-gate addq $2, %rdx 14100Sstevel@tonic-gate decq %rcx 14110Sstevel@tonic-gate jg gw_ioadv2 14120Sstevel@tonic-gate 14130Sstevel@tonic-gategw_ioadv_done: 1414545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1415545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 14160Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get16) 14170Sstevel@tonic-gate 14180Sstevel@tonic-gate#elif defined(__i386) 14190Sstevel@tonic-gate 14200Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get16) 14210Sstevel@tonic-gate pushl %edi 14220Sstevel@tonic-gate 14230Sstevel@tonic-gate movl 12(%esp),%edi / get host_addr 14240Sstevel@tonic-gate movl 16(%esp),%edx / get port 14250Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 14260Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 14270Sstevel@tonic-gate je gw_ioadv 14280Sstevel@tonic-gate 14290Sstevel@tonic-gate rep 14300Sstevel@tonic-gate insw 14310Sstevel@tonic-gate popl %edi 14320Sstevel@tonic-gate ret 14330Sstevel@tonic-gate 14340Sstevel@tonic-gategw_ioadv: 14350Sstevel@tonic-gate andl %ecx, %ecx 14360Sstevel@tonic-gate jz gw_ioadv_done 14370Sstevel@tonic-gategw_ioadv2: 14380Sstevel@tonic-gate inw (%dx) 14390Sstevel@tonic-gate movw %ax,(%edi) 14400Sstevel@tonic-gate addl $2, %edi 14410Sstevel@tonic-gate addl $2, %edx 14420Sstevel@tonic-gate decl %ecx 14430Sstevel@tonic-gate jg gw_ioadv2 14440Sstevel@tonic-gate 14450Sstevel@tonic-gategw_ioadv_done: 14460Sstevel@tonic-gate popl %edi 14470Sstevel@tonic-gate ret 14480Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get16) 14490Sstevel@tonic-gate 14500Sstevel@tonic-gate#endif /* __i386 */ 14510Sstevel@tonic-gate 14520Sstevel@tonic-gate#if defined(__amd64) 14530Sstevel@tonic-gate 14540Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get32) 14550Sstevel@tonic-gate 14560Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 14570Sstevel@tonic-gate je gl_ioadv 14580Sstevel@tonic-gate 14590Sstevel@tonic-gate movq %rsi, %rdi 14600Sstevel@tonic-gate rep 14610Sstevel@tonic-gate insl 14620Sstevel@tonic-gate ret 14630Sstevel@tonic-gate 14640Sstevel@tonic-gategl_ioadv: 14650Sstevel@tonic-gate andq %rcx, %rcx 14660Sstevel@tonic-gate jz gl_ioadv_done 14670Sstevel@tonic-gategl_ioadv2: 14680Sstevel@tonic-gate inl (%dx) 14690Sstevel@tonic-gate movl %eax,(%rsi) 14700Sstevel@tonic-gate addq $4, %rsi 14710Sstevel@tonic-gate addq $4, %rdx 14720Sstevel@tonic-gate decq %rcx 14730Sstevel@tonic-gate jg gl_ioadv2 14740Sstevel@tonic-gate 14750Sstevel@tonic-gategl_ioadv_done: 1476545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1477545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 14780Sstevel@tonic-gate 14790Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get32) 14800Sstevel@tonic-gate 14810Sstevel@tonic-gate 14820Sstevel@tonic-gate#elif defined(__i386) 14830Sstevel@tonic-gate 14840Sstevel@tonic-gate ENTRY(i_ddi_io_rep_get32) 14850Sstevel@tonic-gate pushl %edi 14860Sstevel@tonic-gate 14870Sstevel@tonic-gate movl 12(%esp),%edi / get host_addr 14880Sstevel@tonic-gate movl 16(%esp),%edx / get port 14890Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 14900Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 14910Sstevel@tonic-gate je gl_ioadv 14920Sstevel@tonic-gate 14930Sstevel@tonic-gate rep 14940Sstevel@tonic-gate insl 14950Sstevel@tonic-gate popl %edi 14960Sstevel@tonic-gate ret 14970Sstevel@tonic-gate 14980Sstevel@tonic-gategl_ioadv: 14990Sstevel@tonic-gate andl %ecx, %ecx 15000Sstevel@tonic-gate jz gl_ioadv_done 15010Sstevel@tonic-gategl_ioadv2: 15020Sstevel@tonic-gate inl (%dx) 15030Sstevel@tonic-gate movl %eax,(%edi) 15040Sstevel@tonic-gate addl $4, %edi 15050Sstevel@tonic-gate addl $4, %edx 15060Sstevel@tonic-gate decl %ecx 15070Sstevel@tonic-gate jg gl_ioadv2 15080Sstevel@tonic-gate 15090Sstevel@tonic-gategl_ioadv_done: 15100Sstevel@tonic-gate popl %edi 15110Sstevel@tonic-gate ret 15120Sstevel@tonic-gate 15130Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_get32) 15140Sstevel@tonic-gate 15150Sstevel@tonic-gate#endif /* __i386 */ 15160Sstevel@tonic-gate 15170Sstevel@tonic-gate#endif /* lint */ 15180Sstevel@tonic-gate 15190Sstevel@tonic-gate#if defined(lint) || defined(__lint) 15200Sstevel@tonic-gate 15210Sstevel@tonic-gate/*ARGSUSED*/ 15220Sstevel@tonic-gatevoid 15230Sstevel@tonic-gatei_ddi_io_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, 15240Sstevel@tonic-gate uint8_t *dev_addr, size_t repcount, uint_t flags) 15250Sstevel@tonic-gate{} 15260Sstevel@tonic-gate 15270Sstevel@tonic-gate/*ARGSUSED*/ 15280Sstevel@tonic-gatevoid 15290Sstevel@tonic-gatei_ddi_io_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr, 15300Sstevel@tonic-gate uint16_t *dev_addr, size_t repcount, uint_t flags) 15310Sstevel@tonic-gate{} 15320Sstevel@tonic-gate 15330Sstevel@tonic-gate/*ARGSUSED*/ 15340Sstevel@tonic-gatevoid 15350Sstevel@tonic-gatei_ddi_io_rep_put32(ddi_acc_impl_t *hdlp, uint32_t *host_addr, 15360Sstevel@tonic-gate uint32_t *dev_addr, size_t repcount, uint_t flags) 15370Sstevel@tonic-gate{} 15380Sstevel@tonic-gate 15390Sstevel@tonic-gate#else /* lint */ 15400Sstevel@tonic-gate 15410Sstevel@tonic-gate#if defined(__amd64) 15420Sstevel@tonic-gate 15430Sstevel@tonic-gate /* 15440Sstevel@tonic-gate * Incoming arguments 15450Sstevel@tonic-gate * 15460Sstevel@tonic-gate * %rdi : hdlp 15470Sstevel@tonic-gate * %rsi : host_addr 15480Sstevel@tonic-gate * %rdx : dev_addr 15490Sstevel@tonic-gate * %rcx : repcount 15500Sstevel@tonic-gate * %r8 : flags 15510Sstevel@tonic-gate * 15520Sstevel@tonic-gate * This routine will destroy values in %rdx, %rsi, %rcx. 15530Sstevel@tonic-gate */ 15540Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put8) 15550Sstevel@tonic-gate 15560Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 15570Sstevel@tonic-gate je pb_ioadv 15580Sstevel@tonic-gate 15590Sstevel@tonic-gate movq %rsi, %rdi 15600Sstevel@tonic-gate rep 15610Sstevel@tonic-gate outsb 15620Sstevel@tonic-gate ret 15630Sstevel@tonic-gate 15640Sstevel@tonic-gatepb_ioadv: 15650Sstevel@tonic-gate andq %rcx, %rcx 15660Sstevel@tonic-gate jz pb_ioadv_done 15670Sstevel@tonic-gatepb_ioadv2: 15680Sstevel@tonic-gate movb (%rsi), %al 15690Sstevel@tonic-gate outb (%dx) 15700Sstevel@tonic-gate incq %rsi 15710Sstevel@tonic-gate incq %rdx 15720Sstevel@tonic-gate decq %rcx 15730Sstevel@tonic-gate jg pb_ioadv2 15740Sstevel@tonic-gate 15750Sstevel@tonic-gatepb_ioadv_done: 1576545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1577545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 15780Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put8) 15790Sstevel@tonic-gate 15800Sstevel@tonic-gate#elif defined(__i386) 15810Sstevel@tonic-gate 15820Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put8) 15830Sstevel@tonic-gate pushl %esi 15840Sstevel@tonic-gate 15850Sstevel@tonic-gate movl 12(%esp),%esi / get host_addr 15860Sstevel@tonic-gate movl 16(%esp),%edx / get port 15870Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 15880Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 15890Sstevel@tonic-gate je pb_ioadv 15900Sstevel@tonic-gate 15910Sstevel@tonic-gate rep 15920Sstevel@tonic-gate outsb 15930Sstevel@tonic-gate popl %esi 15940Sstevel@tonic-gate ret 15950Sstevel@tonic-gate 15960Sstevel@tonic-gatepb_ioadv: 15970Sstevel@tonic-gate andl %ecx, %ecx 15980Sstevel@tonic-gate jz pb_ioadv_done 15990Sstevel@tonic-gatepb_ioadv2: 16000Sstevel@tonic-gate movb (%esi), %al 16010Sstevel@tonic-gate outb (%dx) 16020Sstevel@tonic-gate incl %esi 16030Sstevel@tonic-gate incl %edx 16040Sstevel@tonic-gate decl %ecx 16050Sstevel@tonic-gate jg pb_ioadv2 16060Sstevel@tonic-gate 16070Sstevel@tonic-gatepb_ioadv_done: 16080Sstevel@tonic-gate popl %esi 16090Sstevel@tonic-gate ret 16100Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put8) 16110Sstevel@tonic-gate 16120Sstevel@tonic-gate#endif /* __i386 */ 16130Sstevel@tonic-gate 16140Sstevel@tonic-gate#if defined(__amd64) 16150Sstevel@tonic-gate 16160Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put16) 16170Sstevel@tonic-gate 16180Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 16190Sstevel@tonic-gate je pw_ioadv 16200Sstevel@tonic-gate 16210Sstevel@tonic-gate movq %rsi, %rdi 16220Sstevel@tonic-gate rep 16230Sstevel@tonic-gate outsw 16240Sstevel@tonic-gate ret 16250Sstevel@tonic-gate 16260Sstevel@tonic-gatepw_ioadv: 16270Sstevel@tonic-gate andq %rcx, %rcx 16280Sstevel@tonic-gate jz pw_ioadv_done 16290Sstevel@tonic-gatepw_ioadv2: 16300Sstevel@tonic-gate movw (%rsi), %ax 16310Sstevel@tonic-gate outw (%dx) 16320Sstevel@tonic-gate addq $2, %rsi 16330Sstevel@tonic-gate addq $2, %rdx 16340Sstevel@tonic-gate decq %rcx 16350Sstevel@tonic-gate jg pw_ioadv2 16360Sstevel@tonic-gate 16370Sstevel@tonic-gatepw_ioadv_done: 1638545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1639545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 16400Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put16) 16410Sstevel@tonic-gate 16420Sstevel@tonic-gate#elif defined(__i386) 16430Sstevel@tonic-gate 16440Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put16) 16450Sstevel@tonic-gate pushl %esi 16460Sstevel@tonic-gate 16470Sstevel@tonic-gate movl 12(%esp),%esi / get host_addr 16480Sstevel@tonic-gate movl 16(%esp),%edx / get port 16490Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 16500Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 16510Sstevel@tonic-gate je pw_ioadv 16520Sstevel@tonic-gate 16530Sstevel@tonic-gate rep 16540Sstevel@tonic-gate outsw 16550Sstevel@tonic-gate popl %esi 16560Sstevel@tonic-gate ret 16570Sstevel@tonic-gate 16580Sstevel@tonic-gatepw_ioadv: 16590Sstevel@tonic-gate andl %ecx, %ecx 16600Sstevel@tonic-gate jz pw_ioadv_done 16610Sstevel@tonic-gatepw_ioadv2: 16620Sstevel@tonic-gate movw (%esi), %ax 16630Sstevel@tonic-gate outw (%dx) 16640Sstevel@tonic-gate addl $2, %esi 16650Sstevel@tonic-gate addl $2, %edx 16660Sstevel@tonic-gate decl %ecx 16670Sstevel@tonic-gate jg pw_ioadv2 16680Sstevel@tonic-gate 16690Sstevel@tonic-gatepw_ioadv_done: 16700Sstevel@tonic-gate popl %esi 16710Sstevel@tonic-gate ret 16720Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put16) 16730Sstevel@tonic-gate 16740Sstevel@tonic-gate#endif /* __i386 */ 16750Sstevel@tonic-gate 16760Sstevel@tonic-gate#if defined(__amd64) 16770Sstevel@tonic-gate 16780Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put32) 16790Sstevel@tonic-gate 16800Sstevel@tonic-gate cmpq $DDI_DEV_AUTOINCR, %r8 16810Sstevel@tonic-gate je pl_ioadv 16820Sstevel@tonic-gate 16830Sstevel@tonic-gate movq %rsi, %rdi 16840Sstevel@tonic-gate rep 16850Sstevel@tonic-gate outsl 16860Sstevel@tonic-gate ret 16870Sstevel@tonic-gate 16880Sstevel@tonic-gatepl_ioadv: 16890Sstevel@tonic-gate andq %rcx, %rcx 16900Sstevel@tonic-gate jz pl_ioadv_done 16910Sstevel@tonic-gatepl_ioadv2: 16920Sstevel@tonic-gate movl (%rsi), %eax 16930Sstevel@tonic-gate outl (%dx) 16940Sstevel@tonic-gate addq $4, %rsi 16950Sstevel@tonic-gate addq $4, %rdx 16960Sstevel@tonic-gate decq %rcx 16970Sstevel@tonic-gate jg pl_ioadv2 16980Sstevel@tonic-gate 16990Sstevel@tonic-gatepl_ioadv_done: 1700545Skalai rep; ret /* use 2 byte return instruction when branch target */ 1701545Skalai /* AMD Software Optimization Guide - Section 6.2 */ 17020Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put32) 17030Sstevel@tonic-gate 17040Sstevel@tonic-gate#elif defined(__i386) 17050Sstevel@tonic-gate 17060Sstevel@tonic-gate ENTRY(i_ddi_io_rep_put32) 17070Sstevel@tonic-gate pushl %esi 17080Sstevel@tonic-gate 17090Sstevel@tonic-gate movl 12(%esp),%esi / get host_addr 17100Sstevel@tonic-gate movl 16(%esp),%edx / get port 17110Sstevel@tonic-gate movl 20(%esp),%ecx / get repcount 17120Sstevel@tonic-gate cmpl $DDI_DEV_AUTOINCR, 24(%esp) 17130Sstevel@tonic-gate je pl_ioadv 17140Sstevel@tonic-gate 17150Sstevel@tonic-gate rep 17160Sstevel@tonic-gate outsl 17170Sstevel@tonic-gate popl %esi 17180Sstevel@tonic-gate ret 17190Sstevel@tonic-gate 17200Sstevel@tonic-gatepl_ioadv: 17210Sstevel@tonic-gate andl %ecx, %ecx 17220Sstevel@tonic-gate jz pl_ioadv_done 17230Sstevel@tonic-gatepl_ioadv2: 17240Sstevel@tonic-gate movl (%esi), %eax 17250Sstevel@tonic-gate outl (%dx) 17260Sstevel@tonic-gate addl $4, %esi 17270Sstevel@tonic-gate addl $4, %edx 17280Sstevel@tonic-gate decl %ecx 17290Sstevel@tonic-gate jg pl_ioadv2 17300Sstevel@tonic-gate 17310Sstevel@tonic-gatepl_ioadv_done: 17320Sstevel@tonic-gate popl %esi 17330Sstevel@tonic-gate ret 17340Sstevel@tonic-gate SET_SIZE(i_ddi_io_rep_put32) 17350Sstevel@tonic-gate 17360Sstevel@tonic-gate#endif /* __i386 */ 17370Sstevel@tonic-gate 17380Sstevel@tonic-gate#endif /* lint */ 1739