FreeBSD/sys/boot/usb/usb_busdma_loader.c
/*------------------------------------------------------------------------*
 *  usbd_copy_out - copy directly from DMA-able memory
 *------------------------------------------------------------------------*/
copy directly from DMA-able memory
copy directly from DMA - able memory
void
usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset,
    void *ptr, usb_frlength_t len)
{
	struct usb_page_search res;
	while (len != 0) {
		usbd_get_page(cache, offset, &res);
		if (res.length > len) {
			res.length = len;
		}
		memcpy(ptr, res.buffer, res.length);
		offset += res.length;
		len -= res.length;
		ptr = USB_ADD_BYTES(ptr, res.length);
	}
}
void usbd_copy_out ( struct usb_page_cache * cache , usb_frlength_t offset , void * ptr , usb_frlength_t len ) { struct usb_page_search res ; while ( len != 0 ) { usbd_get_page ( cache , offset , & res ) ; if ( res . length > len ) { res . length = len ; } memcpy ( ptr , res . buffer , res . length ) ; offset += res . length ; len -= res . length ; ptr = USB_ADD_BYTES ( ptr , res . length ) ; } }
usbd_copy_out - copy directly from DMA-able memory
usbd_copy_out - copy directly from DMA - able memory