aboutsummaryrefslogtreecommitdiff
path: root/common/dmem.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-05-12 15:52:25 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-05-12 15:52:25 +0300
commit1ea7d9dec1b460ab76dfd6270596c8138c9c2b40 (patch)
tree0e8799fe0d7a653e864bd90c65a29e4012026f71 /common/dmem.c
parent42a1e087ce99f07b48aaea5552f8e1ce5219d228 (diff)
downloadkmi-1ea7d9dec1b460ab76dfd6270596c8138c9c2b40.tar.gz
kmi-1ea7d9dec1b460ab76dfd6270596c8138c9c2b40.zip
initial workings of shared memory
+ Should document this better but essentially a server requests a shared buffer, and chan then share this buffer to a thread. Freeing the buffer is done through normal means. MR_SHARED is used for buffers that are shared, and MR_OWNED tells whoever is freeing that region that it is allowed to free the physical memory behind the shared buffer.
Diffstat (limited to 'common/dmem.c')
-rw-r--r--common/dmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/dmem.c b/common/dmem.c
index 226b3f9..59ea666 100644
--- a/common/dmem.c
+++ b/common/dmem.c
@@ -53,10 +53,10 @@ vm_t alloc_devmem(struct tcb *t, pm_t dev_start, size_t bytes, vmflags_t flags)
{
vm_t region = 0;
if (dev_start < __pre_top)
- region = alloc_region(&pre_ram, bytes, 0);
+ region = alloc_region(&pre_ram, bytes, 0, flags);
if (dev_start > __post_base)
- region = alloc_region(&post_ram, bytes, 0);
+ region = alloc_region(&post_ram, bytes, 0, flags);
if (!region)
return 0;