Lines Matching full:safe
56 /* safe buffer info */
58 void *safe; member
106 /* allocate a 'safe' buffer and keep track of it */
139 buf->safe = dma_pool_alloc(pool->pool, GFP_ATOMIC, in alloc_safe_buffer()
142 buf->safe = dma_alloc_coherent(dev, size, &buf->safe_dma_addr, in alloc_safe_buffer()
146 if (buf->safe == NULL) { in alloc_safe_buffer()
167 /* determine if a buffer is from our "safe" pool */
201 dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr); in free_safe_buffer()
203 dma_free_coherent(device_info->dev, buf->size, buf->safe, in free_safe_buffer()
265 buf->safe, buf->safe_dma_addr); in map_single()
269 dev_dbg(dev, "%s: copy unsafe %p to safe %p, size %d\n", in map_single()
270 __func__, ptr, buf->safe, size); in map_single()
271 memcpy(buf->safe, ptr, size); in map_single()
286 buf->safe, buf->safe_dma_addr); in unmap_single()
294 dev_dbg(dev, "%s: copy back safe %p to unsafe %p size %d\n", in unmap_single()
295 __func__, buf->safe, ptr, size); in unmap_single()
296 memcpy(ptr, buf->safe, size); in unmap_single()
312 * allocate a 'safe' buffer and copy the unsafe buffer into it.
313 * substitute the safe buffer for the unsafe one.
314 * (basically move the buffer from an unsafe area to a safe one)
346 * see if a mapped address was really a "safe" buffer and if so, copy
347 * the data from the safe buffer back to the unsafe buffer and free up
348 * the safe buffer. (basically return things back to the way they
387 buf->safe, buf->safe_dma_addr); in __dmabounce_sync_for_cpu()
392 dev_dbg(dev, "%s: copy back safe %p to unsafe %p size %d\n", in __dmabounce_sync_for_cpu()
393 __func__, buf->safe + off, buf->ptr + off, sz); in __dmabounce_sync_for_cpu()
394 memcpy(buf->ptr + off, buf->safe + off, sz); in __dmabounce_sync_for_cpu()
427 buf->safe, buf->safe_dma_addr); in __dmabounce_sync_for_device()
432 dev_dbg(dev, "%s: copy out unsafe %p to safe %p, size %d\n", in __dmabounce_sync_for_device()
433 __func__,buf->ptr + off, buf->safe + off, sz); in __dmabounce_sync_for_device()
434 memcpy(buf->safe + off, buf->ptr + off, sz); in __dmabounce_sync_for_device()