base: Pd_session::dma_addr, Pd_session::attach_dma

This patch enhances the PD-session interface with the support needed for
user-level device drivers performing DMA. Both RPC functions are
intended for the direct use by the platform driver only. If invoked for
PDs that lack the managing-system role, the operations have no effect.

The 'dma_addr()' RPC function allows the platform driver to request the
DMA address of a given RAM dataspace. It is meant to replace the
'Dataspace::phys_addr' RPC function.

The 'attach_dma' RPC function adds the given dataspace to the device
PD's I/O page table. It replaces the former heuristics of marking DMA
buffers as uncached RAM on x86.

With this patch, the UNCACHED attribute of RAM dataspaces is no longer
used to distinguish DMA buffers from regular RAM dataspaces.

Issue #2243
This commit is contained in:
Norman Feske
2022-02-01 15:17:29 +01:00
parent db3a647c6d
commit e4f62380d7
16 changed files with 264 additions and 66 deletions

View File

@ -66,6 +66,11 @@ class Genode::Region_map_component : public Rpc_object<Region_map>,
Rm_dataspace_component *dataspace_component() { return nullptr; }
void address_space(Platform_pd *) { }
using Attach_dma_result = Pd_session::Attach_dma_result;
Attach_dma_result attach_dma(Dataspace_capability, addr_t) {
return Pd_session::Attach_dma_error::DENIED; };
};