blob: 432f95007c25dd302f13f182accf71ec680d7df7 [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,
20 paddr_t end, uint32_t mode, struct mpool *ppool);
21void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
22 paddr_t end, uint32_t mode, struct mpool *ppool,
23 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,
28 ipaddr_t end, uint32_t *mode);
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -050029bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
30 paddr_t end, uint32_t mode,
31 struct mpool *ppool, ipaddr_t *ipa,
32 uint8_t dma_device_id);