Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/x86/busdma_machdep.c
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
* Return true if a match is made. | * Return true if a match is made. | ||||
* | * | ||||
* To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. | * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. | ||||
* | * | ||||
* If paddr is within the bounds of the dma tag then call the filter callback | * If paddr is within the bounds of the dma tag then call the filter callback | ||||
* to check for a match, if there is no filter callback then assume a match. | * to check for a match, if there is no filter callback then assume a match. | ||||
*/ | */ | ||||
int | int | ||||
bus_dma_run_filter(struct bus_dma_tag_common *tc, bus_addr_t paddr) | bus_dma_run_filter(struct bus_dma_tag_common *tc, vm_paddr_t paddr) | ||||
{ | { | ||||
int retval; | int retval; | ||||
retval = 0; | retval = 0; | ||||
do { | do { | ||||
if (((paddr > tc->lowaddr && paddr <= tc->highaddr) || | if ((paddr >= BUS_SPACE_MAXADDR || | ||||
((paddr & (tc->alignment - 1)) != 0)) && | (paddr > tc->lowaddr && paddr <= tc->highaddr) || | ||||
(paddr & (tc->alignment - 1)) != 0) && | |||||
(tc->filter == NULL || | (tc->filter == NULL || | ||||
(*tc->filter)(tc->filterarg, paddr) != 0)) | (*tc->filter)(tc->filterarg, paddr) != 0)) | ||||
retval = 1; | retval = 1; | ||||
tc = tc->parent; | tc = tc->parent; | ||||
} while (retval == 0 && tc != NULL); | } while (retval == 0 && tc != NULL); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |