summaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-25 18:42:30 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-25 18:42:30 -0400
commit2cf6fe3f4d0811f1d62ed3ba73d15c8a187f600f (patch)
tree0c7a049c8f6293b27231a409600bc757e928925f /kernel/include
parentadd comment (diff)
downloadcomus-2cf6fe3f4d0811f1d62ed3ba73d15c8a187f600f.tar.gz
comus-2cf6fe3f4d0811f1d62ed3ba73d15c8a187f600f.tar.bz2
comus-2cf6fe3f4d0811f1d62ed3ba73d15c8a187f600f.zip
mem_get_phys fn
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/comus/memory.h13
1 files changed, 13 insertions, 0 deletions
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
@@ -124,6 +124,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
*
* @param ctx - the memory context
@@ -195,6 +202,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
*/