2023-07-03 13:10:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "orbis-config.hpp"
|
|
|
|
|
#include "types.hpp"
|
|
|
|
|
#include "ThreadState.hpp"
|
|
|
|
|
|
2023-07-04 19:06:56 +02:00
|
|
|
#include "../utils/SharedMutex.hpp"
|
2023-07-03 13:10:16 +02:00
|
|
|
|
|
|
|
|
namespace orbis {
|
|
|
|
|
struct Process;
|
|
|
|
|
struct Thread {
|
2023-07-04 19:06:56 +02:00
|
|
|
shared_mutex mtx;
|
2023-07-03 13:10:16 +02:00
|
|
|
Process *tproc = nullptr;
|
|
|
|
|
uint64_t retval[2]{};
|
|
|
|
|
void *context{};
|
|
|
|
|
ptr<void> stackStart;
|
|
|
|
|
ptr<void> stackEnd;
|
|
|
|
|
uint64_t fsBase{};
|
|
|
|
|
uint64_t gsBase{};
|
|
|
|
|
char name[32];
|
|
|
|
|
|
|
|
|
|
uint64_t sigMask[4] = {
|
|
|
|
|
0x7fff'ffff,
|
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
lwpid_t tid = -1;
|
|
|
|
|
ThreadState state = ThreadState::INACTIVE;
|
|
|
|
|
};
|
|
|
|
|
} // namespace orbis
|