mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
mpfs_usb.c: Use kernel memory instead of user memory for DMA
DMA directly to user (virtual) memory won't work, as the DMA engine(s) don't do address translations, i.e. they require a physical address. Using kernel heap is fine as it is mapped vaddr=paddr. Also, the USB DMA engine does not have any alignment requirements.
This commit is contained in:
@@ -1718,7 +1718,7 @@ static void *mpfs_ep_allocbuffer(struct usbdev_ep_s *ep, uint16_t nbytes)
|
||||
{
|
||||
/* There is not special buffer allocation requirement */
|
||||
|
||||
return kumm_malloc(nbytes);
|
||||
return kmm_malloc(nbytes);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1745,7 +1745,7 @@ static void mpfs_ep_freebuffer(struct usbdev_ep_s *ep, void *buf)
|
||||
{
|
||||
/* There is not special buffer allocation requirement */
|
||||
|
||||
kumm_free(buf);
|
||||
kmm_free(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user