Cleanup ThreadState and XThread
This commit is contained in:
@@ -21,31 +21,17 @@ namespace cpu {
|
||||
|
||||
class Processor;
|
||||
|
||||
enum class ThreadStackType {
|
||||
kKernelStack,
|
||||
kUserStack,
|
||||
};
|
||||
|
||||
class ThreadState {
|
||||
public:
|
||||
ThreadState(Processor* processor, uint32_t thread_id,
|
||||
ThreadStackType stack_type, uint32_t stack_address,
|
||||
uint32_t stack_size, uint32_t pcr_address);
|
||||
ThreadState(Processor* processor, uint32_t thread_id, uint32_t stack_base = 0,
|
||||
uint32_t pcr_address = 0);
|
||||
~ThreadState();
|
||||
|
||||
Processor* processor() const { return processor_; }
|
||||
Memory* memory() const { return memory_; }
|
||||
uint32_t thread_id() const { return thread_id_; }
|
||||
ThreadStackType stack_type() const { return stack_type_; }
|
||||
const std::string& name() const { return name_; }
|
||||
void set_name(const std::string& value) { name_ = value; }
|
||||
void* backend_data() const { return backend_data_; }
|
||||
uint32_t stack_address() const { return stack_address_; }
|
||||
uint32_t stack_size() const { return stack_size_; }
|
||||
uint32_t stack_base() const { return stack_base_; }
|
||||
uint32_t stack_limit() const { return stack_limit_; }
|
||||
uint32_t pcr_address() const { return pcr_address_; }
|
||||
ppc::PPCContext* context() const { return context_; }
|
||||
uint32_t thread_id() const { return thread_id_; }
|
||||
|
||||
static void Bind(ThreadState* thread_state);
|
||||
static ThreadState* Get();
|
||||
@@ -54,16 +40,10 @@ class ThreadState {
|
||||
private:
|
||||
Processor* processor_;
|
||||
Memory* memory_;
|
||||
uint32_t thread_id_;
|
||||
ThreadStackType stack_type_;
|
||||
std::string name_;
|
||||
void* backend_data_;
|
||||
uint32_t stack_address_;
|
||||
bool stack_allocated_;
|
||||
uint32_t stack_size_;
|
||||
uint32_t stack_base_;
|
||||
uint32_t stack_limit_;
|
||||
uint32_t pcr_address_;
|
||||
|
||||
uint32_t pcr_address_ = 0;
|
||||
uint32_t thread_id_ = 0;
|
||||
|
||||
// NOTE: must be 64b aligned for SSE ops.
|
||||
ppc::PPCContext* context_;
|
||||
|
||||
Reference in New Issue
Block a user