2010-02-14 15:32:20

by Neshama Parhoti

[permalink] [raw]
Subject: understanding DMA cache maint

in the following function,
what's the different between the inner_op (dmac_*) and outer_op (outer_*) ?
why do we need two functions to do the cache operation ?
isn't this an action on the cache hardware itself ? are there 2
hardwares involved ?

void dma_cache_maint(const void *start, size_t size, int direction)
{
...
switch (direction) {
case DMA_FROM_DEVICE: /* invalidate only */
inner_op = dmac_inv_range;
outer_op = outer_inv_range;
break;
case DMA_TO_DEVICE: /* writeback only */
inner_op = dmac_clean_range;
outer_op = outer_clean_range;
break;
case DMA_BIDIRECTIONAL: /* writeback and invalidate */
inner_op = dmac_flush_range;
outer_op = outer_flush_range;


thank you!