xref: /illumos-gate/usr/src/uts/common/sys/ddi_obsolete.h (revision dd72704bd9e794056c558153663c739e2012d721)
1 /*
2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 /*
6  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
7  */
8 
9 #ifndef	_SYS_DDI_OBSOLETE_H
10 #define	_SYS_DDI_OBSOLETE_H
11 
12 /*
13  * Obsoleted DDI Interfaces
14  */
15 
16 #include <sys/types.h>
17 #include <sys/dditypes.h>
18 #include <sys/sunldi.h>
19 
20 
21 #ifdef	__cplusplus
22 extern "C" {
23 #endif
24 
25 
26 #ifndef	_DDI_STRICT
27 
28 extern long strtol(const char *, char **, int);
29 extern unsigned long strtoul(const char *, char **, int);
30 
31 uint8_t ddi_mem_get8(ddi_acc_handle_t handle, uint8_t *host_addr);
32 uint16_t ddi_mem_get16(ddi_acc_handle_t handle, uint16_t *host_addr);
33 uint32_t ddi_mem_get32(ddi_acc_handle_t handle, uint32_t *host_addr);
34 uint64_t ddi_mem_get64(ddi_acc_handle_t handle, uint64_t *host_addr);
35 void ddi_mem_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value);
36 void ddi_mem_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value);
37 void ddi_mem_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value);
38 void ddi_mem_put64(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value);
39 
40 void ddi_mem_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr,
41     uint8_t *dev_addr, size_t repcount, uint_t flags);
42 void ddi_mem_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr,
43     uint16_t *dev_addr, size_t repcount, uint_t flags);
44 void ddi_mem_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr,
45     uint32_t *dev_addr, size_t repcount, uint_t flags);
46 void ddi_mem_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr,
47     uint64_t *dev_addr, size_t repcount, uint_t flags);
48 void ddi_mem_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr,
49     uint8_t *dev_addr, size_t repcount, uint_t flags);
50 void ddi_mem_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr,
51     uint16_t *dev_addr, size_t repcount, uint_t flags);
52 void ddi_mem_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr,
53     uint32_t *dev_addr, size_t repcount, uint_t flags);
54 void ddi_mem_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr,
55     uint64_t *dev_addr, size_t repcount, uint_t flags);
56 
57 uint8_t ddi_io_get8(ddi_acc_handle_t handle, uint8_t *dev_addr);
58 uint16_t ddi_io_get16(ddi_acc_handle_t handle, uint16_t *dev_addr);
59 uint32_t ddi_io_get32(ddi_acc_handle_t handle, uint32_t *dev_addr);
60 void ddi_io_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value);
61 void ddi_io_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value);
62 void ddi_io_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value);
63 
64 void ddi_io_rep_get8(ddi_acc_handle_t handle,
65     uint8_t *host_addr, uint8_t *dev_addr, size_t repcount);
66 void ddi_io_rep_get16(ddi_acc_handle_t handle,
67     uint16_t *host_addr, uint16_t *dev_addr, size_t repcount);
68 void ddi_io_rep_get32(ddi_acc_handle_t handle,
69     uint32_t *host_addr, uint32_t *dev_addr, size_t repcount);
70 void ddi_io_rep_put8(ddi_acc_handle_t handle,
71     uint8_t *host_addr, uint8_t *dev_addr, size_t repcount);
72 void ddi_io_rep_put16(ddi_acc_handle_t handle,
73     uint16_t *host_addr, uint16_t *dev_addr, size_t repcount);
74 void ddi_io_rep_put32(ddi_acc_handle_t handle,
75     uint32_t *host_addr, uint32_t *dev_addr, size_t repcount);
76 
77 /* Obsolete LDI event interfaces */
78 extern int ldi_get_eventcookie(ldi_handle_t, char *,
79     ddi_eventcookie_t *);
80 extern int ldi_add_event_handler(ldi_handle_t, ddi_eventcookie_t,
81     void (*handler)(ldi_handle_t, ddi_eventcookie_t, void *, void *),
82     void *, ldi_callback_id_t *);
83 extern int ldi_remove_event_handler(ldi_handle_t, ldi_callback_id_t);
84 
85 
86 #endif /* not _DDI_STRICT */
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _SYS_DDI_OBSOLETE_H */
93