xref: /kernel/dev/iommu/dummy/include/dev/iommu/dummy.h
  • Home
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • current directory
1 // Copyright 2017 The Fuchsia Authors
2 //
3 // Use of this source code is governed by a MIT-style
4 // license that can be found in the LICENSE file or at
5 // https://opensource.org/licenses/MIT
6 
7 #pragma once
8 
9 #include <dev/iommu.h>
10 #include <zircon/compiler.h>
11 #include <zircon/syscalls/iommu.h>
12 #include <ktl/unique_ptr.h>
13 
14 class DummyIommu final : public Iommu {
15 public:
16     static zx_status_t Create(ktl::unique_ptr<const uint8_t[]> desc, size_t desc_len,
17                               fbl::RefPtr<Iommu>* out);
18 
19     bool IsValidBusTxnId(uint64_t bus_txn_id) const final;
20 
21     zx_status_t Map(uint64_t bus_txn_id, const fbl::RefPtr<VmObject>& vmo,
22                     uint64_t offset, size_t size, uint32_t perms,
23                     dev_vaddr_t* vaddr, size_t* mapped_len) final;
24     zx_status_t MapContiguous(uint64_t bus_txn_id, const fbl::RefPtr<VmObject>& vmo,
25                               uint64_t offset, size_t size, uint32_t perms,
26                               dev_vaddr_t* vaddr, size_t* mapped_len) final;
27     zx_status_t Unmap(uint64_t bus_txn_id, dev_vaddr_t vaddr, size_t size) final;
28 
29     zx_status_t ClearMappingsForBusTxnId(uint64_t bus_txn_id) final;
30 
31     uint64_t minimum_contiguity(uint64_t bus_txn_id) final;
32     uint64_t aspace_size(uint64_t bus_txn_id) final;
33 
34     ~DummyIommu() final;
35 
36     DISALLOW_COPY_ASSIGN_AND_MOVE(DummyIommu);
37 private:
38     DummyIommu();
39 };
40 

Last Index update Fri Aug 22 02:51:41 CST 2025