aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-11-04 15:18:49 +0000
committerMichael Brown <mcb30@ipxe.org>2020-11-05 20:03:50 +0000
commitdda03c884d70d18546bb2d02f92acb4c4da28fc8 (patch)
tree775637d2c67340a945df274ff5da3d88353d43c8 /src/config
parentbe1c87b72237f633c4f4b05bcb133acf2967d788 (diff)
downloadipxe-dda03c884d70d18546bb2d02f92acb4c4da28fc8.zip
ipxe-dda03c884d70d18546bb2d02f92acb4c4da28fc8.tar.gz
ipxe-dda03c884d70d18546bb2d02f92acb4c4da28fc8.tar.bz2
[dma] Define a DMA API to allow for non-flat device address spaces
iPXE currently assumes that DMA-capable devices can directly address physical memory using host addresses. This assumption fails when using an IOMMU. Define an internal DMA API with two implementations: a "flat" implementation for use in legacy BIOS or other environments in which flat physical addressing is guaranteed to be used and all allocated physical addresses are guaranteed to be within a 32-bit address space, and an "operations-based" implementation for use in UEFI or other environments in which DMA mapping may require bus-specific handling. The purpose of the fully inlined "flat" implementation is to allow the trivial identity DMA mappings to be optimised out at build time, thereby avoiding an increase in code size for legacy BIOS builds. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/config')
-rw-r--r--src/config/defaults/efi.h1
-rw-r--r--src/config/defaults/linux.h1
-rw-r--r--src/config/defaults/pcbios.h1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/config/defaults/efi.h b/src/config/defaults/efi.h
index 0979887..9ef34ab 100644
--- a/src/config/defaults/efi.h
+++ b/src/config/defaults/efi.h
@@ -12,6 +12,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define UACCESS_EFI
#define IOMAP_VIRT
#define PCIAPI_EFI
+#define DMAAPI_OP
#define CONSOLE_EFI
#define TIMER_EFI
#define UMALLOC_EFI
diff --git a/src/config/defaults/linux.h b/src/config/defaults/linux.h
index 75fd617..98d2daf 100644
--- a/src/config/defaults/linux.h
+++ b/src/config/defaults/linux.h
@@ -20,6 +20,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define TIME_LINUX
#define REBOOT_NULL
#define PCIAPI_LINUX
+#define DMAAPI_FLAT
#define DRIVERS_LINUX
diff --git a/src/config/defaults/pcbios.h b/src/config/defaults/pcbios.h
index 41afb90..8383580 100644
--- a/src/config/defaults/pcbios.h
+++ b/src/config/defaults/pcbios.h
@@ -12,6 +12,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define UACCESS_LIBRM
#define IOAPI_X86
#define PCIAPI_PCBIOS
+#define DMAAPI_FLAT
#define TIMER_PCBIOS
#define CONSOLE_PCBIOS
#define NAP_PCBIOS