[orbis-kernel] upload missed changes

This commit is contained in:
DH 2023-07-06 17:23:50 +03:00
parent 7bfa977086
commit 729b7d5e3f
4 changed files with 26 additions and 2 deletions

View file

@ -40,7 +40,7 @@ struct ProcessOps {
SysResult (*dynlib_unload_prx)(Thread *thread, ModuleHandle handle);
SysResult (*thr_create)(Thread *thread, ptr<struct ucontext> ctxt, ptr<slong> arg, sint flags);
SysResult (*thr_new)(Thread *thread, ptr<struct thr_param> param, sint param_size);
SysResult (*thr_new)(Thread *thread, ptr<thr_param> param, sint param_size);
SysResult (*thr_exit)(Thread *thread, ptr<slong> state);
SysResult (*thr_kill)(Thread *thread, slong id, sint sig);
SysResult (*thr_kill2)(Thread *thread, pid_t pid, slong id, sint sig);

View file

@ -26,5 +26,9 @@ struct Thread {
lwpid_t tid = -1;
ThreadState state = ThreadState::INACTIVE;
// FIXME: implement thread destruction
void incRef() {}
void decRef() {}
};
} // namespace orbis

View file

@ -6,4 +6,22 @@ using lwpid_t = int32_t;
using pid_t = int64_t;
using uid_t = uint32_t;
using gid_t = uint32_t;
struct rtprio {
uint16_t type;
uint16_t prio;
};
struct thr_param {
ptr<void(void *)> start_func;
ptr<void> arg;
ptr<char> stack_base;
size_t stack_size;
ptr<char> tls_base;
size_t tls_size;
ptr<slong> child_tid; // Address to store the new thread identifier, for the child's use
ptr<slong> parent_tid; // Address to store the new thread identifier, for the parent's use
sint flags; // Thread creation flags. The flags member may specify the following flags:
ptr<rtprio> rtp; // Real-time scheduling priority for the new thread. May be NULL to inherit the priority from the creating thread
};
} // namespace orbis

View file

@ -52,7 +52,9 @@ public:
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref(OT *ref) : m_ref(ref) {
ref->incRef();
if (m_ref != nullptr) {
ref->incRef();
}
}
template <typename OT>