summaryrefslogtreecommitdiffstats
path: root/hal/shmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'hal/shmem.c')
-rw-r--r--hal/shmem.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hal/shmem.c b/hal/shmem.c
index 3785c2e..2928a1b 100644
--- a/hal/shmem.c
+++ b/hal/shmem.c
@@ -18,3 +18,15 @@ shmem_new(jove_owned_obj_t *untyped_obj)
memset(untyped, 0, untyped->limit);
return 0;
}
+
+inline size_t
+shmem_numpages(jove_owned_obj_t *shmem_obj)
+{
+ return obj_getvalue(shmem_obj) & JOVE_SMHEM_MAXPAGES;
+}
+
+inline void*
+shmem_deref(jove_owned_obj_t *shmem_obj)
+{
+ return phys_tovirt(obj_getvalue(shmem_obj) & ~JOVE_SMHEM_MAXPAGES);
+}