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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user