blob: c4ee916d5342f29640a0758ca7ec5ef3039e2685 [file] [log] [blame]
Fuad Tabba77a4b012019-11-15 12:13:08 +00001/*
2 * Copyright 2019 The Hafnium Authors.
3 *
Andrew Walbrane959ec12020-06-17 15:01:09 +01004 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
Fuad Tabba77a4b012019-11-15 12:13:08 +00007 */
8
9#pragma once
10
11#include "hf/vm.h"
12
13/**
14 * Set architecture-specific features for the specified VM.
15 */
16void arch_vm_features_set(struct vm *vm);
Olivier Deprezd9d409f2023-03-17 11:47:57 +010017bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool);
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -060018bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool);
Olivier Deprezd9d409f2023-03-17 11:47:57 +010019bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +000020 paddr_t end, mm_mode_t mode, struct mpool *ppool);
Olivier Deprezd9d409f2023-03-17 11:47:57 +010021void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +000022 paddr_t end, mm_mode_t mode, struct mpool *ppool,
Olivier Deprezd9d409f2023-03-17 11:47:57 +010023 ipaddr_t *ipa);
24bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
25 struct mpool *ppool);
26void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool);
27bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +000028 ipaddr_t end, mm_mode_t *mode);
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -050029bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +000030 paddr_t end, mm_mode_t mode,
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -050031 struct mpool *ppool, ipaddr_t *ipa,
32 uint8_t dma_device_id);