[kernel] Add endpoint object and related syscalls

The endpoint object adds synchronous IPC. Also added the wait-type of
'object' to threads.
This commit is contained in:
2020-09-07 01:09:56 -07:00
parent 53d260cc6e
commit 8534d8d3c5
13 changed files with 368 additions and 49 deletions

View File

@@ -56,6 +56,14 @@ thread::wait_on_time(uint64_t t)
clear_state(state::ready);
}
void
thread::wait_on_object(kobject *o)
{
m_wait_type = wait_type::object;
m_wait_data = reinterpret_cast<uint64_t>(o);
clear_state(state::ready);
}
bool
thread::wake_on_signals(kobject *obj, j6_signal_t signals)
{
@@ -86,6 +94,20 @@ thread::wake_on_time(uint64_t now)
return true;
}
bool
thread::wake_on_object(kobject *o)
{
if (m_wait_type != wait_type::object ||
reinterpret_cast<uint64_t>(o) != m_wait_data)
return false;
m_wait_type = wait_type::none;
m_wait_result = j6_status_ok;
m_wait_obj = o->koid();
set_state(state::ready);
return true;
}
void
thread::wake_on_result(kobject *obj, j6_status_t result)
{