diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-12-02 21:12:11 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-12-02 21:12:11 +0200 |
| commit | 10ae2e6ebc7e9776b9f124c9fc530c79f5e84460 (patch) | |
| tree | 6687cf98db623f8c38c5d5aea234014a27302e10 /include/apos/mem_regions.h | |
| parent | 131af4eec38752a27e6e56579fbf76178e022ec1 (diff) | |
| download | kmi-10ae2e6ebc7e9776b9f124c9fc530c79f5e84460.tar.gz kmi-10ae2e6ebc7e9776b9f124c9fc530c79f5e84460.zip | |
initial shared memory working
Diffstat (limited to 'include/apos/mem_regions.h')
| -rw-r--r-- | include/apos/mem_regions.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/apos/mem_regions.h b/include/apos/mem_regions.h index b94d15a..7231dbd 100644 --- a/include/apos/mem_regions.h +++ b/include/apos/mem_regions.h @@ -85,6 +85,9 @@ struct mem_region { * MR_SHARED, MR_OWNED, MR_COW, MR_KEEP. */ vmflags_t flags; + /** In shared regions, mark the other pid that shared the region. */ + id_t pid; + /** End address of memory region. */ vm_t end; @@ -125,6 +128,21 @@ vm_t alloc_region(struct mem_region_root *r, size_t size, size_t *actual_size, vmflags_t flags); /** + * Allocate memory region and associate it with some other process. + * Will allocate region of at least \c size bytes, with best possible location. + * + * @param r Memory region root. + * @param size Size of region to allocate. + * @param actual_size Size of region that was allocated. + * @param flags Memory flags. + * @param pid Process to associate with region. + * @return Address of allocated region on success, otherwise \c NULL. + */ +stat_t alloc_shared_region(struct mem_region_root *r, size_t size, + size_t *actual_size, + vmflags_t flags, id_t pid); + +/** * Allocate fixed memory region. * Will allocate region that is at least \c size bytes, and includes \c start. * \note The address returned might not be the address requested, and the caller |
