Real modules and threads (mostly).
Need events/waiting to get proper launch thread behavior.
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include <xenia/cpu/sdb.h>
|
||||
#include <xenia/core/memory.h>
|
||||
#include <xenia/kernel/export.h>
|
||||
#include <xenia/kernel/user_module.h>
|
||||
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <xenia/cpu/sdb.h>
|
||||
#include <xenia/kernel/export.h>
|
||||
#include <xenia/kernel/user_module.h>
|
||||
#include <xenia/kernel/xex2.h>
|
||||
|
||||
|
||||
namespace llvm {
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
shared_ptr<llvm::ExecutionEngine>& engine);
|
||||
~ExecModule();
|
||||
|
||||
int PrepareUserModule(kernel::UserModule* user_module);
|
||||
int PrepareXex(xe_xex2_ref xex);
|
||||
int PrepareRawBinary(uint32_t start_address, uint32_t end_address);
|
||||
|
||||
void AddFunctionsToMap(FunctionMap& map);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <xenia/cpu/exec_module.h>
|
||||
#include <xenia/cpu/thread_state.h>
|
||||
#include <xenia/kernel/export.h>
|
||||
#include <xenia/kernel/user_module.h>
|
||||
#include <xenia/kernel/xex2.h>
|
||||
|
||||
|
||||
namespace llvm {
|
||||
@@ -40,17 +40,18 @@ public:
|
||||
|
||||
int Setup();
|
||||
|
||||
int PrepareModule(const char* module_name, const char* module_path,
|
||||
uint32_t start_address, uint32_t end_address,
|
||||
shared_ptr<kernel::ExportResolver> export_resolver);
|
||||
int PrepareModule(kernel::UserModule* user_module,
|
||||
int LoadBinary(const xechar_t* path, uint32_t start_address,
|
||||
shared_ptr<kernel::ExportResolver> export_resolver);
|
||||
|
||||
int PrepareModule(const char* name, const char* path, xe_xex2_ref xex,
|
||||
shared_ptr<kernel::ExportResolver> export_resolver);
|
||||
|
||||
uint32_t CreateCallback(void (*callback)(void* data), void* data);
|
||||
|
||||
ThreadState* AllocThread(uint32_t stack_address, uint32_t stack_size);
|
||||
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:
|
||||
llvm::Function* GetFunction(uint32_t address);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <xenia/kernel/export.h>
|
||||
#include <xenia/kernel/user_module.h>
|
||||
#include <xenia/kernel/xex2.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
@@ -205,7 +205,7 @@ class XexSymbolDatabase : public SymbolDatabase {
|
||||
public:
|
||||
XexSymbolDatabase(xe_memory_ref memory,
|
||||
kernel::ExportResolver* export_resolver,
|
||||
kernel::UserModule* module);
|
||||
xe_xex2_ref xex);
|
||||
virtual ~XexSymbolDatabase();
|
||||
|
||||
virtual int Analyze();
|
||||
@@ -218,7 +218,7 @@ private:
|
||||
virtual uint32_t GetEntryPoint();
|
||||
virtual bool IsValueInTextRange(uint32_t value);
|
||||
|
||||
kernel::UserModule* module_;
|
||||
xe_xex2_ref xex_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -25,16 +25,19 @@ class Processor;
|
||||
class ThreadState {
|
||||
public:
|
||||
ThreadState(Processor* processor,
|
||||
uint32_t stack_address, uint32_t stack_size);
|
||||
uint32_t stack_size, uint32_t thread_state_address);
|
||||
~ThreadState();
|
||||
|
||||
xe_ppc_state_t* ppc_state();
|
||||
|
||||
private:
|
||||
uint32_t stack_address_;
|
||||
uint32_t stack_size_;
|
||||
uint32_t thread_state_address;
|
||||
xe_memory_ref memory_;
|
||||
|
||||
uint32_t stack_address_;
|
||||
uint32_t thread_state_address_;
|
||||
|
||||
xe_ppc_state_t ppc_state_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user