From 1ea7d9dec1b460ab76dfd6270596c8138c9c2b40 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 12 May 2022 15:52:25 +0300 Subject: 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. --- common/dmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/dmem.c') 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; -- cgit v1.3