Skip to content

Commit

Permalink
memory: expose C functions to allocate and free contiguous area
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com>
  • Loading branch information
wkozaczuk committed Mar 17, 2024
1 parent a61a1dc commit 2d14fb7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/mempool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2181,3 +2181,13 @@ bool throttling_needed()

jvm_balloon_api *balloon_api = nullptr;
}

extern "C" void* alloc_contiguous_aligned(size_t size, size_t align)
{
return memory::alloc_phys_contiguous_aligned(size, align, true);
}

extern "C" void free_contiguous_aligned(void* p)
{
memory::free_phys_contiguous_aligned(p);
}
5 changes: 5 additions & 0 deletions core/mmu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2116,3 +2116,8 @@ std::string procfs_maps()
}

}

extern "C" bool is_linear_mapped(const void *addr)
{
return addr >= mmu::phys_mem;
}

0 comments on commit 2d14fb7

Please sign in to comment.