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:
32
src/alloy/backend/assembler.cc
Normal file
32
src/alloy/backend/assembler.cc
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <alloy/backend/assembler.h>
|
||||
|
||||
#include <alloy/backend/tracing.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::runtime;
|
||||
|
||||
|
||||
Assembler::Assembler(Backend* backend) :
|
||||
backend_(backend) {
|
||||
}
|
||||
|
||||
Assembler::~Assembler() {
|
||||
Reset();
|
||||
}
|
||||
|
||||
int Assembler::Initialize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Assembler::Reset() {
|
||||
}
|
||||
55
src/alloy/backend/assembler.h
Normal file
55
src/alloy/backend/assembler.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_ASSEMBLER_H_
|
||||
#define ALLOY_BACKEND_ASSEMBLER_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace hir {
|
||||
class FunctionBuilder;
|
||||
}
|
||||
namespace runtime {
|
||||
class Function;
|
||||
class FunctionInfo;
|
||||
class Runtime;
|
||||
}
|
||||
}
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
|
||||
class Backend;
|
||||
|
||||
|
||||
class Assembler {
|
||||
public:
|
||||
Assembler(Backend* backend);
|
||||
virtual ~Assembler();
|
||||
|
||||
virtual int Initialize();
|
||||
|
||||
virtual void Reset();
|
||||
|
||||
virtual int Assemble(
|
||||
runtime::FunctionInfo* symbol_info, hir::FunctionBuilder* builder,
|
||||
runtime::Function** out_function) = 0;
|
||||
|
||||
protected:
|
||||
Backend* backend_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_ASSEMBLER_H_
|
||||
35
src/alloy/backend/backend.cc
Normal file
35
src/alloy/backend/backend.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <alloy/backend/backend.h>
|
||||
|
||||
#include <alloy/backend/tracing.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::runtime;
|
||||
|
||||
|
||||
Backend::Backend(Runtime* runtime) :
|
||||
runtime_(runtime) {
|
||||
}
|
||||
|
||||
Backend::~Backend() {
|
||||
}
|
||||
|
||||
int Backend::Initialize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* Backend::AllocThreadData() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Backend::FreeThreadData(void* thread_data) {
|
||||
}
|
||||
45
src/alloy/backend/backend.h
Normal file
45
src/alloy/backend/backend.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_BACKEND_H_
|
||||
#define ALLOY_BACKEND_BACKEND_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
|
||||
|
||||
namespace alloy { namespace runtime { class Runtime; } }
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
|
||||
class Assembler;
|
||||
|
||||
|
||||
class Backend {
|
||||
public:
|
||||
Backend(runtime::Runtime* runtime);
|
||||
virtual ~Backend();
|
||||
|
||||
virtual int Initialize();
|
||||
|
||||
virtual void* AllocThreadData();
|
||||
virtual void FreeThreadData(void* thread_data);
|
||||
|
||||
virtual Assembler* CreateAssembler() = 0;
|
||||
|
||||
protected:
|
||||
runtime::Runtime* runtime_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_BACKEND_H_
|
||||
95
src/alloy/backend/ivm/ivm_assembler.cc
Normal file
95
src/alloy/backend/ivm/ivm_assembler.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <alloy/backend/ivm/ivm_assembler.h>
|
||||
|
||||
#include <alloy/backend/tracing.h>
|
||||
#include <alloy/backend/ivm/ivm_intcode.h>
|
||||
#include <alloy/backend/ivm/ivm_function.h>
|
||||
#include <alloy/hir/function_builder.h>
|
||||
#include <alloy/hir/label.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::backend::ivm;
|
||||
using namespace alloy::hir;
|
||||
using namespace alloy::runtime;
|
||||
|
||||
|
||||
IVMAssembler::IVMAssembler(Backend* backend) :
|
||||
Assembler(backend) {
|
||||
}
|
||||
|
||||
IVMAssembler::~IVMAssembler() {
|
||||
alloy::tracing::WriteEvent(EventType::AssemblerDeinit({
|
||||
}));
|
||||
}
|
||||
|
||||
int IVMAssembler::Initialize() {
|
||||
int result = Assembler::Initialize();
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
alloy::tracing::WriteEvent(EventType::AssemblerInit({
|
||||
}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void IVMAssembler::Reset() {
|
||||
intcode_arena_.Reset();
|
||||
scratch_arena_.Reset();
|
||||
Assembler::Reset();
|
||||
}
|
||||
|
||||
int IVMAssembler::Assemble(
|
||||
FunctionInfo* symbol_info, FunctionBuilder* builder,
|
||||
Function** out_function) {
|
||||
IVMFunction* fn = new IVMFunction(symbol_info);
|
||||
|
||||
TranslationContext ctx;
|
||||
ctx.register_count = 0;
|
||||
ctx.intcode_count = 0;
|
||||
ctx.intcode_arena = &intcode_arena_;
|
||||
ctx.scratch_arena = &scratch_arena_;
|
||||
ctx.label_ref_head = NULL;
|
||||
|
||||
// Function prologue.
|
||||
|
||||
Block* block = builder->first_block();
|
||||
while (block) {
|
||||
Label* label = block->label_head;
|
||||
while (label) {
|
||||
label->tag = (void*)(0x80000000 | ctx.intcode_count);
|
||||
label = label->next;
|
||||
}
|
||||
|
||||
Instr* i = block->instr_head;
|
||||
while (i) {
|
||||
int result = TranslateIntCodes(ctx, i);
|
||||
i = i->next;
|
||||
}
|
||||
block = block->next;
|
||||
}
|
||||
|
||||
// Function epilogue.
|
||||
|
||||
// Fixup label references.
|
||||
LabelRef* label_ref = ctx.label_ref_head;
|
||||
while (label_ref) {
|
||||
label_ref->instr->src1_reg = (uint32_t)label_ref->label->tag & ~0x80000000;
|
||||
label_ref = label_ref->next;
|
||||
}
|
||||
|
||||
fn->Setup(ctx);
|
||||
|
||||
*out_function = fn;
|
||||
return 0;
|
||||
}
|
||||
47
src/alloy/backend/ivm/ivm_assembler.h
Normal file
47
src/alloy/backend/ivm/ivm_assembler.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_IVM_IVM_ASSEMBLER_H_
|
||||
#define ALLOY_BACKEND_IVM_IVM_ASSEMBLER_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
|
||||
#include <alloy/backend/assembler.h>
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
namespace ivm {
|
||||
|
||||
|
||||
class IVMAssembler : public Assembler {
|
||||
public:
|
||||
IVMAssembler(Backend* backend);
|
||||
virtual ~IVMAssembler();
|
||||
|
||||
virtual int Initialize();
|
||||
|
||||
virtual void Reset();
|
||||
|
||||
virtual int Assemble(
|
||||
runtime::FunctionInfo* symbol_info, hir::FunctionBuilder* builder,
|
||||
runtime::Function** out_function);
|
||||
|
||||
private:
|
||||
Arena intcode_arena_;
|
||||
Arena scratch_arena_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace ivm
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_IVM_IVM_ASSEMBLER_H_
|
||||
44
src/alloy/backend/ivm/ivm_backend.cc
Normal file
44
src/alloy/backend/ivm/ivm_backend.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <alloy/backend/ivm/ivm_backend.h>
|
||||
|
||||
#include <alloy/backend/tracing.h>
|
||||
#include <alloy/backend/ivm/ivm_assembler.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::backend::ivm;
|
||||
using namespace alloy::runtime;
|
||||
|
||||
|
||||
IVMBackend::IVMBackend(Runtime* runtime) :
|
||||
Backend(runtime) {
|
||||
}
|
||||
|
||||
IVMBackend::~IVMBackend() {
|
||||
alloy::tracing::WriteEvent(EventType::Deinit({
|
||||
}));
|
||||
}
|
||||
|
||||
int IVMBackend::Initialize() {
|
||||
int result = Backend::Initialize();
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
alloy::tracing::WriteEvent(EventType::Init({
|
||||
}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Assembler* IVMBackend::CreateAssembler() {
|
||||
return new IVMAssembler(this);
|
||||
}
|
||||
42
src/alloy/backend/ivm/ivm_backend.h
Normal file
42
src/alloy/backend/ivm/ivm_backend.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_IVM_IVM_BACKEND_H_
|
||||
#define ALLOY_BACKEND_IVM_IVM_BACKEND_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
|
||||
#include <alloy/backend/backend.h>
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
namespace ivm {
|
||||
|
||||
|
||||
#define ALLOY_HAS_IVM_BACKEND 1
|
||||
|
||||
|
||||
class IVMBackend : public Backend {
|
||||
public:
|
||||
IVMBackend(runtime::Runtime* runtime);
|
||||
virtual ~IVMBackend();
|
||||
|
||||
virtual int Initialize();
|
||||
|
||||
virtual Assembler* CreateAssembler();
|
||||
};
|
||||
|
||||
|
||||
} // namespace ivm
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_IVM_IVM_BACKEND_H_
|
||||
66
src/alloy/backend/ivm/ivm_function.cc
Normal file
66
src/alloy/backend/ivm/ivm_function.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <alloy/backend/ivm/ivm_function.h>
|
||||
|
||||
#include <alloy/backend/tracing.h>
|
||||
#include <alloy/runtime/thread_state.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::backend::ivm;
|
||||
using namespace alloy::runtime;
|
||||
|
||||
|
||||
IVMFunction::IVMFunction(FunctionInfo* symbol_info) :
|
||||
register_count_(0), intcode_count_(0), intcodes_(0),
|
||||
GuestFunction(symbol_info) {
|
||||
}
|
||||
|
||||
IVMFunction::~IVMFunction() {
|
||||
xe_free(intcodes_);
|
||||
}
|
||||
|
||||
void IVMFunction::Setup(TranslationContext& ctx) {
|
||||
register_count_ = ctx.register_count;
|
||||
intcode_count_ = ctx.intcode_count;
|
||||
intcodes_ = (IntCode*)ctx.intcode_arena->CloneContents();
|
||||
}
|
||||
|
||||
int IVMFunction::CallImpl(ThreadState* thread_state) {
|
||||
// Setup register file on stack.
|
||||
size_t register_file_size = register_count_ * sizeof(Register);
|
||||
Register* register_file = (Register*)alloca(register_file_size);
|
||||
|
||||
IntCodeState ics;
|
||||
ics.rf = register_file;
|
||||
ics.context = (uint8_t*)thread_state->raw_context();
|
||||
ics.membase = thread_state->memory()->membase();
|
||||
ics.did_carry = 0;
|
||||
ics.thread_state = thread_state;
|
||||
ics.return_address = 0xBEBEBEBE;
|
||||
|
||||
// TODO(benvanik): DID_CARRY -- need HIR to set a OPCODE_FLAG_SET_CARRY
|
||||
// or something so the fns can set an ics flag.
|
||||
|
||||
uint32_t ia = 0;
|
||||
while (true) {
|
||||
const IntCode* i = &intcodes_[ia];
|
||||
uint32_t new_ia = i->intcode_fn(ics, i);
|
||||
if (new_ia == IA_NEXT) {
|
||||
ia++;
|
||||
} else if (new_ia == IA_RETURN) {
|
||||
break;
|
||||
} else {
|
||||
ia = new_ia;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
50
src/alloy/backend/ivm/ivm_function.h
Normal file
50
src/alloy/backend/ivm/ivm_function.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_IVM_IVM_FUNCTION_H_
|
||||
#define ALLOY_BACKEND_IVM_IVM_FUNCTION_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
#include <alloy/backend/ivm/ivm_intcode.h>
|
||||
#include <alloy/runtime/function.h>
|
||||
#include <alloy/runtime/symbol_info.h>
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
namespace ivm {
|
||||
|
||||
|
||||
class IVMFunction : public runtime::GuestFunction {
|
||||
public:
|
||||
IVMFunction(runtime::FunctionInfo* symbol_info);
|
||||
virtual ~IVMFunction();
|
||||
|
||||
void Setup(TranslationContext& ctx);
|
||||
|
||||
protected:
|
||||
virtual int CallImpl(runtime::ThreadState* thread_state);
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
size_t register_count_;
|
||||
Register* constant_regiters_;
|
||||
size_t intcode_count_;
|
||||
IntCode* intcodes_;
|
||||
// ... source_map_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace ivm
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_IVM_IVM_FUNCTION_H_
|
||||
2651
src/alloy/backend/ivm/ivm_intcode.cc
Normal file
2651
src/alloy/backend/ivm/ivm_intcode.cc
Normal file
File diff suppressed because it is too large
Load Diff
104
src/alloy/backend/ivm/ivm_intcode.h
Normal file
104
src/alloy/backend/ivm/ivm_intcode.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_IVM_INTCODE_H_
|
||||
#define ALLOY_BACKEND_IVM_INTCODE_H_
|
||||
|
||||
#include <alloy/core.h>
|
||||
|
||||
#include <alloy/hir/instr.h>
|
||||
#include <alloy/hir/opcodes.h>
|
||||
|
||||
namespace alloy { namespace runtime { class ThreadState; } }
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
namespace ivm {
|
||||
|
||||
|
||||
typedef union {
|
||||
int8_t i8;
|
||||
uint8_t u8;
|
||||
int16_t i16;
|
||||
uint16_t u16;
|
||||
int32_t i32;
|
||||
uint32_t u32;
|
||||
int64_t i64;
|
||||
uint64_t u64;
|
||||
float f32;
|
||||
double f64;
|
||||
vec128_t v128;
|
||||
} Register;
|
||||
|
||||
|
||||
typedef struct {
|
||||
Register* rf;
|
||||
uint8_t* context;
|
||||
uint8_t* membase;
|
||||
int8_t did_carry;
|
||||
runtime::ThreadState* thread_state;
|
||||
uint64_t return_address;
|
||||
} IntCodeState;
|
||||
|
||||
|
||||
struct IntCode_s;
|
||||
typedef uint32_t (*IntCodeFn)(
|
||||
IntCodeState& ics, const struct IntCode_s* i);
|
||||
|
||||
#define IA_RETURN 0xA0000000
|
||||
#define IA_NEXT 0xB0000000
|
||||
|
||||
|
||||
typedef struct IntCode_s {
|
||||
IntCodeFn intcode_fn;
|
||||
uint16_t flags;
|
||||
|
||||
uint32_t dest_reg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t src1_reg;
|
||||
uint32_t src2_reg;
|
||||
uint32_t src3_reg;
|
||||
// <4 bytes available>
|
||||
};
|
||||
struct {
|
||||
Register constant;
|
||||
};
|
||||
};
|
||||
|
||||
// debugging info/etc
|
||||
} IntCode;
|
||||
|
||||
|
||||
typedef struct LabelRef_s {
|
||||
hir::Label* label;
|
||||
IntCode* instr;
|
||||
LabelRef_s* next;
|
||||
} LabelRef;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t register_count;
|
||||
size_t intcode_count;
|
||||
Arena* intcode_arena;
|
||||
Arena* scratch_arena;
|
||||
LabelRef* label_ref_head;
|
||||
} TranslationContext;
|
||||
|
||||
|
||||
int TranslateIntCodes(TranslationContext& ctx, hir::Instr* i);
|
||||
|
||||
|
||||
} // namespace ivm
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_IVM_INTCODE_H_
|
||||
13
src/alloy/backend/ivm/sources.gypi
Normal file
13
src/alloy/backend/ivm/sources.gypi
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'sources': [
|
||||
'ivm_intcode.cc',
|
||||
'ivm_intcode.h',
|
||||
'ivm_assembler.cc',
|
||||
'ivm_assembler.h',
|
||||
'ivm_backend.cc',
|
||||
'ivm_backend.h',
|
||||
'ivm_function.cc',
|
||||
'ivm_function.h',
|
||||
],
|
||||
}
|
||||
15
src/alloy/backend/sources.gypi
Normal file
15
src/alloy/backend/sources.gypi
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'sources': [
|
||||
'assembler.cc',
|
||||
'assembler.h',
|
||||
'backend.cc',
|
||||
'backend.h',
|
||||
'tracing.h',
|
||||
],
|
||||
|
||||
'includes': [
|
||||
'ivm/sources.gypi',
|
||||
'x64/sources.gypi',
|
||||
],
|
||||
}
|
||||
54
src/alloy/backend/tracing.h
Normal file
54
src/alloy/backend/tracing.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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 ALLOY_BACKEND_TRACING_H_
|
||||
#define ALLOY_BACKEND_TRACING_H_
|
||||
|
||||
#include <alloy/tracing/tracing.h>
|
||||
#include <alloy/tracing/event_type.h>
|
||||
|
||||
|
||||
namespace alloy {
|
||||
namespace backend {
|
||||
|
||||
const uint32_t ALLOY_BACKEND = alloy::tracing::EventType::ALLOY_BACKEND;
|
||||
|
||||
|
||||
class EventType {
|
||||
public:
|
||||
enum {
|
||||
ALLOY_BACKEND_INIT = ALLOY_BACKEND | (1),
|
||||
ALLOY_BACKEND_DEINIT = ALLOY_BACKEND | (2),
|
||||
|
||||
ALLOY_BACKEND_ASSEMBLER = ALLOY_BACKEND | (1 << 25),
|
||||
ALLOY_BACKEND_ASSEMBLER_INIT = ALLOY_BACKEND_ASSEMBLER | (1),
|
||||
ALLOY_BACKEND_ASSEMBLER_DEINIT = ALLOY_BACKEND_ASSEMBLER | (2),
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
static const uint32_t event_type = ALLOY_BACKEND_INIT;
|
||||
} Init;
|
||||
typedef struct {
|
||||
static const uint32_t event_type = ALLOY_BACKEND_DEINIT;
|
||||
} Deinit;
|
||||
|
||||
typedef struct {
|
||||
static const uint32_t event_type = ALLOY_BACKEND_ASSEMBLER_INIT;
|
||||
} AssemblerInit;
|
||||
typedef struct {
|
||||
static const uint32_t event_type = ALLOY_BACKEND_ASSEMBLER_DEINIT;
|
||||
} AssemblerDeinit;
|
||||
};
|
||||
|
||||
|
||||
} // namespace backend
|
||||
} // namespace alloy
|
||||
|
||||
|
||||
#endif // ALLOY_BACKEND_TRACING_H_
|
||||
5
src/alloy/backend/x64/sources.gypi
Normal file
5
src/alloy/backend/x64/sources.gypi
Normal file
@@ -0,0 +1,5 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'sources': [
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user