Allocating stacks in the right place.

This commit is contained in:
Ben Vanik
2015-05-17 13:10:02 -07:00
parent 37804d692c
commit b44a7a7730
6 changed files with 39 additions and 14 deletions

View File

@@ -19,15 +19,22 @@ namespace cpu {
class Processor;
enum class ThreadStackType {
kKernelStack,
kUserStack,
};
class ThreadState {
public:
ThreadState(Processor* processor, uint32_t thread_id, uint32_t stack_address,
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() 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_; }
@@ -50,6 +57,7 @@ class ThreadState {
Processor* processor_;
Memory* memory_;
uint32_t thread_id_;
ThreadStackType stack_type_;
std::string name_;
void* backend_data_;
uint32_t stack_address_;