2013-01-21 20:55:42 +01:00
|
|
|
/**
|
|
|
|
|
******************************************************************************
|
|
|
|
|
* 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. *
|
|
|
|
|
******************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
#ifndef ALLOY_BACKEND_BACKEND_H_
|
|
|
|
|
#define ALLOY_BACKEND_BACKEND_H_
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2014-07-14 07:28:00 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
2015-02-01 07:49:47 +01:00
|
|
|
#include "alloy/backend/machine_info.h"
|
2013-04-21 21:34:20 +02:00
|
|
|
|
2014-07-11 05:20:00 +02:00
|
|
|
namespace alloy {
|
|
|
|
|
namespace runtime {
|
|
|
|
|
class Runtime;
|
|
|
|
|
} // namespace runtime
|
|
|
|
|
} // namespace alloy
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
namespace alloy {
|
|
|
|
|
namespace backend {
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
class Assembler;
|
2013-05-22 00:36:58 +02:00
|
|
|
|
2013-04-21 21:34:20 +02:00
|
|
|
class Backend {
|
2014-07-11 05:20:00 +02:00
|
|
|
public:
|
2013-12-07 07:57:16 +01:00
|
|
|
Backend(runtime::Runtime* runtime);
|
|
|
|
|
virtual ~Backend();
|
|
|
|
|
|
2013-12-07 22:09:22 +01:00
|
|
|
runtime::Runtime* runtime() const { return runtime_; }
|
2014-02-09 07:00:21 +01:00
|
|
|
const MachineInfo* machine_info() const { return &machine_info_; }
|
2013-12-07 22:09:22 +01:00
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
virtual int Initialize();
|
|
|
|
|
|
|
|
|
|
virtual void* AllocThreadData();
|
|
|
|
|
virtual void FreeThreadData(void* thread_data);
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2014-07-14 07:28:00 +02:00
|
|
|
virtual std::unique_ptr<Assembler> CreateAssembler() = 0;
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2014-07-11 05:20:00 +02:00
|
|
|
protected:
|
2013-12-07 07:57:16 +01:00
|
|
|
runtime::Runtime* runtime_;
|
2014-02-09 07:00:21 +01:00
|
|
|
MachineInfo machine_info_;
|
2013-04-21 21:34:20 +02:00
|
|
|
};
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
} // namespace backend
|
|
|
|
|
} // namespace alloy
|
2013-01-21 20:55:42 +01:00
|
|
|
|
2013-12-07 07:57:16 +01:00
|
|
|
#endif // ALLOY_BACKEND_BACKEND_H_
|