L4Re - L4 Runtime Environment
iommu
1 // vi:set ft=cpp: -*- Mode: C++ -*-
2 /* \file
3  * IO-MMU interface description.
4  */
5 #pragma once
6 
7 #include <l4/sys/cxx/ipc_iface>
8 
9 namespace L4 {
10 /**
11  * Interface for IO-MMUs used for DMA remapping.
12  *
13  * This interface allows to associate a DMA address space
14  * with a platform dependent set of devices.
15  */
16 class Iommu :
17  public Kobject_x<Iommu, Proto_t<L4_PROTO_IOMMU>, Type_info::Demand_t<1> >
18 {
19 public:
20  /**
21  * Associate `dma_space` with the set of device(s) specified by `src_id`.
22  *
23  * \param src_id Platform dependent source ID specifying the set of
24  * devices that shall use `dma_space` for DMA remapping.
25  * \param dma_space The DMA space (L4::Task created with
26  * L4_PROTO_DMA_SPACE) providing the mappings that
27  * shall be used for the device(s).
28  */
29  L4_INLINE_RPC(
30  l4_msgtag_t, bind, (l4_uint64_t src_id, Ipc::Cap<Task> dma_space));
31 
32  /**
33  * Remove the association of the given DMA address space from the
34  * device(s) specified by `src_id`.
35  *
36  * \param src_id Platform dependent source ID specifying the set of
37  * devices that shall no longer use `dma_space` for
38  * DMA remapping.
39  * \param dma_space The DMA space formerly associated with associate().
40  */
41  L4_INLINE_RPC(
42  l4_msgtag_t, unbind, (l4_uint64_t src_id, Ipc::Cap<Task> dma_space));
43 
44  typedef Typeid::Rpcs_code<l4_umword_t>::F<bind_t, unbind_t> Rpcs;
45 };
46 
47 }