xref: /titanic_51/usr/src/uts/intel/sys/ddi_isa.h (revision a56d24ea912a4459d5c9470f9acbc39a73339568)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
54ab75253Smrj  * Common Development and Distribution License (the "License").
64ab75253Smrj  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*a56d24eaSMark Johnson  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_DDI_ISA_H
277c478bd9Sstevel@tonic-gate #define	_SYS_DDI_ISA_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
307c478bd9Sstevel@tonic-gate #include <sys/dditypes.h>
317c478bd9Sstevel@tonic-gate #include <sys/ndifm.h>
324ab75253Smrj #ifdef	_KERNEL
334ab75253Smrj #include <sys/ddi_obsolete.h>
344ab75253Smrj #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
377c478bd9Sstevel@tonic-gate extern "C" {
387c478bd9Sstevel@tonic-gate #endif
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  * These are the data access functions which the platform
447c478bd9Sstevel@tonic-gate  * can choose to define as functions or macro's.
457c478bd9Sstevel@tonic-gate  */
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate /*
487c478bd9Sstevel@tonic-gate  * DDI interfaces defined as macro's
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate  * DDI interfaces defined as functions
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #ifdef	__STDC__
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * ahi_acc_attr flags
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate #define	DDI_ACCATTR_CONFIG_SPACE	0x1
617c478bd9Sstevel@tonic-gate #define	DDI_ACCATTR_IO_SPACE		0x2
627c478bd9Sstevel@tonic-gate #define	DDI_ACCATTR_CPU_VADDR		0x4
637c478bd9Sstevel@tonic-gate #define	DDI_ACCATTR_DIRECT		0x8
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate typedef struct ddi_acc_impl {
667c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t	ahi_common;
677c478bd9Sstevel@tonic-gate 	uint_t		ahi_acc_attr;
687c478bd9Sstevel@tonic-gate 	ulong_t		ahi_io_port_base;
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate 	uint8_t
717c478bd9Sstevel@tonic-gate 		(*ahi_get8)(struct ddi_acc_impl *handle, uint8_t *addr);
727c478bd9Sstevel@tonic-gate 	uint16_t
737c478bd9Sstevel@tonic-gate 		(*ahi_get16)(struct ddi_acc_impl *handle, uint16_t *addr);
747c478bd9Sstevel@tonic-gate 	uint32_t
757c478bd9Sstevel@tonic-gate 		(*ahi_get32)(struct ddi_acc_impl *handle, uint32_t *addr);
767c478bd9Sstevel@tonic-gate 	uint64_t
777c478bd9Sstevel@tonic-gate 		(*ahi_get64)(struct ddi_acc_impl *handle, uint64_t *addr);
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate 	void	(*ahi_put8)(struct ddi_acc_impl *handle, uint8_t *addr,
807c478bd9Sstevel@tonic-gate 			uint8_t value);
817c478bd9Sstevel@tonic-gate 	void	(*ahi_put16)(struct ddi_acc_impl *handle, uint16_t *addr,
827c478bd9Sstevel@tonic-gate 			uint16_t value);
837c478bd9Sstevel@tonic-gate 	void	(*ahi_put32)(struct ddi_acc_impl *handle, uint32_t *addr,
847c478bd9Sstevel@tonic-gate 			uint32_t value);
857c478bd9Sstevel@tonic-gate 	void	(*ahi_put64)(struct ddi_acc_impl *handle, uint64_t *addr,
867c478bd9Sstevel@tonic-gate 			uint64_t value);
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_get8)(struct ddi_acc_impl *handle,
897c478bd9Sstevel@tonic-gate 			uint8_t *host_addr, uint8_t *dev_addr,
907c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
917c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_get16)(struct ddi_acc_impl *handle,
927c478bd9Sstevel@tonic-gate 			uint16_t *host_addr, uint16_t *dev_addr,
937c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
947c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_get32)(struct ddi_acc_impl *handle,
957c478bd9Sstevel@tonic-gate 			uint32_t *host_addr, uint32_t *dev_addr,
967c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
977c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_get64)(struct ddi_acc_impl *handle,
987c478bd9Sstevel@tonic-gate 			uint64_t *host_addr, uint64_t *dev_addr,
997c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_put8)(struct ddi_acc_impl *handle,
1027c478bd9Sstevel@tonic-gate 			uint8_t *host_addr, uint8_t *dev_addr,
1037c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
1047c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_put16)(struct ddi_acc_impl *handle,
1057c478bd9Sstevel@tonic-gate 			uint16_t *host_addr, uint16_t *dev_addr,
1067c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
1077c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_put32)(struct ddi_acc_impl *handle,
1087c478bd9Sstevel@tonic-gate 			uint32_t *host_addr, uint32_t *dev_addr,
1097c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
1107c478bd9Sstevel@tonic-gate 	void	(*ahi_rep_put64)(struct ddi_acc_impl *handle,
1117c478bd9Sstevel@tonic-gate 			uint64_t *host_addr, uint64_t *dev_addr,
1127c478bd9Sstevel@tonic-gate 			size_t repcount, uint_t flags);
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate 	int	(*ahi_fault_check)(struct ddi_acc_impl *handle);
1157c478bd9Sstevel@tonic-gate 	void	(*ahi_fault_notify)(struct ddi_acc_impl *handle);
1167c478bd9Sstevel@tonic-gate 	uint32_t	ahi_fault;
1177c478bd9Sstevel@tonic-gate 	ndi_err_t *ahi_err;
118837c1ac4SStephen Hanson 	kmutex_t *ahi_peekpoke_mutexp;
119837c1ac4SStephen Hanson 	kmutex_t *ahi_err_mutexp;
120837c1ac4SStephen Hanson 	void (*ahi_scan)(dev_info_t *, ddi_fm_error_t *);
121837c1ac4SStephen Hanson 	dev_info_t *ahi_scan_dip;
1227c478bd9Sstevel@tonic-gate } ddi_acc_impl_t;
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * Input functions to memory mapped IO
1277c478bd9Sstevel@tonic-gate  */
1287c478bd9Sstevel@tonic-gate uint8_t
1297c478bd9Sstevel@tonic-gate i_ddi_vaddr_get8(ddi_acc_impl_t *hdlp, uint8_t *addr);
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate uint16_t
1327c478bd9Sstevel@tonic-gate i_ddi_vaddr_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate uint32_t
1357c478bd9Sstevel@tonic-gate i_ddi_vaddr_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate uint64_t
1387c478bd9Sstevel@tonic-gate i_ddi_vaddr_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate uint16_t
1417c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate uint32_t
1447c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate uint64_t
1477c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate /*
1507c478bd9Sstevel@tonic-gate  * Output functions to memory mapped IO
1517c478bd9Sstevel@tonic-gate  */
1527c478bd9Sstevel@tonic-gate void
1537c478bd9Sstevel@tonic-gate i_ddi_vaddr_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value);
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate void
1567c478bd9Sstevel@tonic-gate i_ddi_vaddr_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate void
1597c478bd9Sstevel@tonic-gate i_ddi_vaddr_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate void
1627c478bd9Sstevel@tonic-gate i_ddi_vaddr_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate void
1657c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate void
1687c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
1697c478bd9Sstevel@tonic-gate 
1707c478bd9Sstevel@tonic-gate void
1717c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /*
1747c478bd9Sstevel@tonic-gate  * Repeated input functions for memory mapped IO
1757c478bd9Sstevel@tonic-gate  */
1767c478bd9Sstevel@tonic-gate void
1777c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
1787c478bd9Sstevel@tonic-gate 	uint8_t *dev_addr, size_t repcount, uint_t flags);
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate void
1817c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
1827c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate void
1857c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
1867c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate void
1897c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
1907c478bd9Sstevel@tonic-gate 	uint64_t *dev_addr, size_t repcount, uint_t flags);
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate void
1937c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
1947c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate void
1977c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
1987c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate void
2017c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
2027c478bd9Sstevel@tonic-gate 	uint64_t *dev_addr, size_t repcount, uint_t flags);
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate /*
2057c478bd9Sstevel@tonic-gate  * Repeated output functions for memory mapped IO
2067c478bd9Sstevel@tonic-gate  */
2077c478bd9Sstevel@tonic-gate void
2087c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
2097c478bd9Sstevel@tonic-gate 	uint8_t *dev_addr, size_t repcount, uint_t flags);
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate void
2127c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
2137c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate void
2167c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
2177c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate void
2207c478bd9Sstevel@tonic-gate i_ddi_vaddr_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
2217c478bd9Sstevel@tonic-gate 	uint64_t *dev_addr, size_t repcount, uint_t flags);
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate void
2247c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
2257c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate void
2287c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
2297c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
2307c478bd9Sstevel@tonic-gate 
2317c478bd9Sstevel@tonic-gate void
2327c478bd9Sstevel@tonic-gate i_ddi_vaddr_swap_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
2337c478bd9Sstevel@tonic-gate 	uint64_t *dev_addr, size_t repcount, uint_t flags);
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /*
2367c478bd9Sstevel@tonic-gate  * Input functions to IO space
2377c478bd9Sstevel@tonic-gate  */
2387c478bd9Sstevel@tonic-gate uint8_t
2397c478bd9Sstevel@tonic-gate i_ddi_io_get8(ddi_acc_impl_t *hdlp, uint8_t *addr);
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate uint16_t
2427c478bd9Sstevel@tonic-gate i_ddi_io_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate uint32_t
2457c478bd9Sstevel@tonic-gate i_ddi_io_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
2467c478bd9Sstevel@tonic-gate 
2477c478bd9Sstevel@tonic-gate uint64_t
2487c478bd9Sstevel@tonic-gate i_ddi_io_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate uint16_t
2517c478bd9Sstevel@tonic-gate i_ddi_io_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate uint32_t
2547c478bd9Sstevel@tonic-gate i_ddi_io_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate /*
2577c478bd9Sstevel@tonic-gate  * Output functions to IO space
2587c478bd9Sstevel@tonic-gate  */
2597c478bd9Sstevel@tonic-gate void
2607c478bd9Sstevel@tonic-gate i_ddi_io_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value);
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate void
2637c478bd9Sstevel@tonic-gate i_ddi_io_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
2647c478bd9Sstevel@tonic-gate 
2657c478bd9Sstevel@tonic-gate void
2667c478bd9Sstevel@tonic-gate i_ddi_io_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
2677c478bd9Sstevel@tonic-gate 
2687c478bd9Sstevel@tonic-gate void
2697c478bd9Sstevel@tonic-gate i_ddi_io_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate void
2727c478bd9Sstevel@tonic-gate i_ddi_io_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate void
2757c478bd9Sstevel@tonic-gate i_ddi_io_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate /*
2787c478bd9Sstevel@tonic-gate  * Repeated input functions for IO space
2797c478bd9Sstevel@tonic-gate  */
2807c478bd9Sstevel@tonic-gate void
2817c478bd9Sstevel@tonic-gate i_ddi_io_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, uint8_t *dev_addr,
2827c478bd9Sstevel@tonic-gate 	size_t repcount, uint_t flags);
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate void
2857c478bd9Sstevel@tonic-gate i_ddi_io_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
2867c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate void
2897c478bd9Sstevel@tonic-gate i_ddi_io_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
2907c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
2917c478bd9Sstevel@tonic-gate 
2927c478bd9Sstevel@tonic-gate void
2937c478bd9Sstevel@tonic-gate i_ddi_io_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
2947c478bd9Sstevel@tonic-gate 	uint64_t *dev_addr, size_t repcount, uint_t flags);
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate void
2977c478bd9Sstevel@tonic-gate i_ddi_io_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
2987c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate void
3017c478bd9Sstevel@tonic-gate i_ddi_io_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
3027c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate /*
3057c478bd9Sstevel@tonic-gate  * Repeated output functions for IO space
3067c478bd9Sstevel@tonic-gate  */
3077c478bd9Sstevel@tonic-gate void
3087c478bd9Sstevel@tonic-gate i_ddi_io_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr, uint8_t *dev_addr,
3097c478bd9Sstevel@tonic-gate 	size_t repcount, uint_t flags);
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate void
3127c478bd9Sstevel@tonic-gate i_ddi_io_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
3137c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate void
3167c478bd9Sstevel@tonic-gate i_ddi_io_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr, uint32_t *dev_addr,
3177c478bd9Sstevel@tonic-gate 	size_t repcount, uint_t flags);
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate void
3207c478bd9Sstevel@tonic-gate i_ddi_io_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr, uint64_t *dev_addr,
3217c478bd9Sstevel@tonic-gate 	size_t repcount, uint_t flags);
3227c478bd9Sstevel@tonic-gate void
3237c478bd9Sstevel@tonic-gate i_ddi_io_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
3247c478bd9Sstevel@tonic-gate 	uint16_t *dev_addr, size_t repcount, uint_t flags);
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate void
3277c478bd9Sstevel@tonic-gate i_ddi_io_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
3287c478bd9Sstevel@tonic-gate 	uint32_t *dev_addr, size_t repcount, uint_t flags);
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate /*
331837c1ac4SStephen Hanson  * repeat for protected mode accesses
332837c1ac4SStephen Hanson  */
333837c1ac4SStephen Hanson 
334837c1ac4SStephen Hanson /*
335837c1ac4SStephen Hanson  * Input functions to memory mapped IO
336837c1ac4SStephen Hanson  */
337837c1ac4SStephen Hanson uint8_t
338837c1ac4SStephen Hanson i_ddi_prot_vaddr_get8(ddi_acc_impl_t *hdlp, uint8_t *addr);
339837c1ac4SStephen Hanson 
340837c1ac4SStephen Hanson uint16_t
341837c1ac4SStephen Hanson i_ddi_prot_vaddr_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
342837c1ac4SStephen Hanson 
343837c1ac4SStephen Hanson uint32_t
344837c1ac4SStephen Hanson i_ddi_prot_vaddr_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
345837c1ac4SStephen Hanson 
346837c1ac4SStephen Hanson uint64_t
347837c1ac4SStephen Hanson i_ddi_prot_vaddr_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
348837c1ac4SStephen Hanson 
349837c1ac4SStephen Hanson uint16_t
350837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
351837c1ac4SStephen Hanson 
352837c1ac4SStephen Hanson uint32_t
353837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
354837c1ac4SStephen Hanson 
355837c1ac4SStephen Hanson uint64_t
356837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
357837c1ac4SStephen Hanson 
358837c1ac4SStephen Hanson /*
359837c1ac4SStephen Hanson  * Output functions to memory mapped IO
360837c1ac4SStephen Hanson  */
361837c1ac4SStephen Hanson void
362837c1ac4SStephen Hanson i_ddi_prot_vaddr_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value);
363837c1ac4SStephen Hanson 
364837c1ac4SStephen Hanson void
365837c1ac4SStephen Hanson i_ddi_prot_vaddr_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
366837c1ac4SStephen Hanson 
367837c1ac4SStephen Hanson void
368837c1ac4SStephen Hanson i_ddi_prot_vaddr_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
369837c1ac4SStephen Hanson 
370837c1ac4SStephen Hanson void
371837c1ac4SStephen Hanson i_ddi_prot_vaddr_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
372837c1ac4SStephen Hanson 
373837c1ac4SStephen Hanson void
374837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr,
375837c1ac4SStephen Hanson 	uint16_t value);
376837c1ac4SStephen Hanson 
377837c1ac4SStephen Hanson void
378837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr,
379837c1ac4SStephen Hanson 	uint32_t value);
380837c1ac4SStephen Hanson 
381837c1ac4SStephen Hanson void
382837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_put64(ddi_acc_impl_t *hdlp, uint64_t *addr,
383837c1ac4SStephen Hanson 	uint64_t value);
384837c1ac4SStephen Hanson 
385837c1ac4SStephen Hanson /*
386837c1ac4SStephen Hanson  * Repeated input functions for memory mapped IO
387837c1ac4SStephen Hanson  */
388837c1ac4SStephen Hanson void
389837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
390837c1ac4SStephen Hanson 	uint8_t *dev_addr, size_t repcount, uint_t flags);
391837c1ac4SStephen Hanson 
392837c1ac4SStephen Hanson void
393837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
394837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
395837c1ac4SStephen Hanson 
396837c1ac4SStephen Hanson void
397837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
398837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
399837c1ac4SStephen Hanson 
400837c1ac4SStephen Hanson void
401837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
402837c1ac4SStephen Hanson 	uint64_t *dev_addr, size_t repcount, uint_t flags);
403837c1ac4SStephen Hanson 
404837c1ac4SStephen Hanson void
405837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
406837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
407837c1ac4SStephen Hanson 
408837c1ac4SStephen Hanson void
409837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
410837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
411837c1ac4SStephen Hanson 
412837c1ac4SStephen Hanson void
413837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
414837c1ac4SStephen Hanson 	uint64_t *dev_addr, size_t repcount, uint_t flags);
415837c1ac4SStephen Hanson 
416837c1ac4SStephen Hanson /*
417837c1ac4SStephen Hanson  * Repeated output functions for memory mapped IO
418837c1ac4SStephen Hanson  */
419837c1ac4SStephen Hanson void
420837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
421837c1ac4SStephen Hanson 	uint8_t *dev_addr, size_t repcount, uint_t flags);
422837c1ac4SStephen Hanson 
423837c1ac4SStephen Hanson void
424837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
425837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
426837c1ac4SStephen Hanson 
427837c1ac4SStephen Hanson void
428837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
429837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
430837c1ac4SStephen Hanson 
431837c1ac4SStephen Hanson void
432837c1ac4SStephen Hanson i_ddi_prot_vaddr_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
433837c1ac4SStephen Hanson 	uint64_t *dev_addr, size_t repcount, uint_t flags);
434837c1ac4SStephen Hanson 
435837c1ac4SStephen Hanson void
436837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
437837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
438837c1ac4SStephen Hanson 
439837c1ac4SStephen Hanson void
440837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
441837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
442837c1ac4SStephen Hanson 
443837c1ac4SStephen Hanson void
444837c1ac4SStephen Hanson i_ddi_prot_vaddr_swap_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
445837c1ac4SStephen Hanson 	uint64_t *dev_addr, size_t repcount, uint_t flags);
446837c1ac4SStephen Hanson 
447837c1ac4SStephen Hanson /*
448837c1ac4SStephen Hanson  * Input functions to IO space
449837c1ac4SStephen Hanson  */
450837c1ac4SStephen Hanson uint8_t
451837c1ac4SStephen Hanson i_ddi_prot_io_get8(ddi_acc_impl_t *hdlp, uint8_t *addr);
452837c1ac4SStephen Hanson 
453837c1ac4SStephen Hanson uint16_t
454837c1ac4SStephen Hanson i_ddi_prot_io_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
455837c1ac4SStephen Hanson 
456837c1ac4SStephen Hanson uint32_t
457837c1ac4SStephen Hanson i_ddi_prot_io_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
458837c1ac4SStephen Hanson 
459837c1ac4SStephen Hanson uint16_t
460837c1ac4SStephen Hanson i_ddi_prot_io_swap_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
461837c1ac4SStephen Hanson 
462837c1ac4SStephen Hanson uint32_t
463837c1ac4SStephen Hanson i_ddi_prot_io_swap_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
464837c1ac4SStephen Hanson 
465837c1ac4SStephen Hanson /*
466837c1ac4SStephen Hanson  * Output functions to IO space
467837c1ac4SStephen Hanson  */
468837c1ac4SStephen Hanson void
469837c1ac4SStephen Hanson i_ddi_prot_io_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value);
470837c1ac4SStephen Hanson 
471837c1ac4SStephen Hanson void
472837c1ac4SStephen Hanson i_ddi_prot_io_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
473837c1ac4SStephen Hanson 
474837c1ac4SStephen Hanson void
475837c1ac4SStephen Hanson i_ddi_prot_io_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
476837c1ac4SStephen Hanson 
477837c1ac4SStephen Hanson void
478837c1ac4SStephen Hanson i_ddi_prot_io_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
479837c1ac4SStephen Hanson 
480837c1ac4SStephen Hanson void
481837c1ac4SStephen Hanson i_ddi_prot_io_swap_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
482837c1ac4SStephen Hanson 
483837c1ac4SStephen Hanson void
484837c1ac4SStephen Hanson i_ddi_prot_io_swap_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
485837c1ac4SStephen Hanson 
486837c1ac4SStephen Hanson /*
487837c1ac4SStephen Hanson  * Repeated input functions for IO space
488837c1ac4SStephen Hanson  */
489837c1ac4SStephen Hanson void
490837c1ac4SStephen Hanson i_ddi_prot_io_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
491837c1ac4SStephen Hanson 	uint8_t *dev_addr, size_t repcount, uint_t flags);
492837c1ac4SStephen Hanson 
493837c1ac4SStephen Hanson void
494837c1ac4SStephen Hanson i_ddi_prot_io_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
495837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
496837c1ac4SStephen Hanson 
497837c1ac4SStephen Hanson void
498837c1ac4SStephen Hanson i_ddi_prot_io_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
499837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
500837c1ac4SStephen Hanson 
501837c1ac4SStephen Hanson void
502837c1ac4SStephen Hanson i_ddi_prot_io_swap_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
503837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
504837c1ac4SStephen Hanson 
505837c1ac4SStephen Hanson void
506837c1ac4SStephen Hanson i_ddi_prot_io_swap_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
507837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
508837c1ac4SStephen Hanson 
509837c1ac4SStephen Hanson /*
510837c1ac4SStephen Hanson  * Repeated output functions for IO space
511837c1ac4SStephen Hanson  */
512837c1ac4SStephen Hanson void
513837c1ac4SStephen Hanson i_ddi_prot_io_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
514837c1ac4SStephen Hanson 	uint8_t *dev_addr, size_t repcount, uint_t flags);
515837c1ac4SStephen Hanson 
516837c1ac4SStephen Hanson void
517837c1ac4SStephen Hanson i_ddi_prot_io_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
518837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
519837c1ac4SStephen Hanson 
520837c1ac4SStephen Hanson void
521837c1ac4SStephen Hanson i_ddi_prot_io_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
522837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
523837c1ac4SStephen Hanson 
524837c1ac4SStephen Hanson void
525837c1ac4SStephen Hanson i_ddi_prot_io_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
526837c1ac4SStephen Hanson 	uint64_t *dev_addr, size_t repcount, uint_t flags);
527837c1ac4SStephen Hanson void
528837c1ac4SStephen Hanson i_ddi_prot_io_swap_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
529837c1ac4SStephen Hanson 	uint16_t *dev_addr, size_t repcount, uint_t flags);
530837c1ac4SStephen Hanson 
531837c1ac4SStephen Hanson void
532837c1ac4SStephen Hanson i_ddi_prot_io_swap_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
533837c1ac4SStephen Hanson 	uint32_t *dev_addr, size_t repcount, uint_t flags);
534837c1ac4SStephen Hanson 
535837c1ac4SStephen Hanson /*
5367c478bd9Sstevel@tonic-gate  * Default fault-checking and notification functions
5377c478bd9Sstevel@tonic-gate  */
5387c478bd9Sstevel@tonic-gate int
5397c478bd9Sstevel@tonic-gate i_ddi_acc_fault_check(ddi_acc_impl_t *hdlp);
5407c478bd9Sstevel@tonic-gate 
5417c478bd9Sstevel@tonic-gate void
5427c478bd9Sstevel@tonic-gate i_ddi_acc_fault_notify(ddi_acc_impl_t *hdlp);
5437c478bd9Sstevel@tonic-gate 
54400d0963fSdilpreet /* DDI Fault Services functions */
54500d0963fSdilpreet void i_ddi_caut_get(size_t size, void *addr, void *val);
54600d0963fSdilpreet 
54700d0963fSdilpreet uint8_t i_ddi_caut_get8(ddi_acc_impl_t *hdlp, uint8_t *addr);
54800d0963fSdilpreet uint16_t i_ddi_caut_get16(ddi_acc_impl_t *hdlp, uint16_t *addr);
54900d0963fSdilpreet uint32_t i_ddi_caut_get32(ddi_acc_impl_t *hdlp, uint32_t *addr);
55000d0963fSdilpreet uint64_t i_ddi_caut_get64(ddi_acc_impl_t *hdlp, uint64_t *addr);
55100d0963fSdilpreet 
55200d0963fSdilpreet void i_ddi_caut_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value);
55300d0963fSdilpreet void i_ddi_caut_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value);
55400d0963fSdilpreet void i_ddi_caut_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value);
55500d0963fSdilpreet void i_ddi_caut_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value);
55600d0963fSdilpreet 
55700d0963fSdilpreet void i_ddi_caut_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
55800d0963fSdilpreet     uint8_t *dev_addr, size_t repcount, uint_t flags);
55900d0963fSdilpreet void i_ddi_caut_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
56000d0963fSdilpreet     uint16_t *dev_addr, size_t repcount, uint_t flags);
56100d0963fSdilpreet void i_ddi_caut_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
56200d0963fSdilpreet     uint32_t *dev_addr, size_t repcount, uint_t flags);
56300d0963fSdilpreet void i_ddi_caut_rep_get64(ddi_acc_impl_t *hdlp, uint64_t *host_addr,
56400d0963fSdilpreet     uint64_t *dev_addr, size_t repcount, uint_t flags);
56500d0963fSdilpreet 
56600d0963fSdilpreet void i_ddi_caut_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
56700d0963fSdilpreet     uint8_t *dev_addr, size_t repcount, uint_t flags);
56800d0963fSdilpreet void i_ddi_caut_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
56900d0963fSdilpreet     uint16_t *dev_addr, size_t repcount, uint_t flags);
57000d0963fSdilpreet void i_ddi_caut_rep_put32(ddi_acc_impl_t *hdl, uint32_t *host_addr,
57100d0963fSdilpreet     uint32_t *dev_addr, size_t repcount, uint_t flags);
57200d0963fSdilpreet void i_ddi_caut_rep_put64(ddi_acc_impl_t *hdl, uint64_t *host_addr,
57300d0963fSdilpreet     uint64_t *dev_addr, size_t repcount, uint_t flags);
57400d0963fSdilpreet 
57536945f79Smrj boolean_t i_ddi_copybuf_required(ddi_dma_attr_t *attrp);
57636945f79Smrj size_t i_ddi_copybuf_size();
57736945f79Smrj uint32_t i_ddi_dma_max(dev_info_t *dip, ddi_dma_attr_t *attrp);
57836945f79Smrj 
579*a56d24eaSMark Johnson /* handles case of running on top of hypervisor */
580*a56d24eaSMark Johnson pfn_t i_ddi_paddr_to_pfn(paddr_t paddr);
581*a56d24eaSMark Johnson 
5827c478bd9Sstevel@tonic-gate #endif	/* __STDC__ */
5837c478bd9Sstevel@tonic-gate 
5847c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
5857c478bd9Sstevel@tonic-gate 
5867c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
5877c478bd9Sstevel@tonic-gate }
5887c478bd9Sstevel@tonic-gate #endif
5897c478bd9Sstevel@tonic-gate 
5907c478bd9Sstevel@tonic-gate #endif	/* _SYS_DDI_ISA_H */
591