66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
/**
|
|
******************************************************************************
|
|
* 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_FRONTEND_PPC_FRONTEND_H_
|
|
#define XENIA_CPU_FRONTEND_PPC_FRONTEND_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "xenia/base/type_pool.h"
|
|
#include "xenia/cpu/frontend/context_info.h"
|
|
#include "xenia/cpu/function.h"
|
|
#include "xenia/memory.h"
|
|
|
|
namespace xe {
|
|
namespace cpu {
|
|
class Processor;
|
|
} // namespace cpu
|
|
} // namespace xe
|
|
|
|
namespace xe {
|
|
namespace cpu {
|
|
namespace frontend {
|
|
|
|
class PPCTranslator;
|
|
|
|
struct PPCBuiltins {
|
|
int32_t global_lock_count;
|
|
Function* check_global_lock;
|
|
Function* enter_global_lock;
|
|
Function* leave_global_lock;
|
|
};
|
|
|
|
class PPCFrontend {
|
|
public:
|
|
explicit PPCFrontend(Processor* processor);
|
|
~PPCFrontend();
|
|
|
|
bool Initialize();
|
|
|
|
Processor* processor() const { return processor_; }
|
|
Memory* memory() const;
|
|
ContextInfo* context_info() const { return context_info_.get(); }
|
|
PPCBuiltins* builtins() { return &builtins_; }
|
|
|
|
bool DeclareFunction(GuestFunction* function);
|
|
bool DefineFunction(GuestFunction* function, uint32_t debug_info_flags);
|
|
|
|
private:
|
|
Processor* processor_;
|
|
std::unique_ptr<ContextInfo> context_info_;
|
|
PPCBuiltins builtins_;
|
|
TypePool<PPCTranslator, PPCFrontend*> translator_pool_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace cpu
|
|
} // namespace xe
|
|
|
|
#endif // XENIA_CPU_FRONTEND_PPC_FRONTEND_H_
|