1ddi_dma_addr_setup(9F) Kernel Functions for Drivers ddi_dma_addr_setup(9F)
2
3
4
6 ddi_dma_addr_setup - easier DMA setup for use with virtual addresses
7
9 #include <sys/ddi.h>
10 #include <sys/sunddi.h>
11
12 int ddi_dma_addr_setup(dev_info_t *dip, struct as *as, caddr_t addr,
13 size_t len, uint_t flags, int (*waitfp) (caddr_t), caddr_t arg,
14 ddi_dma_lim_t * lim, ddi_dma_handle_t *handlep);
15
16
18 This interface is obsolete. ddi_dma_addr_bind_handle(9F) should be used
19 instead.
20
22 dip A pointer to the device's dev_info structure.
23
24
25 as A pointer to an address space structure. Should be set to
26 NULL, which implies kernel address space.
27
28
29 addr Virtual address of the memory object.
30
31
32 len Length of the memory object in bytes.
33
34
35 flags Flags that would go into the ddi_dma_req structure (see
36 ddi_dma_req(9S)).
37
38
39 waitfp The address of a function to call back later if resources
40 aren't available now. The special function addresses
41 DDI_DMA_SLEEP and DDI_DMA_DONTWAIT (see ddi_dma_req(9S)) are
42 taken to mean, respectively, wait until resources are avail‐
43 able or, do not wait at all and do not schedule a callback.
44
45
46 arg Argument to be passed to a callback function, if such a
47 function is specified.
48
49
50 lim A pointer to a DMA limits structure for this device (see
51 ddi_dma_lim_sparc(9S) or ddi_dma_lim_x86(9S)). If this
52 pointer is NULL, a default set of DMA limits is assumed.
53
54
55 handlep Pointer to a DMA handle. See ddi_dma_setup(9F) for a discus‐
56 sion of handle.
57
58
60 The ddi_dma_addr_setup() function is an interface to ddi_dma_setup(9F).
61 It uses its arguments to construct an appropriate ddi_dma_req structure
62 and calls ddi_dma_setup(9F) with it.
63
65 See ddi_dma_setup(9F) for the possible return values for this function.
66
68 The ddi_dma_addr_setup() can be called from user, interrupt, or kernel
69 context, except when waitfp is set to DDI_DMA_SLEEP, in which case it
70 cannot be called from interrupt context.
71
73 See attributes(5) for a description of the following attributes:
74
75
76
77
78 ┌─────────────────────────────┬─────────────────────────────┐
79 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
80 ├─────────────────────────────┼─────────────────────────────┤
81 │Stability Level │Obsolete │
82 └─────────────────────────────┴─────────────────────────────┘
83
85 attributes(5), ddi_dma_buf_setup(9F), ddi_dma_free(9F),
86 ddi_dma_htoc(9F), ddi_dma_setup(9F), ddi_dma_sync(9F),
87 ddi_iopb_alloc(9F), ddi_dma_lim_sparc(9S), ddi_dma_lim_x86(9S),
88 ddi_dma_req(9S)
89
90
91 Writing Device Drivers
92
93
94
95SunOS 5.11 04 Apr 2006 ddi_dma_addr_setup(9F)