Adding kernel state pointer to PPCContext. Still needs larger cleanup.

This commit is contained in:
Ben Vanik 2015-05-31 14:35:56 -07:00
parent d816d80190
commit fccab79a7a
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,9 @@ namespace cpu {
class Processor;
class ThreadState;
} // namespace cpu
namespace kernel {
class KernelState;
} // namespace kernel
} // namespace xe
namespace xe {
@ -209,6 +212,9 @@ typedef struct alignas(64) PPCContext_s {
// current runtime and its data.
Processor* processor;
// Shared kernel state, for easy access from kernel exports.
xe::kernel::KernelState* kernel_state;
uint8_t* physical_membase;
void SetRegFromString(const char* name, const char* value);

View File

@ -205,6 +205,9 @@ X_STATUS XThread::Create() {
thread_state_->thread_id(), thread_state_->stack_limit(),
thread_state_->stack_base());
// Exports use this to get the kernel.
thread_state_->context()->kernel_state = kernel_state_;
uint8_t proc_mask =
static_cast<uint8_t>(creation_params_.creation_flags >> 24);