df8c266 ArmPkg/ArmDmaLib: clean up abuse of device address

1 file Authored by Ard Biesheuvel 7 years ago, Committed by Leif Lindholm 7 years ago,
    ArmPkg/ArmDmaLib: clean up abuse of device address
    
    In preparation of adding support to ArmDmalib for DMA bus masters whose
    view of memory is offset by a constant compared to the CPU's view, clean
    up some abuse of the device address.
    
    The device address is not defined in terms of the CPU's address space,
    and so it should not be used in CopyMem () or cache maintenance operations
    that require a valid mapping. This not only applies to the above use case,
    but also to the DebugUncachedMemoryAllocationLib that unmaps the
    primary, cached mapping of an allocation, and returns a host address
    which is an uncached alias offset by a constant.
    
    Since we should never access the device address from the CPU, there is
    no need to record it in the MAPINFO struct. Instead, record the buffer
    address in case of double buffering, since we do need to copy the contents
    (in case of a bus master write) and free the buffer (in all cases) when
    DmaUnmap() is called.
    
    Contributed-under: TianoCore Contribution Agreement 1.0
    Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
    Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>