MOS Source Code
Loading...
Searching...
No Matches
paging.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include "mos/mm/mm.h"
6
10
24
45vmap_t *mm_get_free_vaddr_locked(mm_context_t *mmctx, size_t n_pages, ptr_t base_vaddr, valloc_flags flags);
46
61void mm_map_kernel_pages(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, size_t npages, vm_flags flags);
62vmap_t *mm_map_user_pages(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, size_t npages, vm_flags flags, valloc_flags vaflags, vmap_type_t type, vmap_content_t content);
63
75void mm_replace_page_locked(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, vm_flags flags);
76
91
100
109void mm_flag_pages_locked(mm_context_t *mmctx, ptr_t vaddr, size_t npages, vm_flags flags);
110
112
vmap_type_t
Definition mm.h:30
vmap_content_t
Definition mm.h:21
valloc_flags
Definition paging.h:20
ptr_t mm_get_phys_addr(mm_context_t *ctx, ptr_t vaddr)
Definition paging.c:179
void mm_replace_page_locked(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, vm_flags flags)
Replace the mappings of a page with a new physical frame.
Definition paging.c:112
vmap_t * mm_clone_vmap_locked(vmap_t *src_vmap, mm_context_t *dst_ctx)
Remap a block of virtual memory from one page table to another, i.e. copy the mappings.
Definition paging.c:132
bool mm_get_is_mapped_locked(mm_context_t *mmctx, ptr_t vaddr)
Get if a virtual address is mapped in a page table.
Definition paging.c:159
vmap_t * mm_map_user_pages(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, size_t npages, vm_flags flags, valloc_flags vaflags, vmap_type_t type, vmap_content_t content)
Definition paging.c:92
void mm_flag_pages_locked(mm_context_t *mmctx, ptr_t vaddr, size_t npages, vm_flags flags)
Update the flags of a block of virtual memory.
Definition paging.c:171
void mm_map_kernel_pages(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, size_t npages, vm_flags flags)
Map a block of virtual memory to a block of physical memory.
Definition paging.c:82
vmap_t * mm_get_free_vaddr_locked(mm_context_t *mmctx, size_t n_pages, ptr_t base_vaddr, valloc_flags flags)
Gets npages unmapped free pages from a page table.
Definition paging.c:18
@ VALLOC_EXACT
Allocate pages at the exact address.
Definition paging.h:22
@ VALLOC_DEFAULT
Default allocation flags.
Definition paging.h:21
@ MMAP_EXACT
Definition mm_types.h:16
vm_flags
Definition platform.h:40
Definition mm.h:58
unsigned long long pfn_t
Definition types.h:41
unsigned long ptr_t
Definition types.h:25