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. --- include/apos/mem.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/apos/mem.h') diff --git a/include/apos/mem.h b/include/apos/mem.h index ece8ee3..bc60f21 100644 --- a/include/apos/mem.h +++ b/include/apos/mem.h @@ -39,6 +39,13 @@ __page((x) + BASE_PAGE_SIZE)) #define __bytes(x) (__addr(x)) +/* if memory region is used or not */ +#define MR_USED (1 << 8) +/* if memory region is shared */ +#define MR_SHARED (1 << 9) +/* owner of shared region */ +#define MR_OWNED (1 << 10) + extern size_t __mm_shifts[10]; extern size_t __mm_widths[10]; extern size_t __mm_sizes[10]; -- cgit v1.3