/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2013 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_CPU_PROCESSOR_H_ #define XENIA_CPU_PROCESSOR_H_ #include #include #include #include #include #include #include #include namespace xe { namespace cpu { class JIT; class Processor { public: Processor(xe_memory_ref memory, shared_ptr backend); ~Processor(); xe_memory_ref memory(); shared_ptr export_resolver(); void set_export_resolver(shared_ptr export_resolver); int Setup(); int LoadRawBinary(const xechar_t* path, uint32_t start_address); int LoadXexModule(const char* name, const char* path, xe_xex2_ref xex); uint32_t CreateCallback(void (*callback)(void* data), void* data); ThreadState* AllocThread(uint32_t stack_size, uint32_t thread_state_address); void DeallocThread(ThreadState* thread_state); int Execute(ThreadState* thread_state, uint32_t address); uint64_t Execute(ThreadState* thread_state, uint32_t address, uint64_t arg0); private: FunctionPointer GenerateFunction(uint32_t address); xe_memory_ref memory_; shared_ptr backend_; shared_ptr export_resolver_; FunctionTable* fn_table_; JIT* jit_; std::vector modules_; }; } // namespace cpu } // namespace xe #endif // XENIA_CPU_PROCESSOR_H_