]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[dma] Modify DMA API to simplify calculation of medial addresses
authorMichael Brown <mcb30@ipxe.org>
Wed, 25 Nov 2020 15:52:00 +0000 (15:52 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 25 Nov 2020 16:15:55 +0000 (16:15 +0000)
commitcf12a41703a8b2292e5d2d7528c2733c37869681
tree72e60b6240cdd10816b7dce5fcc98822ae94e957
parent24ef743778fb47958441d8891e5104135ac4c168
[dma] Modify DMA API to simplify calculation of medial addresses

Redefine the value stored within a DMA mapping to be the offset
between physical addresses and DMA addresses within the mapped region.

Provide a dma() wrapper function to calculate the DMA address for any
pointer within a mapped region, thereby simplifying the use cases when
a device needs to be given addresses other than the region start
address.

On a platform using the "flat" DMA implementation the DMA offset for
any mapped region is always zero, with the result that dma_map() can
be optimised away completely and dma() reduces to a straightforward
call to virt_to_phys().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/dma.c
src/drivers/net/intel.c
src/drivers/net/intelxl.c
src/drivers/net/intelxlvf.c
src/drivers/net/realtek.c
src/include/ipxe/dma.h
src/interface/efi/efi_pci.c