From 88431eadce4087ec317d22831ccb7d0b77c5d45c Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 6 Feb 2013 02:19:50 -0800 Subject: [PATCH] Screw convention; moving include files alongside source files. They now will show up in xcode/etc. --- {include => src}/xenia/assert.h | 0 {include => src}/xenia/atomic.h | 0 {include => src}/xenia/byte_order.h | 0 {include => src}/xenia/common.h | 0 {include => src}/xenia/config.h | 0 {include => src}/xenia/core.h | 0 src/{ => xenia}/core/file.cc | 0 {include => src}/xenia/core/file.h | 0 src/{ => xenia}/core/memory.cc | 0 {include => src}/xenia/core/memory.h | 0 {include => src}/xenia/core/mmap.h | 0 src/{ => xenia}/core/mmap_posix.cc | 0 src/{ => xenia}/core/mmap_win.cc | 0 {include => src}/xenia/core/mutex.h | 0 src/{ => xenia}/core/mutex_posix.cc | 0 src/{ => xenia}/core/mutex_win.cc | 0 src/{ => xenia}/core/pal.cc | 0 {include => src}/xenia/core/pal.h | 0 src/{ => xenia}/core/ref.cc | 0 {include => src}/xenia/core/ref.h | 0 src/{ => xenia}/core/sources.gypi | 6 ++ src/{ => xenia}/cpu/codegen/emit.h | 0 src/{ => xenia}/cpu/codegen/emit_alu.cc | 91 +++++++++++++++++- src/{ => xenia}/cpu/codegen/emit_control.cc | 2 +- src/{ => xenia}/cpu/codegen/emit_fpu.cc | 23 ++++- src/{ => xenia}/cpu/codegen/emit_memory.cc | 2 +- .../cpu/codegen/function_generator.cc | 3 +- .../xenia/cpu/codegen/function_generator.h | 0 .../cpu/codegen/module_generator.cc | 3 +- .../xenia/cpu/codegen/module_generator.h | 0 src/{ => xenia}/cpu/codegen/sources.gypi | 3 + src/{ => xenia}/cpu/cpu-private.h | 0 src/{ => xenia}/cpu/cpu.cc | 2 +- {include/xenia => src/xenia/cpu}/cpu.h | 6 +- src/{ => xenia}/cpu/exec_module.cc | 11 +-- {include => src}/xenia/cpu/exec_module.h | 0 src/{ => xenia}/cpu/llvm_exports.cc | 2 +- src/{ => xenia}/cpu/llvm_exports.h | 0 {include => src}/xenia/cpu/ppc.h | 0 src/{ => xenia}/cpu/ppc/instr.cc | 2 +- {include => src}/xenia/cpu/ppc/instr.h | 0 src/{ => xenia}/cpu/ppc/instr_tables.h | 0 src/{ => xenia}/cpu/ppc/sources.gypi | 3 + src/{ => xenia}/cpu/ppc/state.cc | 0 {include => src}/xenia/cpu/ppc/state.h | 0 src/{ => xenia}/cpu/processor.cc | 2 +- {include => src}/xenia/cpu/processor.h | 0 {include => src}/xenia/cpu/sdb.h | 0 .../cpu/sdb/raw_symbol_database.cc | 0 .../xenia/cpu/sdb/raw_symbol_database.h | 0 src/{ => xenia}/cpu/sdb/sources.gypi | 4 + src/{ => xenia}/cpu/sdb/symbol.cc | 0 {include => src}/xenia/cpu/sdb/symbol.h | 0 src/{ => xenia}/cpu/sdb/symbol_database.cc | 0 .../xenia/cpu/sdb/symbol_database.h | 0 .../cpu/sdb/xex_symbol_database.cc | 0 .../xenia/cpu/sdb/xex_symbol_database.h | 0 src/{ => xenia}/cpu/sources.gypi | 7 ++ src/{ => xenia}/cpu/thread_state.cc | 0 {include => src}/xenia/cpu/thread_state.h | 0 src/{ => xenia}/cpu/xethunk/xethunk.bc | Bin src/{ => xenia}/cpu/xethunk/xethunk.c | 0 src/{ => xenia}/cpu/xethunk/xethunk.h | 0 src/{ => xenia}/cpu/xethunk/xethunk.ll | 0 src/{ => xenia}/dbg/client.cc | 0 {include => src}/xenia/dbg/client.h | 0 src/{ => xenia}/dbg/content_source.cc | 0 {include => src}/xenia/dbg/content_source.h | 0 src/{ => xenia}/dbg/debugger.cc | 3 +- {include => src}/xenia/dbg/debugger.h | 0 src/{ => xenia}/dbg/listener.cc | 2 +- src/{ => xenia}/dbg/listener.h | 0 src/{ => xenia}/dbg/sources.gypi | 6 ++ src/{ => xenia}/dbg/ws_client.cc | 2 +- src/{ => xenia}/dbg/ws_client.h | 0 src/{ => xenia}/dbg/ws_listener.cc | 4 +- src/{ => xenia}/dbg/ws_listener.h | 2 +- src/{ => xenia}/gpu/gpu.cc | 2 +- {include/xenia => src/xenia/gpu}/gpu.h | 6 +- src/{ => xenia}/gpu/sources.gypi | 1 + src/{ => xenia}/kernel/export.cc | 0 {include => src}/xenia/kernel/export.h | 0 src/{ => xenia}/kernel/fs/device.cc | 0 {include => src}/xenia/kernel/fs/device.h | 0 .../kernel/fs/devices/disc_image_device.cc | 5 +- .../kernel/fs/devices/disc_image_device.h | 0 .../fs/devices/local_directory_device.cc | 2 +- .../fs/devices/local_directory_device.h | 0 .../kernel/fs/devices/sources.gypi | 2 + src/{ => xenia}/kernel/fs/entry.cc | 0 {include => src}/xenia/kernel/fs/entry.h | 0 src/{ => xenia}/kernel/fs/filesystem.cc | 4 +- {include => src}/xenia/kernel/fs/filesystem.h | 0 src/{ => xenia}/kernel/fs/gdfx.cc | 12 ++- src/{ => xenia}/kernel/fs/gdfx.h | 2 +- src/{ => xenia}/kernel/fs/sources.gypi | 4 + {include/xenia => src/xenia/kernel}/kernel.h | 6 +- {include => src}/xenia/kernel/kernel_module.h | 0 src/{ => xenia}/kernel/modules/modules.h | 4 +- src/{ => xenia}/kernel/modules/sources.gypi | 4 + .../kernel/modules/xam/sources.gypi | 0 .../kernel/modules/xam/xam_info.cc | 7 +- src/{ => xenia}/kernel/modules/xam/xam_info.h | 2 +- .../kernel/modules/xam/xam_module.cc | 7 +- .../kernel/modules/xam/xam_module.h | 0 .../kernel/modules/xam/xam_state.cc | 2 +- .../kernel/modules/xam/xam_state.h | 0 .../kernel/modules/xam/xam_table.h | 0 .../kernel/modules/xboxkrnl/kernel_state.cc | 8 +- .../kernel/modules/xboxkrnl/kernel_state.h | 0 .../kernel/modules/xboxkrnl/module.cc | 19 ++-- .../kernel/modules/xboxkrnl/module.h | 0 .../modules/xboxkrnl/objects/sources.gypi | 2 + .../modules/xboxkrnl/objects/xmodule.cc | 4 +- .../kernel/modules/xboxkrnl/objects/xmodule.h | 2 +- .../modules/xboxkrnl/objects/xthread.cc | 2 +- .../kernel/modules/xboxkrnl/objects/xthread.h | 2 +- .../kernel/modules/xboxkrnl/sources.gypi | 9 ++ .../kernel/modules/xboxkrnl/xboxkrnl_hal.cc | 5 +- .../kernel/modules/xboxkrnl/xboxkrnl_hal.h | 2 +- .../modules/xboxkrnl/xboxkrnl_memory.cc | 5 +- .../kernel/modules/xboxkrnl/xboxkrnl_memory.h | 2 +- .../modules/xboxkrnl/xboxkrnl_module.cc | 7 +- .../kernel/modules/xboxkrnl/xboxkrnl_module.h | 2 +- .../kernel/modules/xboxkrnl/xboxkrnl_rtl.cc | 7 +- .../kernel/modules/xboxkrnl/xboxkrnl_rtl.h | 2 +- .../kernel/modules/xboxkrnl/xboxkrnl_table.h | 0 .../modules/xboxkrnl/xboxkrnl_threading.cc | 7 +- .../modules/xboxkrnl/xboxkrnl_threading.h | 2 +- .../kernel/modules/xboxkrnl/xobject.cc | 2 +- .../kernel/modules/xboxkrnl/xobject.h | 2 +- src/{ => xenia}/kernel/runtime.cc | 2 +- {include => src}/xenia/kernel/runtime.h | 2 +- src/{ => xenia}/kernel/shim_utils.h | 0 src/{ => xenia}/kernel/sources.gypi | 8 ++ {include => src}/xenia/kernel/xbox.h | 0 src/{ => xenia}/kernel/xex2.cc | 0 {include => src}/xenia/kernel/xex2.h | 0 {include => src}/xenia/kernel/xex2_info.h | 0 {include => src}/xenia/logging.h | 0 {include => src}/xenia/malloc.h | 0 {include => src}/xenia/platform.h | 0 {include => src}/xenia/platform_includes.h | 0 src/xenia/sources.gypi | 21 ++++ {include => src}/xenia/string.h | 0 {include => src}/xenia/types.h | 0 {include => src}/xenia/xenia.h | 6 +- tools/xenia-run/xenia-run.gypi | 5 +- tools/xenia-test/xenia-test.gypi | 5 +- xenia-build.py | 2 +- xenia.gyp | 83 +--------------- 151 files changed, 290 insertions(+), 200 deletions(-) rename {include => src}/xenia/assert.h (100%) rename {include => src}/xenia/atomic.h (100%) rename {include => src}/xenia/byte_order.h (100%) rename {include => src}/xenia/common.h (100%) rename {include => src}/xenia/config.h (100%) rename {include => src}/xenia/core.h (100%) rename src/{ => xenia}/core/file.cc (100%) rename {include => src}/xenia/core/file.h (100%) rename src/{ => xenia}/core/memory.cc (100%) rename {include => src}/xenia/core/memory.h (100%) rename {include => src}/xenia/core/mmap.h (100%) rename src/{ => xenia}/core/mmap_posix.cc (100%) rename src/{ => xenia}/core/mmap_win.cc (100%) rename {include => src}/xenia/core/mutex.h (100%) rename src/{ => xenia}/core/mutex_posix.cc (100%) rename src/{ => xenia}/core/mutex_win.cc (100%) rename src/{ => xenia}/core/pal.cc (100%) rename {include => src}/xenia/core/pal.h (100%) rename src/{ => xenia}/core/ref.cc (100%) rename {include => src}/xenia/core/ref.h (100%) rename src/{ => xenia}/core/sources.gypi (82%) rename src/{ => xenia}/cpu/codegen/emit.h (100%) rename src/{ => xenia}/cpu/codegen/emit_alu.cc (95%) rename src/{ => xenia}/cpu/codegen/emit_control.cc (99%) rename src/{ => xenia}/cpu/codegen/emit_fpu.cc (91%) rename src/{ => xenia}/cpu/codegen/emit_memory.cc (99%) rename src/{ => xenia}/cpu/codegen/function_generator.cc (99%) rename {include => src}/xenia/cpu/codegen/function_generator.h (100%) rename src/{ => xenia}/cpu/codegen/module_generator.cc (99%) rename {include => src}/xenia/cpu/codegen/module_generator.h (100%) rename src/{ => xenia}/cpu/codegen/sources.gypi (75%) rename src/{ => xenia}/cpu/cpu-private.h (100%) rename src/{ => xenia}/cpu/cpu.cc (97%) rename {include/xenia => src/xenia/cpu}/cpu.h (87%) rename src/{ => xenia}/cpu/exec_module.cc (98%) rename {include => src}/xenia/cpu/exec_module.h (100%) rename src/{ => xenia}/cpu/llvm_exports.cc (99%) rename src/{ => xenia}/cpu/llvm_exports.h (100%) rename {include => src}/xenia/cpu/ppc.h (100%) rename src/{ => xenia}/cpu/ppc/instr.cc (99%) rename {include => src}/xenia/cpu/ppc/instr.h (100%) rename src/{ => xenia}/cpu/ppc/instr_tables.h (100%) rename src/{ => xenia}/cpu/ppc/sources.gypi (66%) rename src/{ => xenia}/cpu/ppc/state.cc (100%) rename {include => src}/xenia/cpu/ppc/state.h (100%) rename src/{ => xenia}/cpu/processor.cc (99%) rename {include => src}/xenia/cpu/processor.h (100%) rename {include => src}/xenia/cpu/sdb.h (100%) rename src/{ => xenia}/cpu/sdb/raw_symbol_database.cc (100%) rename {include => src}/xenia/cpu/sdb/raw_symbol_database.h (100%) rename src/{ => xenia}/cpu/sdb/sources.gypi (63%) rename src/{ => xenia}/cpu/sdb/symbol.cc (100%) rename {include => src}/xenia/cpu/sdb/symbol.h (100%) rename src/{ => xenia}/cpu/sdb/symbol_database.cc (100%) rename {include => src}/xenia/cpu/sdb/symbol_database.h (100%) rename src/{ => xenia}/cpu/sdb/xex_symbol_database.cc (100%) rename {include => src}/xenia/cpu/sdb/xex_symbol_database.h (100%) rename src/{ => xenia}/cpu/sources.gypi (67%) rename src/{ => xenia}/cpu/thread_state.cc (100%) rename {include => src}/xenia/cpu/thread_state.h (100%) rename src/{ => xenia}/cpu/xethunk/xethunk.bc (100%) rename src/{ => xenia}/cpu/xethunk/xethunk.c (100%) rename src/{ => xenia}/cpu/xethunk/xethunk.h (100%) rename src/{ => xenia}/cpu/xethunk/xethunk.ll (100%) rename src/{ => xenia}/dbg/client.cc (100%) rename {include => src}/xenia/dbg/client.h (100%) rename src/{ => xenia}/dbg/content_source.cc (100%) rename {include => src}/xenia/dbg/content_source.h (100%) rename src/{ => xenia}/dbg/debugger.cc (98%) rename {include => src}/xenia/dbg/debugger.h (100%) rename src/{ => xenia}/dbg/listener.cc (95%) rename src/{ => xenia}/dbg/listener.h (100%) rename src/{ => xenia}/dbg/sources.gypi (62%) rename src/{ => xenia}/dbg/ws_client.cc (99%) rename src/{ => xenia}/dbg/ws_client.h (100%) rename src/{ => xenia}/dbg/ws_listener.cc (97%) rename src/{ => xenia}/dbg/ws_listener.h (96%) rename src/{ => xenia}/gpu/gpu.cc (95%) rename {include/xenia => src/xenia/gpu}/gpu.h (87%) rename src/{ => xenia}/gpu/sources.gypi (87%) rename src/{ => xenia}/kernel/export.cc (100%) rename {include => src}/xenia/kernel/export.h (100%) rename src/{ => xenia}/kernel/fs/device.cc (100%) rename {include => src}/xenia/kernel/fs/device.h (100%) rename src/{ => xenia}/kernel/fs/devices/disc_image_device.cc (97%) rename src/{ => xenia}/kernel/fs/devices/disc_image_device.h (100%) rename src/{ => xenia}/kernel/fs/devices/local_directory_device.cc (98%) rename src/{ => xenia}/kernel/fs/devices/local_directory_device.h (100%) rename src/{ => xenia}/kernel/fs/devices/sources.gypi (69%) rename src/{ => xenia}/kernel/fs/entry.cc (100%) rename {include => src}/xenia/kernel/fs/entry.h (100%) rename src/{ => xenia}/kernel/fs/filesystem.cc (96%) rename {include => src}/xenia/kernel/fs/filesystem.h (100%) rename src/{ => xenia}/kernel/fs/gdfx.cc (97%) rename src/{ => xenia}/kernel/fs/gdfx.h (99%) rename src/{ => xenia}/kernel/fs/sources.gypi (74%) rename {include/xenia => src/xenia/kernel}/kernel.h (84%) rename {include => src}/xenia/kernel/kernel_module.h (100%) rename src/{ => xenia}/kernel/modules/modules.h (85%) rename src/{ => xenia}/kernel/modules/sources.gypi (76%) rename src/{ => xenia}/kernel/modules/xam/sources.gypi (100%) rename src/{ => xenia}/kernel/modules/xam/xam_info.cc (94%) rename src/{ => xenia}/kernel/modules/xam/xam_info.h (94%) rename src/{ => xenia}/kernel/modules/xam/xam_module.cc (87%) rename src/{ => xenia}/kernel/modules/xam/xam_module.h (100%) rename src/{ => xenia}/kernel/modules/xam/xam_state.cc (94%) rename src/{ => xenia}/kernel/modules/xam/xam_state.h (100%) rename src/{ => xenia}/kernel/modules/xam/xam_table.h (100%) rename src/{ => xenia}/kernel/modules/xboxkrnl/kernel_state.cc (95%) rename src/{ => xenia}/kernel/modules/xboxkrnl/kernel_state.h (100%) rename src/{ => xenia}/kernel/modules/xboxkrnl/module.cc (89%) rename src/{ => xenia}/kernel/modules/xboxkrnl/module.h (100%) rename src/{ => xenia}/kernel/modules/xboxkrnl/objects/sources.gypi (76%) rename src/{ => xenia}/kernel/modules/xboxkrnl/objects/xmodule.cc (98%) rename src/{ => xenia}/kernel/modules/xboxkrnl/objects/xmodule.h (96%) rename src/{ => xenia}/kernel/modules/xboxkrnl/objects/xthread.cc (99%) rename src/{ => xenia}/kernel/modules/xboxkrnl/objects/xthread.h (97%) rename src/{ => xenia}/kernel/modules/xboxkrnl/sources.gypi (60%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_hal.cc (94%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_hal.h (93%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_memory.cc (98%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_memory.h (93%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_module.cc (95%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_module.h (93%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc (99%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_rtl.h (93%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_table.h (100%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_threading.cc (97%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xboxkrnl_threading.h (94%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xobject.cc (96%) rename src/{ => xenia}/kernel/modules/xboxkrnl/xobject.h (95%) rename src/{ => xenia}/kernel/runtime.cc (98%) rename {include => src}/xenia/kernel/runtime.h (98%) rename src/{ => xenia}/kernel/shim_utils.h (100%) rename src/{ => xenia}/kernel/sources.gypi (58%) rename {include => src}/xenia/kernel/xbox.h (100%) rename src/{ => xenia}/kernel/xex2.cc (100%) rename {include => src}/xenia/kernel/xex2.h (100%) rename {include => src}/xenia/kernel/xex2_info.h (100%) rename {include => src}/xenia/logging.h (100%) rename {include => src}/xenia/malloc.h (100%) rename {include => src}/xenia/platform.h (100%) rename {include => src}/xenia/platform_includes.h (100%) rename {include => src}/xenia/string.h (100%) rename {include => src}/xenia/types.h (100%) rename {include => src}/xenia/xenia.h (87%) diff --git a/include/xenia/assert.h b/src/xenia/assert.h similarity index 100% rename from include/xenia/assert.h rename to src/xenia/assert.h diff --git a/include/xenia/atomic.h b/src/xenia/atomic.h similarity index 100% rename from include/xenia/atomic.h rename to src/xenia/atomic.h diff --git a/include/xenia/byte_order.h b/src/xenia/byte_order.h similarity index 100% rename from include/xenia/byte_order.h rename to src/xenia/byte_order.h diff --git a/include/xenia/common.h b/src/xenia/common.h similarity index 100% rename from include/xenia/common.h rename to src/xenia/common.h diff --git a/include/xenia/config.h b/src/xenia/config.h similarity index 100% rename from include/xenia/config.h rename to src/xenia/config.h diff --git a/include/xenia/core.h b/src/xenia/core.h similarity index 100% rename from include/xenia/core.h rename to src/xenia/core.h diff --git a/src/core/file.cc b/src/xenia/core/file.cc similarity index 100% rename from src/core/file.cc rename to src/xenia/core/file.cc diff --git a/include/xenia/core/file.h b/src/xenia/core/file.h similarity index 100% rename from include/xenia/core/file.h rename to src/xenia/core/file.h diff --git a/src/core/memory.cc b/src/xenia/core/memory.cc similarity index 100% rename from src/core/memory.cc rename to src/xenia/core/memory.cc diff --git a/include/xenia/core/memory.h b/src/xenia/core/memory.h similarity index 100% rename from include/xenia/core/memory.h rename to src/xenia/core/memory.h diff --git a/include/xenia/core/mmap.h b/src/xenia/core/mmap.h similarity index 100% rename from include/xenia/core/mmap.h rename to src/xenia/core/mmap.h diff --git a/src/core/mmap_posix.cc b/src/xenia/core/mmap_posix.cc similarity index 100% rename from src/core/mmap_posix.cc rename to src/xenia/core/mmap_posix.cc diff --git a/src/core/mmap_win.cc b/src/xenia/core/mmap_win.cc similarity index 100% rename from src/core/mmap_win.cc rename to src/xenia/core/mmap_win.cc diff --git a/include/xenia/core/mutex.h b/src/xenia/core/mutex.h similarity index 100% rename from include/xenia/core/mutex.h rename to src/xenia/core/mutex.h diff --git a/src/core/mutex_posix.cc b/src/xenia/core/mutex_posix.cc similarity index 100% rename from src/core/mutex_posix.cc rename to src/xenia/core/mutex_posix.cc diff --git a/src/core/mutex_win.cc b/src/xenia/core/mutex_win.cc similarity index 100% rename from src/core/mutex_win.cc rename to src/xenia/core/mutex_win.cc diff --git a/src/core/pal.cc b/src/xenia/core/pal.cc similarity index 100% rename from src/core/pal.cc rename to src/xenia/core/pal.cc diff --git a/include/xenia/core/pal.h b/src/xenia/core/pal.h similarity index 100% rename from include/xenia/core/pal.h rename to src/xenia/core/pal.h diff --git a/src/core/ref.cc b/src/xenia/core/ref.cc similarity index 100% rename from src/core/ref.cc rename to src/xenia/core/ref.cc diff --git a/include/xenia/core/ref.h b/src/xenia/core/ref.h similarity index 100% rename from include/xenia/core/ref.h rename to src/xenia/core/ref.h diff --git a/src/core/sources.gypi b/src/xenia/core/sources.gypi similarity index 82% rename from src/core/sources.gypi rename to src/xenia/core/sources.gypi index 6f7ece69d..23e8340ad 100644 --- a/src/core/sources.gypi +++ b/src/xenia/core/sources.gypi @@ -2,9 +2,15 @@ { 'sources': [ 'file.cc', + 'file.h', 'memory.cc', + 'memory.h', + 'mmap.h', + 'mutex.h', 'pal.cc', + 'pal.h', 'ref.cc', + 'ref.h', ], 'conditions': [ diff --git a/src/cpu/codegen/emit.h b/src/xenia/cpu/codegen/emit.h similarity index 100% rename from src/cpu/codegen/emit.h rename to src/xenia/cpu/codegen/emit.h diff --git a/src/cpu/codegen/emit_alu.cc b/src/xenia/cpu/codegen/emit_alu.cc similarity index 95% rename from src/cpu/codegen/emit_alu.cc rename to src/xenia/cpu/codegen/emit_alu.cc index a23ecccc2..1860f506d 100644 --- a/src/cpu/codegen/emit_alu.cc +++ b/src/xenia/cpu/codegen/emit_alu.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/codegen/emit.h" +#include #include @@ -263,8 +263,56 @@ XEDISASMR(divwx, 0x7C0003D6, XO )(InstrData& i, InstrDisasm& d) { return d.Finish(); } XEEMITTER(divwx, 0x7C0003D6, XO )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; + // dividend[0:31] <- (RA)[32:63] + // divisor[0:31] <- (RB)[32:63] + // if divisor = 0 then + // if OE = 1 then + // XER[OV] <- 1 + // return + // RT[32:63] <- dividend ÷ divisor + // RT[0:31] <- undefined + + Value* dividend = b.CreateTrunc(g.gpr_value(i.XO.RA), b.getInt32Ty()); + Value* divisor = b.CreateTrunc(g.gpr_value(i.XO.RB), b.getInt32Ty()); + + // Note that we skip the zero handling block and just avoid the divide if + // we are OE=0. + BasicBlock* zero_bb = i.XO.OE ? + BasicBlock::Create(*g.context(), "", g.gen_fn()) : NULL; + BasicBlock* nonzero_bb = BasicBlock::Create(*g.context(), "", g.gen_fn()); + BasicBlock* after_bb = BasicBlock::Create(*g.context(), "", g.gen_fn()); + b.CreateCondBr(b.CreateICmpEQ(divisor, b.getInt32(0)), + i.XO.OE ? zero_bb : after_bb, nonzero_bb); + + if (zero_bb) { + // Divisor was zero - do XER update. + b.SetInsertPoint(zero_bb); + g.update_xer_with_overflow(b.getInt1(1)); + b.CreateBr(after_bb); + } + + // Divide. + b.SetInsertPoint(nonzero_bb); + Value* v = b.CreateSDiv(dividend, divisor); + v = b.CreateSExt(v, b.getInt64Ty()); + g.update_gpr_value(i.XO.RT, v); + + // If we are OE=1 we need to clear the overflow bit. + if (i.XO.OE) { + g.update_xer_with_overflow(b.getInt1(0)); + } + + if (i.XO.Rc) { + // With cr0 update. + g.update_cr_with_cond(0, v, b.getInt64(0), true); + } + + b.CreateBr(after_bb); + + // Resume. + b.SetInsertPoint(after_bb); + + return 0; } XEDISASMR(divwux, 0x7C000396, XO )(InstrData& i, InstrDisasm& d) { @@ -449,8 +497,41 @@ XEDISASMR(negx, 0x7C0000D0, XO )(InstrData& i, InstrDisasm& d) { return d.Finish(); } XEEMITTER(negx, 0x7C0000D0, XO )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; + // RT <- ¬(RA) + 1 + + if (i.XO.OE) { + // With XER update. + // This is a different codepath as we need to use llvm.ssub.with.overflow. + + // if RA == 0x8000000000000000 then no-op and set OV=1 + // This may just magically do that... + + Function* ssub_with_overflow = Intrinsic::getDeclaration( + g.gen_module(), Intrinsic::ssub_with_overflow, b.getInt64Ty()); + Value* v = b.CreateCall2(ssub_with_overflow, + b.getInt64(0), g.gpr_value(i.XO.RA)); + Value* v0 = b.CreateExtractValue(v, 0); + g.update_gpr_value(i.XO.RT, v0); + g.update_xer_with_overflow(b.CreateExtractValue(v, 1)); + + if (i.XO.Rc) { + // With cr0 update. + g.update_cr_with_cond(0, v0, b.getInt64(0), true); + } + + return 0; + } else { + // No OE bit setting. + Value* v = b.CreateSub(b.getInt64(0), g.gpr_value(i.XO.RA)); + g.update_gpr_value(i.XO.RT, v); + + if (i.XO.Rc) { + // With cr0 update. + g.update_cr_with_cond(0, v, b.getInt64(0), true); + } + + return 0; + } } XEDISASMR(subfx, 0x7C000050, XO )(InstrData& i, InstrDisasm& d) { diff --git a/src/cpu/codegen/emit_control.cc b/src/xenia/cpu/codegen/emit_control.cc similarity index 99% rename from src/cpu/codegen/emit_control.cc rename to src/xenia/cpu/codegen/emit_control.cc index 2a58e28c8..c3ab7984f 100644 --- a/src/cpu/codegen/emit_control.cc +++ b/src/xenia/cpu/codegen/emit_control.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/codegen/emit.h" +#include #include #include diff --git a/src/cpu/codegen/emit_fpu.cc b/src/xenia/cpu/codegen/emit_fpu.cc similarity index 91% rename from src/cpu/codegen/emit_fpu.cc rename to src/xenia/cpu/codegen/emit_fpu.cc index ef977011c..cef4e1437 100644 --- a/src/cpu/codegen/emit_fpu.cc +++ b/src/xenia/cpu/codegen/emit_fpu.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/codegen/emit.h" +#include #include @@ -173,7 +173,28 @@ XEEMITTER(fcmpo, 0xFC000040, X )(FunctionGenerator& g, IRBuilder<>& b, I return 1; } +XEDISASMR(fcmpu, 0xFC000000, X )(InstrData& i, InstrDisasm& d) { + d.Init("fcmpu", "Floating Compare Unordered", + (i.XO.OE ? InstrDisasm::kOE : 0) | (i.XO.Rc ? InstrDisasm::kRc : 0)); + d.AddRegOperand(InstrRegister::kGPR, i.XO.RT, InstrRegister::kWrite); + d.AddRegOperand(InstrRegister::kGPR, i.XO.RA, InstrRegister::kRead); + d.AddRegOperand(InstrRegister::kGPR, i.XO.RB, InstrRegister::kRead); + return d.Finish(); +} XEEMITTER(fcmpu, 0xFC000000, X )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) { + // if (FRA) is a NaN or (FRB) is a NaN then + // c <- 0b0001 + // else if (FRA) < (FRB) then + // c <- 0b1000 + // else if (FRA) > (FRB) then + // c <- 0b0100 + // else { + // c <- 0b0010 + // } + // FPCC <- c + // CR[4*BF:4*BF+3] <- c + // if (FRA) is an SNaN or (FRB) is an SNaN then + // VXSNAN <- 1 XEINSTRNOTIMPLEMENTED(); return 1; } diff --git a/src/cpu/codegen/emit_memory.cc b/src/xenia/cpu/codegen/emit_memory.cc similarity index 99% rename from src/cpu/codegen/emit_memory.cc rename to src/xenia/cpu/codegen/emit_memory.cc index c4ef4a820..19d9434c7 100644 --- a/src/cpu/codegen/emit_memory.cc +++ b/src/xenia/cpu/codegen/emit_memory.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/codegen/emit.h" +#include #include diff --git a/src/cpu/codegen/function_generator.cc b/src/xenia/cpu/codegen/function_generator.cc similarity index 99% rename from src/cpu/codegen/function_generator.cc rename to src/xenia/cpu/codegen/function_generator.cc index 9baf8eded..020bad57b 100644 --- a/src/cpu/codegen/function_generator.cc +++ b/src/xenia/cpu/codegen/function_generator.cc @@ -11,10 +11,9 @@ #include +#include #include -#include "cpu/cpu-private.h" - using namespace llvm; using namespace xe::cpu::codegen; diff --git a/include/xenia/cpu/codegen/function_generator.h b/src/xenia/cpu/codegen/function_generator.h similarity index 100% rename from include/xenia/cpu/codegen/function_generator.h rename to src/xenia/cpu/codegen/function_generator.h diff --git a/src/cpu/codegen/module_generator.cc b/src/xenia/cpu/codegen/module_generator.cc similarity index 99% rename from src/cpu/codegen/module_generator.cc rename to src/xenia/cpu/codegen/module_generator.cc index 4ecfc0b55..967b6600a 100644 --- a/src/cpu/codegen/module_generator.cc +++ b/src/xenia/cpu/codegen/module_generator.cc @@ -24,11 +24,10 @@ #include #include +#include #include #include -#include "cpu/cpu-private.h" - using namespace llvm; using namespace xe; diff --git a/include/xenia/cpu/codegen/module_generator.h b/src/xenia/cpu/codegen/module_generator.h similarity index 100% rename from include/xenia/cpu/codegen/module_generator.h rename to src/xenia/cpu/codegen/module_generator.h diff --git a/src/cpu/codegen/sources.gypi b/src/xenia/cpu/codegen/sources.gypi similarity index 75% rename from src/cpu/codegen/sources.gypi rename to src/xenia/cpu/codegen/sources.gypi index d957277b2..476008df4 100644 --- a/src/cpu/codegen/sources.gypi +++ b/src/xenia/cpu/codegen/sources.gypi @@ -1,11 +1,14 @@ # Copyright 2013 Ben Vanik. All Rights Reserved. { 'sources': [ + 'emit.h', 'emit_alu.cc', 'emit_control.cc', 'emit_fpu.cc', 'emit_memory.cc', 'function_generator.cc', + 'function_generator.h', 'module_generator.cc', + 'module_generator.h', ], } diff --git a/src/cpu/cpu-private.h b/src/xenia/cpu/cpu-private.h similarity index 100% rename from src/cpu/cpu-private.h rename to src/xenia/cpu/cpu-private.h diff --git a/src/cpu/cpu.cc b/src/xenia/cpu/cpu.cc similarity index 97% rename from src/cpu/cpu.cc rename to src/xenia/cpu/cpu.cc index 6cad92513..a633e7eb6 100644 --- a/src/cpu/cpu.cc +++ b/src/xenia/cpu/cpu.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/cpu-private.h" +#include // Tracing: diff --git a/include/xenia/cpu.h b/src/xenia/cpu/cpu.h similarity index 87% rename from include/xenia/cpu.h rename to src/xenia/cpu/cpu.h index c2930eaf3..61014a386 100644 --- a/include/xenia/cpu.h +++ b/src/xenia/cpu/cpu.h @@ -7,9 +7,9 @@ ****************************************************************************** */ -#ifndef XENIA_CPU_H_ -#define XENIA_CPU_H_ +#ifndef XENIA_CPU_CPU_H_ +#define XENIA_CPU_CPU_H_ #include -#endif // XENIA_CPU_H_ +#endif // XENIA_CPU_CPU_H_ diff --git a/src/cpu/exec_module.cc b/src/xenia/cpu/exec_module.cc similarity index 98% rename from src/cpu/exec_module.cc rename to src/xenia/cpu/exec_module.cc index 514523dc8..46868226d 100644 --- a/src/cpu/exec_module.cc +++ b/src/xenia/cpu/exec_module.cc @@ -28,14 +28,13 @@ #include #include -#include +#include +#include #include +#include #include #include - -#include "cpu/cpu-private.h" -#include "cpu/llvm_exports.h" -#include "cpu/xethunk/xethunk.h" +#include using namespace llvm; @@ -107,7 +106,7 @@ int ExecModule::Prepare() { PassManagerBuilder pmb; // TODO(benvanik): embed the bc file into the emulator. - const char *thunk_path = "src/cpu/xethunk/xethunk.bc"; + const char *thunk_path = "src/xenia/cpu/xethunk/xethunk.bc"; // Calculate a cache path based on the module, the CPU version, and other // bits. diff --git a/include/xenia/cpu/exec_module.h b/src/xenia/cpu/exec_module.h similarity index 100% rename from include/xenia/cpu/exec_module.h rename to src/xenia/cpu/exec_module.h diff --git a/src/cpu/llvm_exports.cc b/src/xenia/cpu/llvm_exports.cc similarity index 99% rename from src/cpu/llvm_exports.cc rename to src/xenia/cpu/llvm_exports.cc index a675e524b..75f38563d 100644 --- a/src/cpu/llvm_exports.cc +++ b/src/xenia/cpu/llvm_exports.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "cpu/llvm_exports.h" +#include #include #include diff --git a/src/cpu/llvm_exports.h b/src/xenia/cpu/llvm_exports.h similarity index 100% rename from src/cpu/llvm_exports.h rename to src/xenia/cpu/llvm_exports.h diff --git a/include/xenia/cpu/ppc.h b/src/xenia/cpu/ppc.h similarity index 100% rename from include/xenia/cpu/ppc.h rename to src/xenia/cpu/ppc.h diff --git a/src/cpu/ppc/instr.cc b/src/xenia/cpu/ppc/instr.cc similarity index 99% rename from src/cpu/ppc/instr.cc rename to src/xenia/cpu/ppc/instr.cc index 689878ccd..b5a4cde4b 100644 --- a/src/cpu/ppc/instr.cc +++ b/src/xenia/cpu/ppc/instr.cc @@ -11,7 +11,7 @@ #include -#include "cpu/ppc/instr_tables.h" +#include using namespace xe::cpu::ppc; diff --git a/include/xenia/cpu/ppc/instr.h b/src/xenia/cpu/ppc/instr.h similarity index 100% rename from include/xenia/cpu/ppc/instr.h rename to src/xenia/cpu/ppc/instr.h diff --git a/src/cpu/ppc/instr_tables.h b/src/xenia/cpu/ppc/instr_tables.h similarity index 100% rename from src/cpu/ppc/instr_tables.h rename to src/xenia/cpu/ppc/instr_tables.h diff --git a/src/cpu/ppc/sources.gypi b/src/xenia/cpu/ppc/sources.gypi similarity index 66% rename from src/cpu/ppc/sources.gypi rename to src/xenia/cpu/ppc/sources.gypi index 86abd4a97..5a63f8d25 100644 --- a/src/cpu/ppc/sources.gypi +++ b/src/xenia/cpu/ppc/sources.gypi @@ -2,6 +2,9 @@ { 'sources': [ 'instr.cc', + 'instr.h', + 'instr_tables.h', 'state.cc', + 'state.h', ], } diff --git a/src/cpu/ppc/state.cc b/src/xenia/cpu/ppc/state.cc similarity index 100% rename from src/cpu/ppc/state.cc rename to src/xenia/cpu/ppc/state.cc diff --git a/include/xenia/cpu/ppc/state.h b/src/xenia/cpu/ppc/state.h similarity index 100% rename from include/xenia/cpu/ppc/state.h rename to src/xenia/cpu/ppc/state.h diff --git a/src/cpu/processor.cc b/src/xenia/cpu/processor.cc similarity index 99% rename from src/cpu/processor.cc rename to src/xenia/cpu/processor.cc index cb2e6988d..f0d0f36a7 100644 --- a/src/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -18,7 +18,7 @@ #include #include -#include "cpu/codegen/emit.h" +#include using namespace llvm; diff --git a/include/xenia/cpu/processor.h b/src/xenia/cpu/processor.h similarity index 100% rename from include/xenia/cpu/processor.h rename to src/xenia/cpu/processor.h diff --git a/include/xenia/cpu/sdb.h b/src/xenia/cpu/sdb.h similarity index 100% rename from include/xenia/cpu/sdb.h rename to src/xenia/cpu/sdb.h diff --git a/src/cpu/sdb/raw_symbol_database.cc b/src/xenia/cpu/sdb/raw_symbol_database.cc similarity index 100% rename from src/cpu/sdb/raw_symbol_database.cc rename to src/xenia/cpu/sdb/raw_symbol_database.cc diff --git a/include/xenia/cpu/sdb/raw_symbol_database.h b/src/xenia/cpu/sdb/raw_symbol_database.h similarity index 100% rename from include/xenia/cpu/sdb/raw_symbol_database.h rename to src/xenia/cpu/sdb/raw_symbol_database.h diff --git a/src/cpu/sdb/sources.gypi b/src/xenia/cpu/sdb/sources.gypi similarity index 63% rename from src/cpu/sdb/sources.gypi rename to src/xenia/cpu/sdb/sources.gypi index 089fbe149..ba19242e8 100644 --- a/src/cpu/sdb/sources.gypi +++ b/src/xenia/cpu/sdb/sources.gypi @@ -2,8 +2,12 @@ { 'sources': [ 'raw_symbol_database.cc', + 'raw_symbol_database.h', 'symbol.cc', + 'symbol.h', 'symbol_database.cc', + 'symbol_database.h', 'xex_symbol_database.cc', + 'xex_symbol_database.h', ] } diff --git a/src/cpu/sdb/symbol.cc b/src/xenia/cpu/sdb/symbol.cc similarity index 100% rename from src/cpu/sdb/symbol.cc rename to src/xenia/cpu/sdb/symbol.cc diff --git a/include/xenia/cpu/sdb/symbol.h b/src/xenia/cpu/sdb/symbol.h similarity index 100% rename from include/xenia/cpu/sdb/symbol.h rename to src/xenia/cpu/sdb/symbol.h diff --git a/src/cpu/sdb/symbol_database.cc b/src/xenia/cpu/sdb/symbol_database.cc similarity index 100% rename from src/cpu/sdb/symbol_database.cc rename to src/xenia/cpu/sdb/symbol_database.cc diff --git a/include/xenia/cpu/sdb/symbol_database.h b/src/xenia/cpu/sdb/symbol_database.h similarity index 100% rename from include/xenia/cpu/sdb/symbol_database.h rename to src/xenia/cpu/sdb/symbol_database.h diff --git a/src/cpu/sdb/xex_symbol_database.cc b/src/xenia/cpu/sdb/xex_symbol_database.cc similarity index 100% rename from src/cpu/sdb/xex_symbol_database.cc rename to src/xenia/cpu/sdb/xex_symbol_database.cc diff --git a/include/xenia/cpu/sdb/xex_symbol_database.h b/src/xenia/cpu/sdb/xex_symbol_database.h similarity index 100% rename from include/xenia/cpu/sdb/xex_symbol_database.h rename to src/xenia/cpu/sdb/xex_symbol_database.h diff --git a/src/cpu/sources.gypi b/src/xenia/cpu/sources.gypi similarity index 67% rename from src/cpu/sources.gypi rename to src/xenia/cpu/sources.gypi index ba182648e..d66cac04f 100644 --- a/src/cpu/sources.gypi +++ b/src/xenia/cpu/sources.gypi @@ -1,11 +1,18 @@ # Copyright 2013 Ben Vanik. All Rights Reserved. { 'sources': [ + 'cpu-private.h', 'cpu.cc', + 'cpu.h', 'exec_module.cc', + 'exec_module.h', 'llvm_exports.cc', + 'llvm_exports.h', + 'ppc.h', 'processor.cc', + 'processor.h', 'thread_state.cc', + 'thread_state.h', ], 'includes': [ diff --git a/src/cpu/thread_state.cc b/src/xenia/cpu/thread_state.cc similarity index 100% rename from src/cpu/thread_state.cc rename to src/xenia/cpu/thread_state.cc diff --git a/include/xenia/cpu/thread_state.h b/src/xenia/cpu/thread_state.h similarity index 100% rename from include/xenia/cpu/thread_state.h rename to src/xenia/cpu/thread_state.h diff --git a/src/cpu/xethunk/xethunk.bc b/src/xenia/cpu/xethunk/xethunk.bc similarity index 100% rename from src/cpu/xethunk/xethunk.bc rename to src/xenia/cpu/xethunk/xethunk.bc diff --git a/src/cpu/xethunk/xethunk.c b/src/xenia/cpu/xethunk/xethunk.c similarity index 100% rename from src/cpu/xethunk/xethunk.c rename to src/xenia/cpu/xethunk/xethunk.c diff --git a/src/cpu/xethunk/xethunk.h b/src/xenia/cpu/xethunk/xethunk.h similarity index 100% rename from src/cpu/xethunk/xethunk.h rename to src/xenia/cpu/xethunk/xethunk.h diff --git a/src/cpu/xethunk/xethunk.ll b/src/xenia/cpu/xethunk/xethunk.ll similarity index 100% rename from src/cpu/xethunk/xethunk.ll rename to src/xenia/cpu/xethunk/xethunk.ll diff --git a/src/dbg/client.cc b/src/xenia/dbg/client.cc similarity index 100% rename from src/dbg/client.cc rename to src/xenia/dbg/client.cc diff --git a/include/xenia/dbg/client.h b/src/xenia/dbg/client.h similarity index 100% rename from include/xenia/dbg/client.h rename to src/xenia/dbg/client.h diff --git a/src/dbg/content_source.cc b/src/xenia/dbg/content_source.cc similarity index 100% rename from src/dbg/content_source.cc rename to src/xenia/dbg/content_source.cc diff --git a/include/xenia/dbg/content_source.h b/src/xenia/dbg/content_source.h similarity index 100% rename from include/xenia/dbg/content_source.h rename to src/xenia/dbg/content_source.h diff --git a/src/dbg/debugger.cc b/src/xenia/dbg/debugger.cc similarity index 98% rename from src/dbg/debugger.cc rename to src/xenia/dbg/debugger.cc index bb908432d..0080035a8 100644 --- a/src/dbg/debugger.cc +++ b/src/xenia/dbg/debugger.cc @@ -12,8 +12,7 @@ #include #include - -#include "dbg/ws_listener.h" +#include using namespace xe; diff --git a/include/xenia/dbg/debugger.h b/src/xenia/dbg/debugger.h similarity index 100% rename from include/xenia/dbg/debugger.h rename to src/xenia/dbg/debugger.h diff --git a/src/dbg/listener.cc b/src/xenia/dbg/listener.cc similarity index 95% rename from src/dbg/listener.cc rename to src/xenia/dbg/listener.cc index 35c1f520c..2a72d99a9 100644 --- a/src/dbg/listener.cc +++ b/src/xenia/dbg/listener.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "dbg/listener.h" +#include using namespace xe; diff --git a/src/dbg/listener.h b/src/xenia/dbg/listener.h similarity index 100% rename from src/dbg/listener.h rename to src/xenia/dbg/listener.h diff --git a/src/dbg/sources.gypi b/src/xenia/dbg/sources.gypi similarity index 62% rename from src/dbg/sources.gypi rename to src/xenia/dbg/sources.gypi index c0addbc6e..69a745469 100644 --- a/src/dbg/sources.gypi +++ b/src/xenia/dbg/sources.gypi @@ -2,10 +2,16 @@ { 'sources': [ 'client.cc', + 'client.h', 'content_source.cc', + 'content_source.h', 'debugger.cc', + 'debugger.h', 'listener.cc', + 'listener.h', 'ws_client.cc', + 'ws_client.h', 'ws_listener.cc', + 'ws_listener.h', ], } diff --git a/src/dbg/ws_client.cc b/src/xenia/dbg/ws_client.cc similarity index 99% rename from src/dbg/ws_client.cc rename to src/xenia/dbg/ws_client.cc index dea42a8f6..4f3b12a32 100644 --- a/src/dbg/ws_client.cc +++ b/src/xenia/dbg/ws_client.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "dbg/ws_client.h" +#include #include diff --git a/src/dbg/ws_client.h b/src/xenia/dbg/ws_client.h similarity index 100% rename from src/dbg/ws_client.h rename to src/xenia/dbg/ws_client.h diff --git a/src/dbg/ws_listener.cc b/src/xenia/dbg/ws_listener.cc similarity index 97% rename from src/dbg/ws_listener.cc rename to src/xenia/dbg/ws_listener.cc index 8fa1edc2e..47eaeee2f 100644 --- a/src/dbg/ws_listener.cc +++ b/src/xenia/dbg/ws_listener.cc @@ -7,13 +7,13 @@ ****************************************************************************** */ -#include "dbg/ws_listener.h" +#include #include #include #include -#include "dbg/ws_client.h" +#include using namespace xe; diff --git a/src/dbg/ws_listener.h b/src/xenia/dbg/ws_listener.h similarity index 96% rename from src/dbg/ws_listener.h rename to src/xenia/dbg/ws_listener.h index 7195f00df..b3f05a782 100644 --- a/src/dbg/ws_listener.h +++ b/src/xenia/dbg/ws_listener.h @@ -13,7 +13,7 @@ #include #include -#include "dbg/listener.h" +#include namespace xe { diff --git a/src/gpu/gpu.cc b/src/xenia/gpu/gpu.cc similarity index 95% rename from src/gpu/gpu.cc rename to src/xenia/gpu/gpu.cc index 416acb392..f15d16706 100644 --- a/src/gpu/gpu.cc +++ b/src/xenia/gpu/gpu.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include +#include void do_gpu_stuff() { diff --git a/include/xenia/gpu.h b/src/xenia/gpu/gpu.h similarity index 87% rename from include/xenia/gpu.h rename to src/xenia/gpu/gpu.h index 432e82760..48d70b34c 100644 --- a/include/xenia/gpu.h +++ b/src/xenia/gpu/gpu.h @@ -7,12 +7,12 @@ ****************************************************************************** */ -#ifndef XENIA_GPU_H_ -#define XENIA_GPU_H_ +#ifndef XENIA_GPU_GPU_H_ +#define XENIA_GPU_GPU_H_ #include #include void do_gpu_stuff(); -#endif // XENIA_GPU_H_ +#endif // XENIA_GPU_GPU_H_ diff --git a/src/gpu/sources.gypi b/src/xenia/gpu/sources.gypi similarity index 87% rename from src/gpu/sources.gypi rename to src/xenia/gpu/sources.gypi index 8dd685bb0..c1eb8258d 100644 --- a/src/gpu/sources.gypi +++ b/src/xenia/gpu/sources.gypi @@ -2,5 +2,6 @@ { 'sources': [ 'gpu.cc', + 'gpu.h', ], } diff --git a/src/kernel/export.cc b/src/xenia/kernel/export.cc similarity index 100% rename from src/kernel/export.cc rename to src/xenia/kernel/export.cc diff --git a/include/xenia/kernel/export.h b/src/xenia/kernel/export.h similarity index 100% rename from include/xenia/kernel/export.h rename to src/xenia/kernel/export.h diff --git a/src/kernel/fs/device.cc b/src/xenia/kernel/fs/device.cc similarity index 100% rename from src/kernel/fs/device.cc rename to src/xenia/kernel/fs/device.cc diff --git a/include/xenia/kernel/fs/device.h b/src/xenia/kernel/fs/device.h similarity index 100% rename from include/xenia/kernel/fs/device.h rename to src/xenia/kernel/fs/device.h diff --git a/src/kernel/fs/devices/disc_image_device.cc b/src/xenia/kernel/fs/devices/disc_image_device.cc similarity index 97% rename from src/kernel/fs/devices/disc_image_device.cc rename to src/xenia/kernel/fs/devices/disc_image_device.cc index dcd10bb09..c4e6eae58 100644 --- a/src/kernel/fs/devices/disc_image_device.cc +++ b/src/xenia/kernel/fs/devices/disc_image_device.cc @@ -7,9 +7,9 @@ ****************************************************************************** */ -#include "kernel/fs/devices/disc_image_device.h" +#include -#include "kernel/fs/gdfx.h" +#include using namespace xe; @@ -46,7 +46,6 @@ public: } virtual ~DiscImageFileEntry() { - delete gdfx_entry_; xe_mmap_release(mmap_); } diff --git a/src/kernel/fs/devices/disc_image_device.h b/src/xenia/kernel/fs/devices/disc_image_device.h similarity index 100% rename from src/kernel/fs/devices/disc_image_device.h rename to src/xenia/kernel/fs/devices/disc_image_device.h diff --git a/src/kernel/fs/devices/local_directory_device.cc b/src/xenia/kernel/fs/devices/local_directory_device.cc similarity index 98% rename from src/kernel/fs/devices/local_directory_device.cc rename to src/xenia/kernel/fs/devices/local_directory_device.cc index deec5693f..b0673f5bb 100644 --- a/src/kernel/fs/devices/local_directory_device.cc +++ b/src/xenia/kernel/fs/devices/local_directory_device.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "kernel/fs/devices/local_directory_device.h" +#include using namespace xe; diff --git a/src/kernel/fs/devices/local_directory_device.h b/src/xenia/kernel/fs/devices/local_directory_device.h similarity index 100% rename from src/kernel/fs/devices/local_directory_device.h rename to src/xenia/kernel/fs/devices/local_directory_device.h diff --git a/src/kernel/fs/devices/sources.gypi b/src/xenia/kernel/fs/devices/sources.gypi similarity index 69% rename from src/kernel/fs/devices/sources.gypi rename to src/xenia/kernel/fs/devices/sources.gypi index 57229c60d..e54f93017 100644 --- a/src/kernel/fs/devices/sources.gypi +++ b/src/xenia/kernel/fs/devices/sources.gypi @@ -2,6 +2,8 @@ { 'sources': [ 'disc_image_device.cc', + 'disc_image_device.h', 'local_directory_device.cc', + 'local_directory_device.h', ], } diff --git a/src/kernel/fs/entry.cc b/src/xenia/kernel/fs/entry.cc similarity index 100% rename from src/kernel/fs/entry.cc rename to src/xenia/kernel/fs/entry.cc diff --git a/include/xenia/kernel/fs/entry.h b/src/xenia/kernel/fs/entry.h similarity index 100% rename from include/xenia/kernel/fs/entry.h rename to src/xenia/kernel/fs/entry.h diff --git a/src/kernel/fs/filesystem.cc b/src/xenia/kernel/fs/filesystem.cc similarity index 96% rename from src/kernel/fs/filesystem.cc rename to src/xenia/kernel/fs/filesystem.cc index d1b8e514b..a1525ec13 100644 --- a/src/kernel/fs/filesystem.cc +++ b/src/xenia/kernel/fs/filesystem.cc @@ -9,8 +9,8 @@ #include -#include "kernel/fs/devices/disc_image_device.h" -#include "kernel/fs/devices/local_directory_device.h" +#include +#include using namespace xe; diff --git a/include/xenia/kernel/fs/filesystem.h b/src/xenia/kernel/fs/filesystem.h similarity index 100% rename from include/xenia/kernel/fs/filesystem.h rename to src/xenia/kernel/fs/filesystem.h diff --git a/src/kernel/fs/gdfx.cc b/src/xenia/kernel/fs/gdfx.cc similarity index 97% rename from src/kernel/fs/gdfx.cc rename to src/xenia/kernel/fs/gdfx.cc index 099586976..87a23988f 100644 --- a/src/kernel/fs/gdfx.cc +++ b/src/xenia/kernel/fs/gdfx.cc @@ -9,7 +9,7 @@ * - abgx360 */ -#include "kernel/fs/gdfx.h" +#include using namespace xe; @@ -24,6 +24,10 @@ namespace { } +GDFXEntry::GDFXEntry() : + attributes(0), offset(0), size(0) { +} + GDFXEntry::~GDFXEntry() { for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { @@ -170,10 +174,8 @@ bool GDFX::ReadEntry(ParseState& state, const uint8_t* buffer, entry->name.append(1, '\0'); entry->attributes = attributes; - // Add to parent (if we have one). - if (parent) { - parent->children.push_back(entry); - } + // Add to parent. + parent->children.push_back(entry); if (attributes & GDFXEntry::kAttrFolder) { // Folder. diff --git a/src/kernel/fs/gdfx.h b/src/xenia/kernel/fs/gdfx.h similarity index 99% rename from src/kernel/fs/gdfx.h rename to src/xenia/kernel/fs/gdfx.h index a2f671de5..584d1f273 100644 --- a/src/kernel/fs/gdfx.h +++ b/src/xenia/kernel/fs/gdfx.h @@ -38,7 +38,7 @@ public: kAttrNormal = 0x00000080, }; - GDFXEntry() {} + GDFXEntry(); ~GDFXEntry(); GDFXEntry* GetChild(const char* name); diff --git a/src/kernel/fs/sources.gypi b/src/xenia/kernel/fs/sources.gypi similarity index 74% rename from src/kernel/fs/sources.gypi rename to src/xenia/kernel/fs/sources.gypi index 51108e2b0..3fc43015c 100644 --- a/src/kernel/fs/sources.gypi +++ b/src/xenia/kernel/fs/sources.gypi @@ -2,9 +2,13 @@ { 'sources': [ 'device.cc', + 'device.h', 'entry.cc', + 'entry.h', 'filesystem.cc', + 'filesystem.h', 'gdfx.cc', + 'gdfx.h', ], 'includes': [ diff --git a/include/xenia/kernel.h b/src/xenia/kernel/kernel.h similarity index 84% rename from include/xenia/kernel.h rename to src/xenia/kernel/kernel.h index 486f88458..2e9fbf700 100644 --- a/include/xenia/kernel.h +++ b/src/xenia/kernel/kernel.h @@ -7,9 +7,9 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_H_ -#define XENIA_KERNEL_H_ +#ifndef XENIA_KERNEL_KERNEL_H_ +#define XENIA_KERNEL_KERNEL_H_ #include -#endif // XENIA_KERNEL_H_ +#endif // XENIA_KERNEL_KERNEL_H_ diff --git a/include/xenia/kernel/kernel_module.h b/src/xenia/kernel/kernel_module.h similarity index 100% rename from include/xenia/kernel/kernel_module.h rename to src/xenia/kernel/kernel_module.h diff --git a/src/kernel/modules/modules.h b/src/xenia/kernel/modules/modules.h similarity index 85% rename from src/kernel/modules/modules.h rename to src/xenia/kernel/modules/modules.h index 77316eac8..735091394 100644 --- a/src/kernel/modules/modules.h +++ b/src/xenia/kernel/modules/modules.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_H_ #define XENIA_KERNEL_MODULES_H_ -#include "kernel/modules/xam/xam_module.h" -#include "kernel/modules/xboxkrnl/module.h" +#include +#include #endif // XENIA_KERNEL_MODULES_H_ diff --git a/src/kernel/modules/sources.gypi b/src/xenia/kernel/modules/sources.gypi similarity index 76% rename from src/kernel/modules/sources.gypi rename to src/xenia/kernel/modules/sources.gypi index 86759bfec..46f9a5946 100644 --- a/src/kernel/modules/sources.gypi +++ b/src/xenia/kernel/modules/sources.gypi @@ -1,5 +1,9 @@ # Copyright 2013 Ben Vanik. All Rights Reserved. { + 'sources': [ + 'modules.h', + ], + 'includes': [ 'xam/sources.gypi', 'xboxkrnl/sources.gypi', diff --git a/src/kernel/modules/xam/sources.gypi b/src/xenia/kernel/modules/xam/sources.gypi similarity index 100% rename from src/kernel/modules/xam/sources.gypi rename to src/xenia/kernel/modules/xam/sources.gypi diff --git a/src/kernel/modules/xam/xam_info.cc b/src/xenia/kernel/modules/xam/xam_info.cc similarity index 94% rename from src/kernel/modules/xam/xam_info.cc rename to src/xenia/kernel/modules/xam/xam_info.cc index 160fd59eb..c18928e50 100644 --- a/src/kernel/modules/xam/xam_info.cc +++ b/src/xenia/kernel/modules/xam/xam_info.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include "kernel/modules/xam/xam_info.h" +#include +#include #include - -#include "kernel/shim_utils.h" -#include "kernel/modules/xam/xam_module.h" +#include using namespace xe; diff --git a/src/kernel/modules/xam/xam_info.h b/src/xenia/kernel/modules/xam/xam_info.h similarity index 94% rename from src/kernel/modules/xam/xam_info.h rename to src/xenia/kernel/modules/xam/xam_info.h index 11693d97c..bb331957d 100644 --- a/src/kernel/modules/xam/xam_info.h +++ b/src/xenia/kernel/modules/xam/xam_info.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XAM_INFO_H_ #define XENIA_KERNEL_MODULES_XAM_INFO_H_ -#include "kernel/modules/xam/xam_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xam/xam_module.cc b/src/xenia/kernel/modules/xam/xam_module.cc similarity index 87% rename from src/kernel/modules/xam/xam_module.cc rename to src/xenia/kernel/modules/xam/xam_module.cc index a5eb8bb56..147f5b126 100644 --- a/src/kernel/modules/xam/xam_module.cc +++ b/src/xenia/kernel/modules/xam/xam_module.cc @@ -7,11 +7,10 @@ ****************************************************************************** */ -#include "kernel/modules/xam/xam_module.h" +#include -#include "kernel/modules/xam/xam_info.h" - -#include "kernel/modules/xam/xam_table.h" +#include +#include using namespace xe; diff --git a/src/kernel/modules/xam/xam_module.h b/src/xenia/kernel/modules/xam/xam_module.h similarity index 100% rename from src/kernel/modules/xam/xam_module.h rename to src/xenia/kernel/modules/xam/xam_module.h diff --git a/src/kernel/modules/xam/xam_state.cc b/src/xenia/kernel/modules/xam/xam_state.cc similarity index 94% rename from src/kernel/modules/xam/xam_state.cc rename to src/xenia/kernel/modules/xam/xam_state.cc index 4d08bd389..d55e2be3a 100644 --- a/src/kernel/modules/xam/xam_state.cc +++ b/src/xenia/kernel/modules/xam/xam_state.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "kernel/modules/xam/xam_state.h" +#include using namespace xe; diff --git a/src/kernel/modules/xam/xam_state.h b/src/xenia/kernel/modules/xam/xam_state.h similarity index 100% rename from src/kernel/modules/xam/xam_state.h rename to src/xenia/kernel/modules/xam/xam_state.h diff --git a/src/kernel/modules/xam/xam_table.h b/src/xenia/kernel/modules/xam/xam_table.h similarity index 100% rename from src/kernel/modules/xam/xam_table.h rename to src/xenia/kernel/modules/xam/xam_table.h diff --git a/src/kernel/modules/xboxkrnl/kernel_state.cc b/src/xenia/kernel/modules/xboxkrnl/kernel_state.cc similarity index 95% rename from src/kernel/modules/xboxkrnl/kernel_state.cc rename to src/xenia/kernel/modules/xboxkrnl/kernel_state.cc index 374f7eb71..273d573f8 100644 --- a/src/kernel/modules/xboxkrnl/kernel_state.cc +++ b/src/xenia/kernel/modules/xboxkrnl/kernel_state.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include -#include "kernel/modules/xboxkrnl/xobject.h" -#include "kernel/modules/xboxkrnl/objects/xmodule.h" -#include "kernel/modules/xboxkrnl/objects/xthread.h" +#include +#include +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/kernel_state.h b/src/xenia/kernel/modules/xboxkrnl/kernel_state.h similarity index 100% rename from src/kernel/modules/xboxkrnl/kernel_state.h rename to src/xenia/kernel/modules/xboxkrnl/kernel_state.h diff --git a/src/kernel/modules/xboxkrnl/module.cc b/src/xenia/kernel/modules/xboxkrnl/module.cc similarity index 89% rename from src/kernel/modules/xboxkrnl/module.cc rename to src/xenia/kernel/modules/xboxkrnl/module.cc index f4e5239b0..bcd4afb3e 100644 --- a/src/kernel/modules/xboxkrnl/module.cc +++ b/src/xenia/kernel/modules/xboxkrnl/module.cc @@ -7,20 +7,19 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/module.h" +#include #include -#include "kernel/modules/xboxkrnl/kernel_state.h" -#include "kernel/modules/xboxkrnl/objects/xmodule.h" +#include +#include +#include -#include "kernel/modules/xboxkrnl/xboxkrnl_hal.h" -#include "kernel/modules/xboxkrnl/xboxkrnl_memory.h" -#include "kernel/modules/xboxkrnl/xboxkrnl_module.h" -#include "kernel/modules/xboxkrnl/xboxkrnl_rtl.h" -#include "kernel/modules/xboxkrnl/xboxkrnl_threading.h" - -#include "kernel/modules/xboxkrnl/xboxkrnl_table.h" +#include +#include +#include +#include +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/module.h b/src/xenia/kernel/modules/xboxkrnl/module.h similarity index 100% rename from src/kernel/modules/xboxkrnl/module.h rename to src/xenia/kernel/modules/xboxkrnl/module.h diff --git a/src/kernel/modules/xboxkrnl/objects/sources.gypi b/src/xenia/kernel/modules/xboxkrnl/objects/sources.gypi similarity index 76% rename from src/kernel/modules/xboxkrnl/objects/sources.gypi rename to src/xenia/kernel/modules/xboxkrnl/objects/sources.gypi index 6e37d0a86..bc226c02c 100644 --- a/src/kernel/modules/xboxkrnl/objects/sources.gypi +++ b/src/xenia/kernel/modules/xboxkrnl/objects/sources.gypi @@ -2,6 +2,8 @@ { 'sources': [ 'xmodule.cc', + 'xmodule.h', 'xthread.cc', + 'xthread.h', ], } diff --git a/src/kernel/modules/xboxkrnl/objects/xmodule.cc b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc similarity index 98% rename from src/kernel/modules/xboxkrnl/objects/xmodule.cc rename to src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc index 0277f284f..30f266d9c 100644 --- a/src/kernel/modules/xboxkrnl/objects/xmodule.cc +++ b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc @@ -7,9 +7,9 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/objects/xmodule.h" +#include -#include "kernel/modules/xboxkrnl/objects/xthread.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/objects/xmodule.h b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.h similarity index 96% rename from src/kernel/modules/xboxkrnl/objects/xmodule.h rename to src/xenia/kernel/modules/xboxkrnl/objects/xmodule.h index 94d2f5f64..197a98a95 100644 --- a/src/kernel/modules/xboxkrnl/objects/xmodule.h +++ b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_XMODULE_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_XMODULE_H_ -#include "kernel/modules/xboxkrnl/xobject.h" +#include #include diff --git a/src/kernel/modules/xboxkrnl/objects/xthread.cc b/src/xenia/kernel/modules/xboxkrnl/objects/xthread.cc similarity index 99% rename from src/kernel/modules/xboxkrnl/objects/xthread.cc rename to src/xenia/kernel/modules/xboxkrnl/objects/xthread.cc index 81d27801d..9479056df 100644 --- a/src/kernel/modules/xboxkrnl/objects/xthread.cc +++ b/src/xenia/kernel/modules/xboxkrnl/objects/xthread.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/objects/xthread.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/objects/xthread.h b/src/xenia/kernel/modules/xboxkrnl/objects/xthread.h similarity index 97% rename from src/kernel/modules/xboxkrnl/objects/xthread.h rename to src/xenia/kernel/modules/xboxkrnl/objects/xthread.h index 77d7a403d..32fdc2810 100644 --- a/src/kernel/modules/xboxkrnl/objects/xthread.h +++ b/src/xenia/kernel/modules/xboxkrnl/objects/xthread.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_XTHREAD_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_XTHREAD_H_ -#include "kernel/modules/xboxkrnl/xobject.h" +#include #include diff --git a/src/kernel/modules/xboxkrnl/sources.gypi b/src/xenia/kernel/modules/xboxkrnl/sources.gypi similarity index 60% rename from src/kernel/modules/xboxkrnl/sources.gypi rename to src/xenia/kernel/modules/xboxkrnl/sources.gypi index a1e37111c..16e7cf62e 100644 --- a/src/kernel/modules/xboxkrnl/sources.gypi +++ b/src/xenia/kernel/modules/xboxkrnl/sources.gypi @@ -2,13 +2,22 @@ { 'sources': [ 'kernel_state.cc', + 'kernel_state.h', 'module.cc', + 'module.h', 'xboxkrnl_hal.cc', + 'xboxkrnl_hal.h', 'xboxkrnl_memory.cc', + 'xboxkrnl_memory.h', 'xboxkrnl_module.cc', + 'xboxkrnl_module.h', 'xboxkrnl_rtl.cc', + 'xboxkrnl_rtl.h', + 'xboxkrnl_tableh', 'xboxkrnl_threading.cc', + 'xboxkrnl_threading.h', 'xobject.cc', + 'xobject.h', ], 'includes': [ diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_hal.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.cc similarity index 94% rename from src/kernel/modules/xboxkrnl/xboxkrnl_hal.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.cc index 35475b0fc..6a72d4bb4 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_hal.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xboxkrnl_hal.h" +#include +#include #include -#include "kernel/shim_utils.h" - using namespace xe; using namespace xe::kernel; diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_hal.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.h similarity index 93% rename from src/kernel/modules/xboxkrnl/xboxkrnl_hal.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.h index d23a9e4e9..509bed24a 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_hal.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_HAL_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_HAL_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_memory.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc similarity index 98% rename from src/kernel/modules/xboxkrnl/xboxkrnl_memory.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc index 0c226de9f..54a794921 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_memory.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xboxkrnl_memory.h" +#include +#include #include -#include "kernel/shim_utils.h" - using namespace xe; using namespace xe::kernel; diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_memory.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h similarity index 93% rename from src/kernel/modules/xboxkrnl/xboxkrnl_memory.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h index 216dca9a9..e91fe9aad 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_memory.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_MEMORY_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_MEMORY_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_module.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.cc similarity index 95% rename from src/kernel/modules/xboxkrnl/xboxkrnl_module.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.cc index 8b45a2f00..3d2700493 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_module.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.cc @@ -7,13 +7,12 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xboxkrnl_module.h" +#include +#include #include #include - -#include "kernel/shim_utils.h" -#include "kernel/modules/xboxkrnl/objects/xmodule.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_module.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.h similarity index 93% rename from src/kernel/modules/xboxkrnl/xboxkrnl_module.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.h index 70c6f2bcb..588512a91 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_module.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_module.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_MODULE_IMPL_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_MODULE_IMPL_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc similarity index 99% rename from src/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc index a3482cf99..a20a44ce9 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc @@ -7,13 +7,12 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xboxkrnl_rtl.h" +#include +#include #include #include - -#include "kernel/shim_utils.h" -#include "kernel/modules/xboxkrnl/objects/xthread.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_rtl.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.h similarity index 93% rename from src/kernel/modules/xboxkrnl/xboxkrnl_rtl.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.h index 526d2f0f4..db8400865 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_rtl.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_RTL_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_RTL_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_table.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_table.h similarity index 100% rename from src/kernel/modules/xboxkrnl/xboxkrnl_table.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_table.h diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_threading.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.cc similarity index 97% rename from src/kernel/modules/xboxkrnl/xboxkrnl_threading.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.cc index 905122cab..5ea8905ee 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_threading.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xboxkrnl_threading.h" +#include +#include #include - -#include "kernel/shim_utils.h" -#include "kernel/modules/xboxkrnl/objects/xthread.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/xboxkrnl_threading.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.h similarity index 94% rename from src/kernel/modules/xboxkrnl/xboxkrnl_threading.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.h index a066042fe..0dbf66eed 100644 --- a/src/kernel/modules/xboxkrnl/xboxkrnl_threading.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_threading.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_THREADING_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_THREADING_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include namespace xe { diff --git a/src/kernel/modules/xboxkrnl/xobject.cc b/src/xenia/kernel/modules/xboxkrnl/xobject.cc similarity index 96% rename from src/kernel/modules/xboxkrnl/xobject.cc rename to src/xenia/kernel/modules/xboxkrnl/xobject.cc index 4f3beb63e..0e2d34f57 100644 --- a/src/kernel/modules/xboxkrnl/xobject.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xobject.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "kernel/modules/xboxkrnl/xobject.h" +#include using namespace xe; diff --git a/src/kernel/modules/xboxkrnl/xobject.h b/src/xenia/kernel/modules/xboxkrnl/xobject.h similarity index 95% rename from src/kernel/modules/xboxkrnl/xobject.h rename to src/xenia/kernel/modules/xboxkrnl/xobject.h index c8121fa25..0e14d948f 100644 --- a/src/kernel/modules/xboxkrnl/xobject.h +++ b/src/xenia/kernel/modules/xboxkrnl/xobject.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_XOBJECT_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_XOBJECT_H_ -#include "kernel/modules/xboxkrnl/kernel_state.h" +#include #include diff --git a/src/kernel/runtime.cc b/src/xenia/kernel/runtime.cc similarity index 98% rename from src/kernel/runtime.cc rename to src/xenia/kernel/runtime.cc index 298a7eeef..329d2326b 100644 --- a/src/kernel/runtime.cc +++ b/src/xenia/kernel/runtime.cc @@ -9,7 +9,7 @@ #include -#include "kernel/modules/modules.h" +#include using namespace xe; diff --git a/include/xenia/kernel/runtime.h b/src/xenia/kernel/runtime.h similarity index 98% rename from include/xenia/kernel/runtime.h rename to src/xenia/kernel/runtime.h index 9ffd820c4..5de930149 100644 --- a/include/xenia/kernel/runtime.h +++ b/src/xenia/kernel/runtime.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/src/kernel/shim_utils.h b/src/xenia/kernel/shim_utils.h similarity index 100% rename from src/kernel/shim_utils.h rename to src/xenia/kernel/shim_utils.h diff --git a/src/kernel/sources.gypi b/src/xenia/kernel/sources.gypi similarity index 58% rename from src/kernel/sources.gypi rename to src/xenia/kernel/sources.gypi index 589dc307e..2cbd43602 100644 --- a/src/kernel/sources.gypi +++ b/src/xenia/kernel/sources.gypi @@ -2,8 +2,16 @@ { 'sources': [ 'export.cc', + 'export.h', + 'kernel.h', + 'kernel_module.h', 'runtime.cc', + 'runtime.h', + 'shim_utils.h', + 'xbox.h', 'xex2.cc', + 'xex2.h', + 'xex2_info.h', ], 'includes': [ diff --git a/include/xenia/kernel/xbox.h b/src/xenia/kernel/xbox.h similarity index 100% rename from include/xenia/kernel/xbox.h rename to src/xenia/kernel/xbox.h diff --git a/src/kernel/xex2.cc b/src/xenia/kernel/xex2.cc similarity index 100% rename from src/kernel/xex2.cc rename to src/xenia/kernel/xex2.cc diff --git a/include/xenia/kernel/xex2.h b/src/xenia/kernel/xex2.h similarity index 100% rename from include/xenia/kernel/xex2.h rename to src/xenia/kernel/xex2.h diff --git a/include/xenia/kernel/xex2_info.h b/src/xenia/kernel/xex2_info.h similarity index 100% rename from include/xenia/kernel/xex2_info.h rename to src/xenia/kernel/xex2_info.h diff --git a/include/xenia/logging.h b/src/xenia/logging.h similarity index 100% rename from include/xenia/logging.h rename to src/xenia/logging.h diff --git a/include/xenia/malloc.h b/src/xenia/malloc.h similarity index 100% rename from include/xenia/malloc.h rename to src/xenia/malloc.h diff --git a/include/xenia/platform.h b/src/xenia/platform.h similarity index 100% rename from include/xenia/platform.h rename to src/xenia/platform.h diff --git a/include/xenia/platform_includes.h b/src/xenia/platform_includes.h similarity index 100% rename from include/xenia/platform_includes.h rename to src/xenia/platform_includes.h diff --git a/src/xenia/sources.gypi b/src/xenia/sources.gypi index ceeb2fd98..f819343f5 100644 --- a/src/xenia/sources.gypi +++ b/src/xenia/sources.gypi @@ -1,7 +1,28 @@ # Copyright 2013 Ben Vanik. All Rights Reserved. { 'sources': [ + 'assert.h', + 'atomic.h', + 'byte_order.h', + 'common.h', + 'config.h', + 'core.h', 'logging.cc', + 'logging.h', 'malloc.cc', + 'malloc.h', + 'platform.h', + 'platform_includes.h', + 'string.h', + 'types.h', + 'xenia.h', + ], + + 'includes': [ + 'core/sources.gypi', + 'cpu/sources.gypi', + 'dbg/sources.gypi', + 'gpu/sources.gypi', + 'kernel/sources.gypi', ], } diff --git a/include/xenia/string.h b/src/xenia/string.h similarity index 100% rename from include/xenia/string.h rename to src/xenia/string.h diff --git a/include/xenia/types.h b/src/xenia/types.h similarity index 100% rename from include/xenia/types.h rename to src/xenia/types.h diff --git a/include/xenia/xenia.h b/src/xenia/xenia.h similarity index 87% rename from include/xenia/xenia.h rename to src/xenia/xenia.h index 503a4fe95..bca9f567e 100644 --- a/include/xenia/xenia.h +++ b/src/xenia/xenia.h @@ -11,10 +11,10 @@ #define XENIA_H_ #include -#include #include -#include -#include +#include #include +#include +#include #endif // XENIA_H_ diff --git a/tools/xenia-run/xenia-run.gypi b/tools/xenia-run/xenia-run.gypi index fc841fc54..0c9bfaca9 100644 --- a/tools/xenia-run/xenia-run.gypi +++ b/tools/xenia-run/xenia-run.gypi @@ -6,10 +6,7 @@ 'type': 'executable', 'dependencies': [ - 'xeniacore', - 'xeniacpu', - 'xeniagpu', - 'xeniakernel', + 'xenia', ], 'include_dirs': [ diff --git a/tools/xenia-test/xenia-test.gypi b/tools/xenia-test/xenia-test.gypi index 1114272da..c682fbc74 100644 --- a/tools/xenia-test/xenia-test.gypi +++ b/tools/xenia-test/xenia-test.gypi @@ -6,10 +6,7 @@ 'type': 'executable', 'dependencies': [ - 'xeniacore', - 'xeniacpu', - 'xeniagpu', - 'xeniakernel', + 'xenia', ], 'include_dirs': [ diff --git a/xenia-build.py b/xenia-build.py index ac6349985..006c107f5 100755 --- a/xenia-build.py +++ b/xenia-build.py @@ -472,7 +472,7 @@ class XethunkCommand(Command): print 'Building xethunk...' print '' - path = 'src/cpu/xethunk/xethunk' + path = 'src/xenia/cpu/xethunk/xethunk' result = shell_call('clang -emit-llvm -O0 -c %s.c -o %s.bc' % (path, path), throw_on_error=False) if result != 0: diff --git a/xenia.gyp b/xenia.gyp index 0351f243e..ea41ebccb 100644 --- a/xenia.gyp +++ b/xenia.gyp @@ -9,8 +9,8 @@ 'targets': [ { - 'target_name': 'xeniacore', - 'product_name': 'xeniacore', + 'target_name': 'xenia', + 'product_name': 'xenia', 'type': '<(library)', 'dependencies': [ @@ -25,59 +25,7 @@ 'direct_dependent_settings': { 'include_dirs': [ - 'include/', - ], - }, - - 'include_dirs': [ - '.', - 'src/', - ], - - 'includes': [ - 'src/xenia/sources.gypi', - 'src/core/sources.gypi', - 'src/dbg/sources.gypi', - ], - }, - - { - 'target_name': 'xeniakernel', - 'product_name': 'xeniakernel', - 'type': '<(library)', - - 'dependencies': [ - 'xeniacore', - ], - 'export_dependent_settings': [ - 'xeniacore', - ], - - 'include_dirs': [ - '.', - 'src/', - ], - - 'includes': [ - 'src/kernel/sources.gypi', - ], - }, - - { - 'target_name': 'xeniacpu', - 'product_name': 'xeniacpu', - 'type': '<(library)', - - 'dependencies': [ - 'xeniacore', - ], - - 'export_dependent_settings': [ - 'xeniacore', - ], - - 'direct_dependent_settings': { - 'include_dirs': [ + 'src/', '<@(llvm_includedir)', ], @@ -117,30 +65,7 @@ ], 'includes': [ - 'src/cpu/sources.gypi', - ], - }, - - { - 'target_name': 'xeniagpu', - 'product_name': 'xeniagpu', - 'type': '<(library)', - - 'dependencies': [ - 'xeniacore', - ], - - 'export_dependent_settings': [ - 'xeniacore', - ], - - 'include_dirs': [ - '.', - 'src/', - ], - - 'includes': [ - 'src/gpu/sources.gypi', + 'src/xenia/sources.gypi', ], }, ],