1ddi_dma_movwin(9F) Kernel Functions for Drivers ddi_dma_movwin(9F)
2
3
4
6 ddi_dma_movwin - shift current DMA window
7
9 #include <sys/ddi.h>
10 #include <sys/sunddi.h>
11
12
13
14 int ddi_dma_movwin(ddi_dma_handle_t handle, off_t *offp,
15 uint_t *lenp, ddi_dma_cookie_t *cookiep);
16
17
19 This interface is obsolete. ddi_dma_getwin(9F) should be used instead.
20
22 handle The DMA handle filled in by a call to ddi_dma_setup(9F).
23
24
25 offp A pointer to an offset to set the DMA window to. Upon a suc‐
26 cessful return, it will be filled in with the new offset
27 from the beginning of the object resources are allocated
28 for.
29
30
31 lenp A pointer to a value which must either be the current size
32 of the DMA window (as known from a call to ddi_dma_cur‐
33 win(9F) or from a previous call to ddi_dma_movwin()). Upon a
34 successful return, it will be filled in with the size, in
35 bytes, of the current window.
36
37
38 cookiep A pointer to a DMA cookie (see ddi_dma_cookie(9S)). Upon a
39 successful return, cookiep is filled in just as if an
40 implicit ddi_dma_htoc(9F) had been made.
41
42
44 The ddi_dma_movwin() function shifts the current DMA window. If a DMA
45 request allows the system to allocate resources for less than the
46 entire object by setting the DDI_DMA_PARTIAL flag in the
47 ddi_dma_req(9S) structure, the current DMA window can be shifted by a
48 call to ddi_dma_movwin().
49
50
51 The caller must first determine the current DMA window size by a call
52 to ddi_dma_curwin(9F). Using the current offset and size of the window
53 thus retrieved, the caller of ddi_dma_movwin() may change the window
54 onto the object by changing the offset by a value which is some multi‐
55 ple of the size of the DMA window.
56
57
58 The ddi_dma_movwin() function takes care of underlying resource syn‐
59 chronizations required to shift the window. However, if you want to
60 access the data prior to or after moving the window, further synchro‐
61 nizations using ddi_dma_sync(9F) are required.
62
63
64 This function is normally called from an interrupt routine. The first
65 invocation of the DMA engine is done from the driver. All subsequent
66 invocations of the DMA engine are done from the interrupt routine. The
67 interrupt routine checks to see if the request has been completed. If
68 it has, it returns without invoking another DMA transfer. Otherwise it
69 calls ddi_dma_movwin() to shift the current window and starts another
70 DMA transfer.
71
73 The ddi_dma_movwin() function returns:
74
75 DDI_SUCCESS The current length and offset are legal and have been
76 set.
77
78
79 DDI_FAILURE Otherwise.
80
81
83 The ddi_dma_movwin() function can be called from user, interrupt, or
84 kernel context.
85
87 See attributes(5) for a description of the following attributes:
88
89
90
91
92 ┌─────────────────────────────┬─────────────────────────────┐
93 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
94 ├─────────────────────────────┼─────────────────────────────┤
95 │Stability Level │Obsolete │
96 └─────────────────────────────┴─────────────────────────────┘
97
99 attributes(5), ddi_dma_curwin(9F), ddi_dma_getwin(9F),
100 ddi_dma_htoc(9F), ddi_dma_setup(9F), ddi_dma_sync(9F),
101 ddi_dma_cookie(9S), ddi_dma_req(9S)
102
103
104 Writing Device Drivers
105
107 The caller must guarantee that the resources used by the object are
108 inactive prior to calling this function.
109
110
111
112SunOS 5.11 16 Jan 2006 ddi_dma_movwin(9F)