[kernel] Give processes and threads self handles

It was not consistent how processes got handles to themselves or their
threads, ending up with double entries. Now make such handles automatic
and expose them with new self_handle() methods.
This commit is contained in:
Justin C. Miller
2021-01-06 23:14:39 -08:00
parent 8b3356e9d8
commit e08e00790f
6 changed files with 18 additions and 4 deletions

View File

@@ -141,6 +141,9 @@ public:
/// \arg rip The address to return to, must be user space
void add_thunk_user(uintptr_t rip);
/// Get the handle representing this thread to its process
j6_handle_t self_handle() const { return m_self_handle; }
/// Create the kernel idle thread
/// \arg kernel The process object that owns kernel tasks
/// \arg pri The idle thread priority value
@@ -175,4 +178,6 @@ private:
uint64_t m_wait_data;
j6_status_t m_wait_result;
j6_koid_t m_wait_obj;
j6_handle_t m_self_handle;
};