Initial Alloy implementation.
This is a regression in functionality and performance, but a much better foundation for the future of the project (I think). It can run basic apps under an SSA interpreter but doesn't support some of the features required to do real 360 apps yet.
This commit is contained in:
@@ -11,71 +11,60 @@
|
||||
#define XENIA_CPU_PROCESSOR_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
#include <alloy/runtime/register_access.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <xenia/cpu/backend.h>
|
||||
#include <xenia/cpu/exec_module.h>
|
||||
#include <xenia/cpu/thread_state.h>
|
||||
#include <xenia/cpu/sdb/symbol_table.h>
|
||||
|
||||
|
||||
XEDECLARECLASS1(xe, Emulator);
|
||||
XEDECLARECLASS1(xe, ExportResolver);
|
||||
XEDECLARECLASS2(xe, cpu, XenonMemory);
|
||||
XEDECLARECLASS2(xe, cpu, XenonRuntime);
|
||||
XEDECLARECLASS2(xe, cpu, XenonThreadState);
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
|
||||
class JIT;
|
||||
using RegisterAccessCallbacks = alloy::runtime::RegisterAccessCallbacks;
|
||||
using RegisterHandlesCallback = alloy::runtime::RegisterHandlesCallback;
|
||||
using RegisterReadCallback = alloy::runtime::RegisterReadCallback;
|
||||
using RegisterWriteCallback = alloy::runtime::RegisterWriteCallback;
|
||||
|
||||
|
||||
class Processor {
|
||||
public:
|
||||
Processor(Emulator* emulator, Backend* backend);
|
||||
Processor(Emulator* emulator);
|
||||
~Processor();
|
||||
|
||||
xe_memory_ref memory() const { return memory_; }
|
||||
ExportResolver* export_resolver() const { return export_resolver_; }
|
||||
XenonRuntime* runtime() const { return runtime_; }
|
||||
Memory* memory() const { return memory_; }
|
||||
|
||||
int Setup();
|
||||
|
||||
void AddRegisterAccessCallbacks(ppc::RegisterAccessCallbacks callbacks);
|
||||
void AddRegisterAccessCallbacks(RegisterAccessCallbacks callbacks);
|
||||
|
||||
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,
|
||||
uint32_t thread_id);
|
||||
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);
|
||||
uint64_t Execute(ThreadState* thread_state, uint32_t address,
|
||||
uint64_t arg0, uint64_t arg1);
|
||||
int Execute(
|
||||
XenonThreadState* thread_state, uint64_t address);
|
||||
uint64_t Execute(
|
||||
XenonThreadState* thread_state, uint64_t address, uint64_t arg0);
|
||||
uint64_t Execute(
|
||||
XenonThreadState* thread_state, uint64_t address, uint64_t arg0,
|
||||
uint64_t arg1);
|
||||
|
||||
uint64_t ExecuteInterrupt(
|
||||
uint32_t cpu, uint32_t address, uint64_t arg0, uint64_t arg1);
|
||||
|
||||
sdb::FunctionSymbol* GetFunction(uint32_t address);
|
||||
void* GetFunctionPointer(uint32_t address);
|
||||
uint32_t cpu, uint64_t address, uint64_t arg0, uint64_t arg1);
|
||||
|
||||
private:
|
||||
Emulator* emulator_;
|
||||
Backend* backend_;
|
||||
xe_memory_ref memory_;
|
||||
ExportResolver* export_resolver_;
|
||||
Emulator* emulator_;
|
||||
ExportResolver* export_resolver_;
|
||||
|
||||
sdb::SymbolTable* sym_table_;
|
||||
JIT* jit_;
|
||||
std::vector<ExecModule*> modules_;
|
||||
xe_mutex_t* sym_lock_;
|
||||
XenonRuntime* runtime_;
|
||||
Memory* memory_;
|
||||
|
||||
xe_mutex_t* interrupt_thread_lock_;
|
||||
ThreadState* interrupt_thread_state_;
|
||||
uint32_t interrupt_thread_block_;
|
||||
xe_mutex_t* interrupt_thread_lock_;
|
||||
XenonThreadState* interrupt_thread_state_;
|
||||
uint64_t interrupt_thread_block_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user