From 2cf6fe3f4d0811f1d62ed3ba73d15c8a187f600f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 25 Apr 2025 18:42:30 -0400 Subject: mem_get_phys fn --- kernel/include/comus/memory.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'kernel/include') diff --git a/kernel/include/comus/memory.h b/kernel/include/comus/memory.h index 92525da..408521b 100644 --- a/kernel/include/comus/memory.h +++ b/kernel/include/comus/memory.h @@ -123,6 +123,13 @@ void *mem_mapaddr(mem_ctx_t ctx, void *phys, void *virt, size_t len, */ void mem_unmapaddr(mem_ctx_t ctx, const void *virt); +/** + * Gets the physical address for a given vitural address + * @param ctx - the memory context + * @param virt - the vitural address + */ +void *mem_get_phys(mem_ctx_t ctx, const void *virt); + /** * Allocate a single page of memory with the given paging structure * @@ -194,6 +201,12 @@ void *kmapaddr(void *phys, void *virt, size_t len, unsigned int flags); */ void *kmapuseraddr(mem_ctx_t ctx, const void *virt, size_t len); +/** + * Gets the physical address for a given vitural address + * @param virt - the vitural address + */ +void *kget_phys(const void *virt); + /** * Unmaps mapped address from the kmapaddr function * @param virt - the vitural address returned from kmapaddr -- cgit v1.2.3-freya