Changeset fb683f7 in rtems-libbsd


Ignore:
Timestamp:
Nov 25, 2014, 11:50:29 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
eebe576
Parents:
33a15c3
git-author:
Sebastian Huber <sebastian.huber@…> (11/25/14 11:50:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/21/15 14:00:19)
Message:

BUS_DMA(9): Support BUS_DMA_COHERENT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/rtems/rtems-bsd-bus-dma.c

    r33a15c3 rfb683f7  
    238238        }
    239239
    240         *vaddr = rtems_heap_allocate_aligned_with_boundary(dmat->maxsize, dmat->alignment, dmat->boundary);
     240        if ((flags & BUS_DMA_COHERENT) != 0) {
     241                *vaddr = rtems_cache_coherent_allocate(
     242                    dmat->maxsize, dmat->alignment, dmat->boundary);
     243        } else {
     244                *vaddr = rtems_heap_allocate_aligned_with_boundary(
     245                    dmat->maxsize, dmat->alignment, dmat->boundary);
     246        }
     247
    241248        if (*vaddr == NULL) {
    242249                free(*mapp, M_DEVBUF);
     
    262269bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
    263270{
    264         free(vaddr, M_RTEMS_HEAP);
     271        rtems_cache_coherent_free(vaddr);
    265272        free(map, M_DEVBUF);
    266273}
Note: See TracChangeset for help on using the changeset viewer.