summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c')
-rw-r--r--EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c
index 4cbe349190..564db83c90 100644
--- a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c
+++ b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c
@@ -19,6 +19,14 @@
#include <Library/MemoryAllocationLib.h>
+STATIC
+PHYSICAL_ADDRESS
+HostToDeviceAddress (
+ IN VOID *Address
+ )
+{
+ return (PHYSICAL_ADDRESS)(UINTN)Address + PcdGet64 (PcdDmaDeviceOffset);
+}
/**
Provides the DMA controller-specific addresses needed to access system memory.
@@ -50,7 +58,7 @@ DmaMap (
OUT VOID **Mapping
)
{
- *DeviceAddress = (PHYSICAL_ADDRESS)(UINTN)HostAddress;
+ *DeviceAddress = HostToDeviceAddress (HostAddress);
*Mapping = NULL;
return EFI_SUCCESS;
}