xref: /titanic_51/usr/src/uts/common/sys/ddi_obsolete.h (revision b89e420ae1290e425c29db875ec0c0546006eec7)
14ab75253Smrj /*
22ef9abdcSjv227347  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
34ab75253Smrj  * Use is subject to license terms.
44ab75253Smrj  */
5cd21e7c5SGarrett D'Amore /*
6*b89e420aSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
7cd21e7c5SGarrett D'Amore  */
84ab75253Smrj 
94ab75253Smrj #ifndef	_SYS_DDI_OBSOLETE_H
104ab75253Smrj #define	_SYS_DDI_OBSOLETE_H
114ab75253Smrj 
124ab75253Smrj /*
134ab75253Smrj  * Obsoleted DDI Interfaces
144ab75253Smrj  */
154ab75253Smrj 
164ab75253Smrj #include <sys/types.h>
174ab75253Smrj #include <sys/dditypes.h>
1825e8c5aaSvikram #include <sys/sunldi.h>
194ab75253Smrj 
204ab75253Smrj 
214ab75253Smrj #ifdef	__cplusplus
224ab75253Smrj extern "C" {
234ab75253Smrj #endif
244ab75253Smrj 
254ab75253Smrj 
264ab75253Smrj #ifndef	_DDI_STRICT
274ab75253Smrj 
282ef9abdcSjv227347 extern long strtol(const char *, char **, int);
292ef9abdcSjv227347 extern unsigned long strtoul(const char *, char **, int);
304ab75253Smrj 
314ab75253Smrj uint8_t ddi_mem_get8(ddi_acc_handle_t handle, uint8_t *host_addr);
324ab75253Smrj uint16_t ddi_mem_get16(ddi_acc_handle_t handle, uint16_t *host_addr);
334ab75253Smrj uint32_t ddi_mem_get32(ddi_acc_handle_t handle, uint32_t *host_addr);
344ab75253Smrj uint64_t ddi_mem_get64(ddi_acc_handle_t handle, uint64_t *host_addr);
354ab75253Smrj void ddi_mem_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value);
364ab75253Smrj void ddi_mem_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value);
374ab75253Smrj void ddi_mem_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value);
384ab75253Smrj void ddi_mem_put64(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value);
394ab75253Smrj 
404ab75253Smrj void ddi_mem_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr,
414ab75253Smrj     uint8_t *dev_addr, size_t repcount, uint_t flags);
424ab75253Smrj void ddi_mem_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr,
434ab75253Smrj     uint16_t *dev_addr, size_t repcount, uint_t flags);
444ab75253Smrj void ddi_mem_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr,
454ab75253Smrj     uint32_t *dev_addr, size_t repcount, uint_t flags);
464ab75253Smrj void ddi_mem_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr,
474ab75253Smrj     uint64_t *dev_addr, size_t repcount, uint_t flags);
484ab75253Smrj void ddi_mem_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr,
494ab75253Smrj     uint8_t *dev_addr, size_t repcount, uint_t flags);
504ab75253Smrj void ddi_mem_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr,
514ab75253Smrj     uint16_t *dev_addr, size_t repcount, uint_t flags);
524ab75253Smrj void ddi_mem_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr,
534ab75253Smrj     uint32_t *dev_addr, size_t repcount, uint_t flags);
544ab75253Smrj void ddi_mem_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr,
554ab75253Smrj     uint64_t *dev_addr, size_t repcount, uint_t flags);
564ab75253Smrj 
574ab75253Smrj uint8_t ddi_io_get8(ddi_acc_handle_t handle, uint8_t *dev_addr);
584ab75253Smrj uint16_t ddi_io_get16(ddi_acc_handle_t handle, uint16_t *dev_addr);
594ab75253Smrj uint32_t ddi_io_get32(ddi_acc_handle_t handle, uint32_t *dev_addr);
604ab75253Smrj void ddi_io_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value);
614ab75253Smrj void ddi_io_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value);
624ab75253Smrj void ddi_io_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value);
634ab75253Smrj 
644ab75253Smrj void ddi_io_rep_get8(ddi_acc_handle_t handle,
654ab75253Smrj     uint8_t *host_addr, uint8_t *dev_addr, size_t repcount);
664ab75253Smrj void ddi_io_rep_get16(ddi_acc_handle_t handle,
674ab75253Smrj     uint16_t *host_addr, uint16_t *dev_addr, size_t repcount);
684ab75253Smrj void ddi_io_rep_get32(ddi_acc_handle_t handle,
694ab75253Smrj     uint32_t *host_addr, uint32_t *dev_addr, size_t repcount);
704ab75253Smrj void ddi_io_rep_put8(ddi_acc_handle_t handle,
714ab75253Smrj     uint8_t *host_addr, uint8_t *dev_addr, size_t repcount);
724ab75253Smrj void ddi_io_rep_put16(ddi_acc_handle_t handle,
734ab75253Smrj     uint16_t *host_addr, uint16_t *dev_addr, size_t repcount);
744ab75253Smrj void ddi_io_rep_put32(ddi_acc_handle_t handle,
754ab75253Smrj     uint32_t *host_addr, uint32_t *dev_addr, size_t repcount);
764ab75253Smrj 
774ab75253Smrj /* only support older interfaces on 32-bit systems */
784ab75253Smrj #ifdef _ILP32
794ab75253Smrj #define	ddi_mem_getb		ddi_mem_get8
804ab75253Smrj #define	ddi_mem_getw		ddi_mem_get16
814ab75253Smrj #define	ddi_mem_getl		ddi_mem_get32
824ab75253Smrj #define	ddi_mem_getll		ddi_mem_get64
834ab75253Smrj #define	ddi_mem_rep_getb	ddi_mem_rep_get8
844ab75253Smrj #define	ddi_mem_rep_getw	ddi_mem_rep_get16
854ab75253Smrj #define	ddi_mem_rep_getl	ddi_mem_rep_get32
864ab75253Smrj #define	ddi_mem_rep_getll	ddi_mem_rep_get64
874ab75253Smrj #define	ddi_mem_putb		ddi_mem_put8
884ab75253Smrj #define	ddi_mem_putw		ddi_mem_put16
894ab75253Smrj #define	ddi_mem_putl		ddi_mem_put32
904ab75253Smrj #define	ddi_mem_putll		ddi_mem_put64
914ab75253Smrj #define	ddi_mem_rep_putb	ddi_mem_rep_put8
924ab75253Smrj #define	ddi_mem_rep_putw	ddi_mem_rep_put16
934ab75253Smrj #define	ddi_mem_rep_putl	ddi_mem_rep_put32
944ab75253Smrj #define	ddi_mem_rep_putll	ddi_mem_rep_put64
954ab75253Smrj #define	ddi_io_getb		ddi_io_get8
964ab75253Smrj #define	ddi_io_getw		ddi_io_get16
974ab75253Smrj #define	ddi_io_getl		ddi_io_get32
984ab75253Smrj #define	ddi_io_putb		ddi_io_put8
994ab75253Smrj #define	ddi_io_putw		ddi_io_put16
1004ab75253Smrj #define	ddi_io_putl		ddi_io_put32
1014ab75253Smrj #define	ddi_getb		ddi_get8
1024ab75253Smrj #define	ddi_getw		ddi_get16
1034ab75253Smrj #define	ddi_getl		ddi_get32
1044ab75253Smrj #define	ddi_getll		ddi_get64
1054ab75253Smrj #define	ddi_rep_getb		ddi_rep_get8
1064ab75253Smrj #define	ddi_rep_getw		ddi_rep_get16
1074ab75253Smrj #define	ddi_rep_getl		ddi_rep_get32
1084ab75253Smrj #define	ddi_rep_getll		ddi_rep_get64
1094ab75253Smrj #define	ddi_putb		ddi_put8
1104ab75253Smrj #define	ddi_putw		ddi_put16
1114ab75253Smrj #define	ddi_putl		ddi_put32
1124ab75253Smrj #define	ddi_putll		ddi_put64
1134ab75253Smrj #define	ddi_rep_putb		ddi_rep_put8
1144ab75253Smrj #define	ddi_rep_putw		ddi_rep_put16
1154ab75253Smrj #define	ddi_rep_putl		ddi_rep_put32
1164ab75253Smrj #define	ddi_rep_putll		ddi_rep_put64
1174ab75253Smrj 
1184ab75253Smrj /* These can't be define's since they're not asm routines */
1194ab75253Smrj void ddi_io_rep_getb(ddi_acc_handle_t handle, uint8_t *host_addr,
1204ab75253Smrj     uint8_t *dev_addr, size_t repcount);
1214ab75253Smrj void ddi_io_rep_getw(ddi_acc_handle_t handle, uint16_t *host_addr,
1224ab75253Smrj     uint16_t *dev_addr, size_t repcount);
1234ab75253Smrj void ddi_io_rep_getl(ddi_acc_handle_t handle, uint32_t *host_addr,
1244ab75253Smrj     uint32_t *dev_addr, size_t repcount);
1254ab75253Smrj void ddi_io_rep_putb(ddi_acc_handle_t handle, uint8_t *host_addr,
1264ab75253Smrj     uint8_t *dev_addr, size_t repcount);
1274ab75253Smrj void ddi_io_rep_putw(ddi_acc_handle_t handle, uint16_t *host_addr,
1284ab75253Smrj     uint16_t *dev_addr, size_t repcount);
1294ab75253Smrj void ddi_io_rep_putl(ddi_acc_handle_t handle, uint32_t *host_addr,
1304ab75253Smrj     uint32_t *dev_addr, size_t repcount);
1314ab75253Smrj 
1324ab75253Smrj int ddi_peekc(dev_info_t *dip, int8_t *addr, int8_t *val_p);
1334ab75253Smrj int ddi_peeks(dev_info_t *dip, int16_t *addr, int16_t *val_p);
1344ab75253Smrj int ddi_peekl(dev_info_t *dip, int32_t *addr, int32_t *val_p);
1354ab75253Smrj int ddi_peekd(dev_info_t *dip, int64_t *addr, int64_t *val_p);
1364ab75253Smrj int ddi_pokec(dev_info_t *dip, int8_t *addr, int8_t val);
1374ab75253Smrj int ddi_pokes(dev_info_t *dip, int16_t *addr, int16_t val);
1384ab75253Smrj int ddi_pokel(dev_info_t *dip, int32_t *addr, int32_t val);
1394ab75253Smrj int ddi_poked(dev_info_t *dip, int64_t *addr, int64_t val);
1404ab75253Smrj 
1414ab75253Smrj uint8_t pci_config_getb(ddi_acc_handle_t handle, off_t offset);
1424ab75253Smrj uint16_t pci_config_getw(ddi_acc_handle_t handle, off_t offset);
1434ab75253Smrj uint32_t pci_config_getl(ddi_acc_handle_t handle, off_t offset);
1444ab75253Smrj uint64_t pci_config_getll(ddi_acc_handle_t handle, off_t offset);
1454ab75253Smrj void pci_config_putb(ddi_acc_handle_t handle, off_t offset, uint8_t value);
1464ab75253Smrj void pci_config_putw(ddi_acc_handle_t handle, off_t offset, uint16_t value);
1474ab75253Smrj void pci_config_putl(ddi_acc_handle_t handle, off_t offset, uint32_t value);
1484ab75253Smrj void pci_config_putll(ddi_acc_handle_t handle, off_t offset, uint64_t value);
1494ab75253Smrj 
1504ab75253Smrj extern void repinsb(int port, uint8_t *addr, int count);
1514ab75253Smrj extern void repinsw(int port, uint16_t *addr, int count);
1524ab75253Smrj extern void repinsd(int port, uint32_t *addr, int count);
1534ab75253Smrj extern void repoutsb(int port, uint8_t *addr, int count);
1544ab75253Smrj extern void repoutsw(int port, uint16_t *addr, int count);
1554ab75253Smrj extern void repoutsd(int port, uint32_t *addr, int count);
1564ab75253Smrj #endif
1574ab75253Smrj 
15825e8c5aaSvikram /* Obsolete LDI event interfaces */
15925e8c5aaSvikram extern int ldi_get_eventcookie(ldi_handle_t, char *,
16025e8c5aaSvikram     ddi_eventcookie_t *);
16125e8c5aaSvikram extern int ldi_add_event_handler(ldi_handle_t, ddi_eventcookie_t,
16225e8c5aaSvikram     void (*handler)(ldi_handle_t, ddi_eventcookie_t, void *, void *),
16325e8c5aaSvikram     void *, ldi_callback_id_t *);
16425e8c5aaSvikram extern int ldi_remove_event_handler(ldi_handle_t, ldi_callback_id_t);
16525e8c5aaSvikram 
16625e8c5aaSvikram 
1674ab75253Smrj #endif /* not _DDI_STRICT */
1684ab75253Smrj 
1694ab75253Smrj #ifdef	__cplusplus
1704ab75253Smrj }
1714ab75253Smrj #endif
1724ab75253Smrj 
1734ab75253Smrj #endif	/* _SYS_DDI_OBSOLETE_H */
174