mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Kernel: Add a simple shared memory API for two processes only.
And use this to implement shared bitmaps between WindowServer and clients.
This commit is contained in:
parent
4db78dabd3
commit
4ea28bf0a5
13 changed files with 240 additions and 48 deletions
|
@ -348,4 +348,22 @@ int read_tsc(unsigned* lsw, unsigned* msw)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int create_shared_buffer(pid_t peer_pid, size_t size, void** buffer)
|
||||
{
|
||||
int rc = syscall(SC_create_shared_buffer, peer_pid, size, buffer);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
void* get_shared_buffer(int shared_buffer_id)
|
||||
{
|
||||
int rc = syscall(SC_get_shared_buffer, shared_buffer_id);
|
||||
__RETURN_WITH_ERRNO(rc, (void*)rc, (void*)-1);
|
||||
}
|
||||
|
||||
int release_shared_buffer(int shared_buffer_id)
|
||||
{
|
||||
int rc = syscall(SC_release_shared_buffer, shared_buffer_id);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue