Kernel: Implement basic shared memory objects

These can allocate memory that can be shared between processes using
a global key. There is currenly no safety checks meaning anyone can
map any shared memory object just by trying to map every possible key.
This commit is contained in:
2024-05-29 15:58:46 +03:00
parent 99270e96a9
commit d4d530e6c8
9 changed files with 224 additions and 0 deletions

View File

@@ -16,3 +16,16 @@ int load_keymap(const char* path)
{
return syscall(SYS_LOAD_KEYMAP, path);
}
long smo_create(size_t size, int prot)
{
return syscall(SYS_SMO_CREATE, size, prot);
}
void* smo_map(long key)
{
long ret = syscall(SYS_SMO_MAP, key);
if (ret < 0)
return nullptr;
return reinterpret_cast<void*>(ret);
}