From 4d9272010951f3c7aab46c97c503c3c211f0d7e3 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 4 Jan 2014 17:12:46 -0800 Subject: [PATCH] Moving all kernel files around just to fuck with whoever's keeping track ;) --- src/xenia/cpu/xex_module.h | 2 +- src/xenia/debug/protocols/ws/ws_client.cc | 8 +-- src/xenia/emulator.cc | 20 +++--- src/xenia/emulator.h | 20 +++--- .../kernel/{xboxkrnl => }/async_request.cc | 7 +- .../kernel/{xboxkrnl => }/async_request.h | 2 - src/xenia/kernel/{xboxkrnl => }/fs/device.cc | 4 +- src/xenia/kernel/{xboxkrnl => }/fs/device.h | 10 ++- .../fs/devices/disc_image_device.cc | 8 +-- .../fs/devices/disc_image_device.h | 10 ++- .../fs/devices/disc_image_entry.cc | 9 ++- .../fs/devices/disc_image_entry.h | 10 ++- .../fs/devices/disc_image_file.cc | 9 ++- .../fs/devices/disc_image_file.h | 10 ++- .../fs/devices/host_path_device.cc | 6 +- .../fs/devices/host_path_device.h | 10 ++- .../fs/devices/host_path_entry.cc | 7 +- .../fs/devices/host_path_entry.h | 10 ++- .../fs/devices/host_path_file.cc | 7 +- .../fs/devices/host_path_file.h | 10 ++- .../{xboxkrnl => }/fs/devices/sources.gypi | 0 src/xenia/kernel/{xboxkrnl => }/fs/entry.cc | 4 +- src/xenia/kernel/{xboxkrnl => }/fs/entry.h | 14 ++-- .../kernel/{xboxkrnl => }/fs/filesystem.cc | 8 +-- .../kernel/{xboxkrnl => }/fs/filesystem.h | 10 ++- src/xenia/kernel/{xboxkrnl => }/fs/gdfx.cc | 4 +- src/xenia/kernel/{xboxkrnl => }/fs/gdfx.h | 10 ++- .../kernel/{xboxkrnl => }/fs/sources.gypi | 0 src/xenia/kernel/kernel_module.cc | 5 +- src/xenia/kernel/kernel_module.h | 7 +- .../kernel/{xboxkrnl => }/kernel_state.cc | 23 +++++-- .../kernel/{xboxkrnl => }/kernel_state.h | 21 +++--- src/xenia/kernel/modules.h | 4 +- .../kernel/{xboxkrnl => }/object_table.cc | 7 +- .../kernel/{xboxkrnl => }/object_table.h | 2 - .../{xboxkrnl => }/objects/sources.gypi | 0 .../kernel/{xboxkrnl => }/objects/xevent.cc | 3 +- .../kernel/{xboxkrnl => }/objects/xevent.h | 4 +- .../kernel/{xboxkrnl => }/objects/xfile.cc | 7 +- .../kernel/{xboxkrnl => }/objects/xfile.h | 4 +- .../kernel/{xboxkrnl => }/objects/xmodule.cc | 5 +- .../kernel/{xboxkrnl => }/objects/xmodule.h | 6 +- .../objects/xnotify_listener.cc | 3 +- .../{xboxkrnl => }/objects/xnotify_listener.h | 4 +- .../{xboxkrnl => }/objects/xsemaphore.cc | 3 +- .../{xboxkrnl => }/objects/xsemaphore.h | 4 +- .../kernel/{xboxkrnl => }/objects/xthread.cc | 9 ++- .../kernel/{xboxkrnl => }/objects/xthread.h | 4 +- src/xenia/kernel/sources.gypi | 64 +++++++++++++++++-- src/xenia/kernel/{ => util}/shim_utils.h | 6 +- src/xenia/kernel/util/sources.gypi | 4 ++ src/xenia/kernel/{ => util}/xex2.cc | 2 +- src/xenia/kernel/{ => util}/xex2.h | 8 +-- src/xenia/kernel/{ => util}/xex2_info.h | 0 src/xenia/kernel/xam/sources.gypi | 26 -------- src/xenia/kernel/xam/xam_state.cc | 31 --------- src/xenia/kernel/xam/xam_state.h | 45 ------------- src/xenia/kernel/{xam => }/xam_content.cc | 14 ++-- src/xenia/kernel/{xam => }/xam_content.h | 2 - src/xenia/kernel/{xam => }/xam_info.cc | 22 +++---- src/xenia/kernel/{xam => }/xam_info.h | 2 - src/xenia/kernel/{xam => }/xam_input.cc | 18 +++--- src/xenia/kernel/{xam => }/xam_input.h | 2 - src/xenia/kernel/{xam => }/xam_module.cc | 38 ++++------- src/xenia/kernel/{xam => }/xam_module.h | 11 +--- src/xenia/kernel/{xam => }/xam_net.cc | 18 +++--- src/xenia/kernel/{xam => }/xam_net.h | 2 - src/xenia/kernel/{xam => }/xam_notify.cc | 46 ++++++++----- src/xenia/kernel/{xam => }/xam_notify.h | 3 - src/xenia/kernel/{xam => }/xam_ordinals.h | 2 +- src/xenia/kernel/{xam => }/xam_private.h | 32 ++++------ src/xenia/kernel/{xam => }/xam_table.inc | 0 src/xenia/kernel/{xam => }/xam_user.cc | 16 ++--- src/xenia/kernel/{xam => }/xam_user.h | 3 - src/xenia/kernel/{xam => }/xam_video.cc | 17 +++-- src/xenia/kernel/{xam => }/xam_video.h | 4 -- src/xenia/kernel/xboxkrnl/sources.gypi | 47 -------------- .../kernel/{xboxkrnl => }/xboxkrnl_audio.cc | 10 ++- .../kernel/{xboxkrnl => }/xboxkrnl_audio.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_debug.cc | 12 ++-- .../kernel/{xboxkrnl => }/xboxkrnl_debug.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_hal.cc | 10 ++- .../kernel/{xboxkrnl => }/xboxkrnl_hal.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_io.cc | 19 +++--- src/xenia/kernel/{xboxkrnl => }/xboxkrnl_io.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_memory.cc | 10 ++- .../kernel/{xboxkrnl => }/xboxkrnl_memory.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_misc.cc | 12 ++-- .../kernel/{xboxkrnl => }/xboxkrnl_misc.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_module.cc | 49 +++++--------- .../kernel/{xboxkrnl => }/xboxkrnl_module.h | 23 +++---- .../kernel/{xboxkrnl => }/xboxkrnl_modules.cc | 14 ++-- .../kernel/{xboxkrnl => }/xboxkrnl_modules.h | 9 ++- .../kernel/{xboxkrnl => }/xboxkrnl_nt.cc | 12 ++-- src/xenia/kernel/{xboxkrnl => }/xboxkrnl_nt.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_ob.cc | 14 ++-- src/xenia/kernel/{xboxkrnl => }/xboxkrnl_ob.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_ordinals.h | 2 +- .../kernel/{xboxkrnl => }/xboxkrnl_private.h | 13 +--- .../kernel/{xboxkrnl => }/xboxkrnl_rtl.cc | 16 ++--- .../kernel/{xboxkrnl => }/xboxkrnl_rtl.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_table.inc | 0 .../{xboxkrnl => }/xboxkrnl_threading.cc | 16 ++--- .../{xboxkrnl => }/xboxkrnl_threading.h | 2 - .../kernel/{xboxkrnl => }/xboxkrnl_video.cc | 12 ++-- .../kernel/{xboxkrnl => }/xboxkrnl_video.h | 2 - src/xenia/kernel/{xboxkrnl => }/xobject.cc | 8 +-- src/xenia/kernel/{xboxkrnl => }/xobject.h | 4 +- 108 files changed, 449 insertions(+), 677 deletions(-) rename src/xenia/kernel/{xboxkrnl => }/async_request.cc (86%) rename src/xenia/kernel/{xboxkrnl => }/async_request.h (97%) rename src/xenia/kernel/{xboxkrnl => }/fs/device.cc (88%) rename src/xenia/kernel/{xboxkrnl => }/fs/device.h (79%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_device.cc (92%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_device.h (77%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_entry.cc (90%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_entry.h (82%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_file.cc (84%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/disc_image_file.h (79%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_device.cc (91%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_device.h (76%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_entry.cc (93%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_entry.h (81%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_file.cc (87%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/host_path_file.h (80%) rename src/xenia/kernel/{xboxkrnl => }/fs/devices/sources.gypi (100%) rename src/xenia/kernel/{xboxkrnl => }/fs/entry.cc (91%) rename src/xenia/kernel/{xboxkrnl => }/fs/entry.h (83%) rename src/xenia/kernel/{xboxkrnl => }/fs/filesystem.cc (94%) rename src/xenia/kernel/{xboxkrnl => }/fs/filesystem.h (83%) rename src/xenia/kernel/{xboxkrnl => }/fs/gdfx.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/fs/gdfx.h (90%) rename src/xenia/kernel/{xboxkrnl => }/fs/sources.gypi (100%) rename src/xenia/kernel/{xboxkrnl => }/kernel_state.cc (74%) rename src/xenia/kernel/{xboxkrnl => }/kernel_state.h (76%) rename src/xenia/kernel/{xboxkrnl => }/object_table.cc (96%) rename src/xenia/kernel/{xboxkrnl => }/object_table.h (96%) rename src/xenia/kernel/{xboxkrnl => }/objects/sources.gypi (100%) rename src/xenia/kernel/{xboxkrnl => }/objects/xevent.cc (96%) rename src/xenia/kernel/{xboxkrnl => }/objects/xevent.h (93%) rename src/xenia/kernel/{xboxkrnl => }/objects/xfile.cc (91%) rename src/xenia/kernel/{xboxkrnl => }/objects/xfile.h (96%) rename src/xenia/kernel/{xboxkrnl => }/objects/xmodule.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/objects/xmodule.h (92%) rename src/xenia/kernel/{xboxkrnl => }/objects/xnotify_listener.cc (97%) rename src/xenia/kernel/{xboxkrnl => }/objects/xnotify_listener.h (94%) rename src/xenia/kernel/{xboxkrnl => }/objects/xsemaphore.cc (96%) rename src/xenia/kernel/{xboxkrnl => }/objects/xsemaphore.h (93%) rename src/xenia/kernel/{xboxkrnl => }/objects/xthread.cc (97%) rename src/xenia/kernel/{xboxkrnl => }/objects/xthread.h (96%) rename src/xenia/kernel/{ => util}/shim_utils.h (95%) rename src/xenia/kernel/{ => util}/xex2.cc (99%) rename src/xenia/kernel/{ => util}/xex2.h (93%) rename src/xenia/kernel/{ => util}/xex2_info.h (100%) delete mode 100644 src/xenia/kernel/xam/sources.gypi delete mode 100644 src/xenia/kernel/xam/xam_state.cc delete mode 100644 src/xenia/kernel/xam/xam_state.h rename src/xenia/kernel/{xam => }/xam_content.cc (77%) rename src/xenia/kernel/{xam => }/xam_content.h (95%) rename src/xenia/kernel/{xam => }/xam_info.cc (82%) rename src/xenia/kernel/{xam => }/xam_info.h (95%) rename src/xenia/kernel/{xam => }/xam_input.cc (88%) rename src/xenia/kernel/{xam => }/xam_input.h (95%) rename src/xenia/kernel/{xam => }/xam_module.cc (51%) rename src/xenia/kernel/{xam => }/xam_module.h (82%) rename src/xenia/kernel/{xam => }/xam_net.cc (83%) rename src/xenia/kernel/{xam => }/xam_net.h (95%) rename src/xenia/kernel/{xam => }/xam_notify.cc (68%) rename src/xenia/kernel/{xam => }/xam_notify.h (95%) rename src/xenia/kernel/{xam => }/xam_ordinals.h (95%) rename src/xenia/kernel/{xam => }/xam_private.h (51%) rename src/xenia/kernel/{xam => }/xam_table.inc (100%) rename src/xenia/kernel/{xam => }/xam_user.cc (79%) rename src/xenia/kernel/{xam => }/xam_user.h (95%) rename src/xenia/kernel/{xam => }/xam_video.cc (67%) rename src/xenia/kernel/{xam => }/xam_video.h (95%) delete mode 100644 src/xenia/kernel/xboxkrnl/sources.gypi rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_audio.cc (92%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_audio.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_debug.cc (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_debug.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_hal.cc (86%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_hal.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_io.cc (95%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_io.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_memory.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_memory.h (96%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_misc.cc (85%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_misc.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_module.cc (82%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_module.h (63%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_modules.cc (95%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_modules.h (83%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_nt.cc (80%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_nt.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_ob.cc (88%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_ob.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_ordinals.h (94%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_private.h (86%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_rtl.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_rtl.h (97%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_table.inc (100%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_threading.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_threading.h (97%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_video.cc (98%) rename src/xenia/kernel/{xboxkrnl => }/xboxkrnl_video.h (97%) rename src/xenia/kernel/{xboxkrnl => }/xobject.cc (96%) rename src/xenia/kernel/{xboxkrnl => }/xobject.h (95%) diff --git a/src/xenia/cpu/xex_module.h b/src/xenia/cpu/xex_module.h index 96c7395af..68b0b5676 100644 --- a/src/xenia/cpu/xex_module.h +++ b/src/xenia/cpu/xex_module.h @@ -12,7 +12,7 @@ #include #include -#include +#include namespace xe { diff --git a/src/xenia/debug/protocols/ws/ws_client.cc b/src/xenia/debug/protocols/ws/ws_client.cc index 80ce8be00..4795a92d8 100644 --- a/src/xenia/debug/protocols/ws/ws_client.cc +++ b/src/xenia/debug/protocols/ws/ws_client.cc @@ -17,9 +17,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #if XE_PLATFORM(WIN32) // Required for wslay. @@ -32,7 +32,7 @@ using namespace std; using namespace xe; using namespace xe::debug; using namespace xe::debug::protocols::ws; -using namespace xe::kernel::xboxkrnl; +using namespace xe::kernel; WSClient::WSClient(DebugServer* debug_server, socket_t socket_id) : diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index a14aef311..1536f1a20 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -16,8 +16,9 @@ #include #include #include +#include #include -#include +#include using namespace xe; @@ -27,9 +28,7 @@ using namespace xe::debug; using namespace xe::gpu; using namespace xe::hid; using namespace xe::kernel; -using namespace xe::kernel::xam; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; Emulator::Emulator(const xechar_t* command_line) : @@ -38,7 +37,7 @@ Emulator::Emulator(const xechar_t* command_line) : processor_(0), audio_system_(0), graphics_system_(0), input_system_(0), export_resolver_(0), file_system_(0), - xboxkrnl_(0), xam_(0) { + kernel_state_(0), xam_(0), xboxkrnl_(0) { XEIGNORE(xestrcpy(command_line_, XECOUNT(command_line_), command_line)); } @@ -52,6 +51,7 @@ Emulator::~Emulator() { delete xam_; delete xboxkrnl_; + delete kernel_state_; delete file_system_; @@ -102,7 +102,7 @@ X_STATUS Emulator::Setup() { // Initialize the HID. input_system_ = xe::hid::Create(this); XEEXPECTNOTNULL(input_system_); - + // Setup the core components. result = processor_->Setup(); XEEXPECTZERO(result); @@ -117,10 +117,14 @@ X_STATUS Emulator::Setup() { file_system_ = new FileSystem(); XEEXPECTNOTNULL(file_system_); + // Shared kernel state. + kernel_state_ = new KernelState(this); + XEEXPECTNOTNULL(kernel_state_); + // HLE kernel modules. - xboxkrnl_ = new XboxkrnlModule(this); + xboxkrnl_ = new XboxkrnlModule(this, kernel_state_); XEEXPECTNOTNULL(xboxkrnl_); - xam_ = new XamModule(this); + xam_ = new XamModule(this, kernel_state_); XEEXPECTNOTNULL(xam_); // Prepare the debugger. diff --git a/src/xenia/emulator.h b/src/xenia/emulator.h index 104e95715..64293212f 100644 --- a/src/xenia/emulator.h +++ b/src/xenia/emulator.h @@ -21,9 +21,10 @@ XEDECLARECLASS2(xe, cpu, Processor); XEDECLARECLASS2(xe, debug, DebugServer); XEDECLARECLASS2(xe, gpu, GraphicsSystem); XEDECLARECLASS2(xe, hid, InputSystem); -XEDECLARECLASS3(xe, kernel, xam, XamModule); -XEDECLARECLASS3(xe, kernel, xboxkrnl, XboxkrnlModule); -XEDECLARECLASS4(xe, kernel, xboxkrnl, fs, FileSystem); +XEDECLARECLASS2(xe, kernel, KernelState); +XEDECLARECLASS2(xe, kernel, XamModule); +XEDECLARECLASS2(xe, kernel, XboxkrnlModule); +XEDECLARECLASS3(xe, kernel, fs, FileSystem); namespace xe { @@ -45,10 +46,10 @@ public: hid::InputSystem* input_system() const { return input_system_; } ExportResolver* export_resolver() const { return export_resolver_; } - kernel::xboxkrnl::fs::FileSystem* file_system() const { return file_system_; } + kernel::fs::FileSystem* file_system() const { return file_system_; } - kernel::xboxkrnl::XboxkrnlModule* xboxkrnl() const { return xboxkrnl_; } - kernel::xam::XamModule* xam() const { return xam_; } + kernel::XboxkrnlModule* xboxkrnl() const { return xboxkrnl_; } + kernel::XamModule* xam() const { return xam_; } X_STATUS Setup(); @@ -68,10 +69,11 @@ private: hid::InputSystem* input_system_; ExportResolver* export_resolver_; - kernel::xboxkrnl::fs::FileSystem* file_system_; + kernel::fs::FileSystem* file_system_; - kernel::xboxkrnl::XboxkrnlModule* xboxkrnl_; - kernel::xam::XamModule* xam_; + kernel::KernelState* kernel_state_; + kernel::XamModule* xam_; + kernel::XboxkrnlModule* xboxkrnl_; }; diff --git a/src/xenia/kernel/xboxkrnl/async_request.cc b/src/xenia/kernel/async_request.cc similarity index 86% rename from src/xenia/kernel/xboxkrnl/async_request.cc rename to src/xenia/kernel/async_request.cc index 06db3f9d0..9992ecdb7 100644 --- a/src/xenia/kernel/xboxkrnl/async_request.cc +++ b/src/xenia/kernel/async_request.cc @@ -7,16 +7,15 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace std; using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; XAsyncRequest::XAsyncRequest( diff --git a/src/xenia/kernel/xboxkrnl/async_request.h b/src/xenia/kernel/async_request.h similarity index 97% rename from src/xenia/kernel/xboxkrnl/async_request.h rename to src/xenia/kernel/async_request.h index 23f3fea9b..40317ea4a 100644 --- a/src/xenia/kernel/xboxkrnl/async_request.h +++ b/src/xenia/kernel/async_request.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { class KernelState; class XEvent; @@ -53,7 +52,6 @@ protected: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/fs/device.cc b/src/xenia/kernel/fs/device.cc similarity index 88% rename from src/xenia/kernel/xboxkrnl/fs/device.cc rename to src/xenia/kernel/fs/device.cc index 3c6bd2cc2..d49c56362 100644 --- a/src/xenia/kernel/xboxkrnl/fs/device.cc +++ b/src/xenia/kernel/fs/device.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; Device::Device(const char* path) { diff --git a/src/xenia/kernel/xboxkrnl/fs/device.h b/src/xenia/kernel/fs/device.h similarity index 79% rename from src/xenia/kernel/xboxkrnl/fs/device.h rename to src/xenia/kernel/fs/device.h index b73f0f699..8ad650202 100644 --- a/src/xenia/kernel/xboxkrnl/fs/device.h +++ b/src/xenia/kernel/fs/device.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICE_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICE_H_ +#ifndef XENIA_KERNEL_FS_DEVICE_H_ +#define XENIA_KERNEL_FS_DEVICE_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -37,9 +36,8 @@ protected: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICE_H_ +#endif // XENIA_KERNEL_FS_DEVICE_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.cc b/src/xenia/kernel/fs/devices/disc_image_device.cc similarity index 92% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.cc rename to src/xenia/kernel/fs/devices/disc_image_device.cc index 4f4b6263c..ca19c5663 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.cc +++ b/src/xenia/kernel/fs/devices/disc_image_device.cc @@ -7,15 +7,15 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.h b/src/xenia/kernel/fs/devices/disc_image_device.h similarity index 77% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.h rename to src/xenia/kernel/fs/devices/disc_image_device.h index 8ac834192..361affda0 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_device.h +++ b/src/xenia/kernel/fs/devices/disc_image_device.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ +#define XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -42,9 +41,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ +#endif // XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.cc b/src/xenia/kernel/fs/devices/disc_image_entry.cc similarity index 90% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.cc rename to src/xenia/kernel/fs/devices/disc_image_entry.cc index 3c217daa7..f912d7023 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.cc +++ b/src/xenia/kernel/fs/devices/disc_image_entry.cc @@ -7,16 +7,15 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; namespace { diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.h b/src/xenia/kernel/fs/devices/disc_image_entry.h similarity index 82% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.h rename to src/xenia/kernel/fs/devices/disc_image_entry.h index 299a33a8b..62ae542cf 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.h +++ b/src/xenia/kernel/fs/devices/disc_image_entry.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ +#define XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { class GDFXEntry; @@ -50,9 +49,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ +#endif // XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_ENTRY_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.cc b/src/xenia/kernel/fs/devices/disc_image_file.cc similarity index 84% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.cc rename to src/xenia/kernel/fs/devices/disc_image_file.cc index 1575e67a2..a6285a7b3 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.cc +++ b/src/xenia/kernel/fs/devices/disc_image_file.cc @@ -7,16 +7,15 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; DiscImageFile::DiscImageFile( diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.h b/src/xenia/kernel/fs/devices/disc_image_file.h similarity index 79% rename from src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.h rename to src/xenia/kernel/fs/devices/disc_image_file.h index 5b77e1c3c..d6d5c6440 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/disc_image_file.h +++ b/src/xenia/kernel/fs/devices/disc_image_file.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_FILE_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_FILE_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_FILE_H_ +#define XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_FILE_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { class DiscImageEntry; @@ -43,9 +42,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_DISC_IMAGE_FILE_H_ +#endif // XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_FILE_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.cc b/src/xenia/kernel/fs/devices/host_path_device.cc similarity index 91% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.cc rename to src/xenia/kernel/fs/devices/host_path_device.cc index 1b334afc2..70e863206 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.cc +++ b/src/xenia/kernel/fs/devices/host_path_device.cc @@ -7,14 +7,14 @@ ****************************************************************************** */ -#include +#include -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; HostPathDevice::HostPathDevice(const char* path, const xechar_t* local_path) : diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.h b/src/xenia/kernel/fs/devices/host_path_device.h similarity index 76% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.h rename to src/xenia/kernel/fs/devices/host_path_device.h index 20319f2f4..b45080459 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_device.h +++ b/src/xenia/kernel/fs/devices/host_path_device.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_DEVICE_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_DEVICE_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_HOST_PATH_DEVICE_H_ +#define XENIA_KERNEL_FS_DEVICES_HOST_PATH_DEVICE_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -35,9 +34,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_DEVICE_H_ +#endif // XENIA_KERNEL_FS_DEVICES_HOST_PATH_DEVICE_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.cc b/src/xenia/kernel/fs/devices/host_path_entry.cc similarity index 93% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.cc rename to src/xenia/kernel/fs/devices/host_path_entry.cc index b0fd1c5ad..9e481529e 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.cc +++ b/src/xenia/kernel/fs/devices/host_path_entry.cc @@ -7,15 +7,14 @@ ****************************************************************************** */ -#include +#include -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; namespace { diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.h b/src/xenia/kernel/fs/devices/host_path_entry.h similarity index 81% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.h rename to src/xenia/kernel/fs/devices/host_path_entry.h index 2cdc5aec0..d46a54f04 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_entry.h +++ b/src/xenia/kernel/fs/devices/host_path_entry.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_ENTRY_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_ENTRY_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_HOST_PATH_ENTRY_H_ +#define XENIA_KERNEL_FS_DEVICES_HOST_PATH_ENTRY_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -46,9 +45,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_ENTRY_H_ +#endif // XENIA_KERNEL_FS_DEVICES_HOST_PATH_ENTRY_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.cc b/src/xenia/kernel/fs/devices/host_path_file.cc similarity index 87% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.cc rename to src/xenia/kernel/fs/devices/host_path_file.cc index 850b73103..c1daebade 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.cc +++ b/src/xenia/kernel/fs/devices/host_path_file.cc @@ -7,15 +7,14 @@ ****************************************************************************** */ -#include +#include -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; HostPathFile::HostPathFile( diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.h b/src/xenia/kernel/fs/devices/host_path_file.h similarity index 80% rename from src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.h rename to src/xenia/kernel/fs/devices/host_path_file.h index 8de3e7786..690ad19d5 100644 --- a/src/xenia/kernel/xboxkrnl/fs/devices/host_path_file.h +++ b/src/xenia/kernel/fs/devices/host_path_file.h @@ -7,18 +7,17 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_FILE_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_FILE_H_ +#ifndef XENIA_KERNEL_FS_DEVICES_HOST_PATH_FILE_H_ +#define XENIA_KERNEL_FS_DEVICES_HOST_PATH_FILE_H_ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { class HostPathEntry; @@ -44,9 +43,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_DEVICES_HOST_PATH_FILE_H_ +#endif // XENIA_KERNEL_FS_DEVICES_HOST_PATH_FILE_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/devices/sources.gypi b/src/xenia/kernel/fs/devices/sources.gypi similarity index 100% rename from src/xenia/kernel/xboxkrnl/fs/devices/sources.gypi rename to src/xenia/kernel/fs/devices/sources.gypi diff --git a/src/xenia/kernel/xboxkrnl/fs/entry.cc b/src/xenia/kernel/fs/entry.cc similarity index 91% rename from src/xenia/kernel/xboxkrnl/fs/entry.cc rename to src/xenia/kernel/fs/entry.cc index e5341eed9..970a673ba 100644 --- a/src/xenia/kernel/xboxkrnl/fs/entry.cc +++ b/src/xenia/kernel/fs/entry.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; MemoryMapping::MemoryMapping(uint8_t* address, size_t length) : diff --git a/src/xenia/kernel/xboxkrnl/fs/entry.h b/src/xenia/kernel/fs/entry.h similarity index 83% rename from src/xenia/kernel/xboxkrnl/fs/entry.h rename to src/xenia/kernel/fs/entry.h index 50d1869ce..3dde308fe 100644 --- a/src/xenia/kernel/xboxkrnl/fs/entry.h +++ b/src/xenia/kernel/fs/entry.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_ENTRY_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_ENTRY_H_ +#ifndef XENIA_KERNEL_FS_ENTRY_H_ +#define XENIA_KERNEL_FS_ENTRY_H_ #include #include @@ -16,14 +16,13 @@ #include -XEDECLARECLASS3(xe, kernel, xboxkrnl, KernelState); -XEDECLARECLASS3(xe, kernel, xboxkrnl, XFile); -XEDECLARECLASS3(xe, kernel, xboxkrnl, XFileInfo); +XEDECLARECLASS2(xe, kernel, KernelState); +XEDECLARECLASS2(xe, kernel, XFile); +XEDECLARECLASS2(xe, kernel, XFileInfo); namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { class Device; @@ -77,9 +76,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_ENTRY_H_ +#endif // XENIA_KERNEL_FS_ENTRY_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/filesystem.cc b/src/xenia/kernel/fs/filesystem.cc similarity index 94% rename from src/xenia/kernel/xboxkrnl/fs/filesystem.cc rename to src/xenia/kernel/fs/filesystem.cc index 72e5bd08b..1922c49ff 100644 --- a/src/xenia/kernel/xboxkrnl/fs/filesystem.cc +++ b/src/xenia/kernel/fs/filesystem.cc @@ -7,15 +7,15 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; FileSystem::FileSystem() { diff --git a/src/xenia/kernel/xboxkrnl/fs/filesystem.h b/src/xenia/kernel/fs/filesystem.h similarity index 83% rename from src/xenia/kernel/xboxkrnl/fs/filesystem.h rename to src/xenia/kernel/fs/filesystem.h index 98f96c6ba..2a28217a7 100644 --- a/src/xenia/kernel/xboxkrnl/fs/filesystem.h +++ b/src/xenia/kernel/fs/filesystem.h @@ -7,20 +7,19 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_FILESYSTEM_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_FILESYSTEM_H_ +#ifndef XENIA_KERNEL_FS_FILESYSTEM_H_ +#define XENIA_KERNEL_FS_FILESYSTEM_H_ #include #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -48,9 +47,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_FILESYSTEM_H_ +#endif // XENIA_KERNEL_FS_FILESYSTEM_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/gdfx.cc b/src/xenia/kernel/fs/gdfx.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/fs/gdfx.cc rename to src/xenia/kernel/fs/gdfx.cc index b19e349cf..a373397a8 100644 --- a/src/xenia/kernel/xboxkrnl/fs/gdfx.cc +++ b/src/xenia/kernel/fs/gdfx.cc @@ -9,12 +9,12 @@ * - abgx360 */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; namespace { diff --git a/src/xenia/kernel/xboxkrnl/fs/gdfx.h b/src/xenia/kernel/fs/gdfx.h similarity index 90% rename from src/xenia/kernel/xboxkrnl/fs/gdfx.h rename to src/xenia/kernel/fs/gdfx.h index 227e978c7..b6727044f 100644 --- a/src/xenia/kernel/xboxkrnl/fs/gdfx.h +++ b/src/xenia/kernel/fs/gdfx.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_FS_GDFX_H_ -#define XENIA_KERNEL_XBOXKRNL_FS_GDFX_H_ +#ifndef XENIA_KERNEL_FS_GDFX_H_ +#define XENIA_KERNEL_FS_GDFX_H_ #include #include @@ -16,12 +16,11 @@ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { namespace fs { @@ -90,9 +89,8 @@ private: } // namespace fs -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_FS_GDFX_H_ +#endif // XENIA_KERNEL_FS_GDFX_H_ diff --git a/src/xenia/kernel/xboxkrnl/fs/sources.gypi b/src/xenia/kernel/fs/sources.gypi similarity index 100% rename from src/xenia/kernel/xboxkrnl/fs/sources.gypi rename to src/xenia/kernel/fs/sources.gypi diff --git a/src/xenia/kernel/kernel_module.cc b/src/xenia/kernel/kernel_module.cc index 83c507d3e..da4a48a20 100644 --- a/src/xenia/kernel/kernel_module.cc +++ b/src/xenia/kernel/kernel_module.cc @@ -17,8 +17,9 @@ using namespace xe; using namespace xe::kernel; -KernelModule::KernelModule(Emulator* emulator) : - emulator_(emulator), memory_(emulator->memory()) { +KernelModule::KernelModule(Emulator* emulator, KernelState* kernel_state) : + emulator_(emulator), kernel_state_(kernel_state), + memory_(emulator->memory()) { export_resolver_ = emulator->export_resolver(); } diff --git a/src/xenia/kernel/kernel_module.h b/src/xenia/kernel/kernel_module.h index 60053117e..36071dd1c 100644 --- a/src/xenia/kernel/kernel_module.h +++ b/src/xenia/kernel/kernel_module.h @@ -16,6 +16,7 @@ XEDECLARECLASS1(xe, Emulator); XEDECLARECLASS1(xe, ExportResolver); +XEDECLARECLASS2(xe, kernel, KernelState); namespace xe { @@ -24,11 +25,15 @@ namespace kernel { class KernelModule { public: - KernelModule(Emulator* emulator); + KernelModule(Emulator* emulator, KernelState* kernel_state); virtual ~KernelModule(); + Emulator* emulator() const { return emulator_; } + KernelState* kernel_state() const { return kernel_state_; } + protected: Emulator* emulator_; + KernelState* kernel_state_; Memory* memory_; ExportResolver* export_resolver_; }; diff --git a/src/xenia/kernel/xboxkrnl/kernel_state.cc b/src/xenia/kernel/kernel_state.cc similarity index 74% rename from src/xenia/kernel/xboxkrnl/kernel_state.cc rename to src/xenia/kernel/kernel_state.cc index d187be0f7..c73a78eab 100644 --- a/src/xenia/kernel/xboxkrnl/kernel_state.cc +++ b/src/xenia/kernel/kernel_state.cc @@ -7,18 +7,23 @@ ****************************************************************************** */ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; + + +// This is a global object initialized with the XboxkrnlModule. +// It references the current kernel state object that all kernel methods should +// be using to stash their variables. +KernelState* xe::kernel::shared_kernel_state_ = NULL; KernelState::KernelState(Emulator* emulator) : @@ -29,6 +34,9 @@ KernelState::KernelState(Emulator* emulator) : object_table_ = new ObjectTable(); object_mutex_ = xe_mutex_alloc(10000); + + XEASSERTNULL(shared_kernel_state_); + shared_kernel_state_ = this; } KernelState::~KernelState() { @@ -37,6 +45,9 @@ KernelState::~KernelState() { // Delete all objects. xe_mutex_free(object_mutex_); delete object_table_; + + XEASSERT(shared_kernel_state_ == this); + shared_kernel_state_ = NULL; } KernelState* KernelState::shared() { diff --git a/src/xenia/kernel/xboxkrnl/kernel_state.h b/src/xenia/kernel/kernel_state.h similarity index 76% rename from src/xenia/kernel/xboxkrnl/kernel_state.h rename to src/xenia/kernel/kernel_state.h index 19b2bd7a4..ebca4c0a0 100644 --- a/src/xenia/kernel/xboxkrnl/kernel_state.h +++ b/src/xenia/kernel/kernel_state.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_KERNEL_STATE_H_ -#define XENIA_KERNEL_XBOXKRNL_KERNEL_STATE_H_ +#ifndef XENIA_KERNEL_KERNEL_STATE_H_ +#define XENIA_KERNEL_KERNEL_STATE_H_ #include #include @@ -16,18 +16,17 @@ #include #include #include -#include -#include +#include +#include XEDECLARECLASS2(xe, cpu, Processor); +XEDECLARECLASS2(xe, kernel, XModule); XEDECLARECLASS3(xe, kernel, fs, FileSystem); -XEDECLARECLASS3(xe, kernel, xboxkrnl, XModule); namespace xe { namespace kernel { -namespace xboxkrnl { class KernelState { @@ -63,9 +62,15 @@ private: }; -} // namespace xboxkrnl +// This is a global object initialized with the KernelState ctor. +// It references the current kernel state object that all kernel methods should +// be using to stash their variables. +// This sucks, but meh. +extern KernelState* shared_kernel_state_; + + } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_KERNEL_STATE_H_ +#endif // XENIA_KERNEL_KERNEL_STATE_H_ diff --git a/src/xenia/kernel/modules.h b/src/xenia/kernel/modules.h index 439134680..45e5817e8 100644 --- a/src/xenia/kernel/modules.h +++ b/src/xenia/kernel/modules.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_MODULES_H_ #define XENIA_KERNEL_MODULES_H_ -#include -#include +#include +#include #endif // XENIA_KERNEL_MODULES_H_ diff --git a/src/xenia/kernel/xboxkrnl/object_table.cc b/src/xenia/kernel/object_table.cc similarity index 96% rename from src/xenia/kernel/xboxkrnl/object_table.cc rename to src/xenia/kernel/object_table.cc index 9df618e7d..495656410 100644 --- a/src/xenia/kernel/xboxkrnl/object_table.cc +++ b/src/xenia/kernel/object_table.cc @@ -7,15 +7,14 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; ObjectTable::ObjectTable() : diff --git a/src/xenia/kernel/xboxkrnl/object_table.h b/src/xenia/kernel/object_table.h similarity index 96% rename from src/xenia/kernel/xboxkrnl/object_table.h rename to src/xenia/kernel/object_table.h index 7082c754e..c62f7f02f 100644 --- a/src/xenia/kernel/xboxkrnl/object_table.h +++ b/src/xenia/kernel/object_table.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { class XObject; @@ -47,7 +46,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/sources.gypi b/src/xenia/kernel/objects/sources.gypi similarity index 100% rename from src/xenia/kernel/xboxkrnl/objects/sources.gypi rename to src/xenia/kernel/objects/sources.gypi diff --git a/src/xenia/kernel/xboxkrnl/objects/xevent.cc b/src/xenia/kernel/objects/xevent.cc similarity index 96% rename from src/xenia/kernel/xboxkrnl/objects/xevent.cc rename to src/xenia/kernel/objects/xevent.cc index 7fb88a9ec..6d8997fc4 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xevent.cc +++ b/src/xenia/kernel/objects/xevent.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; XEvent::XEvent(KernelState* kernel_state) : diff --git a/src/xenia/kernel/xboxkrnl/objects/xevent.h b/src/xenia/kernel/objects/xevent.h similarity index 93% rename from src/xenia/kernel/xboxkrnl/objects/xevent.h rename to src/xenia/kernel/objects/xevent.h index ec45d2352..c8401e4e8 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xevent.h +++ b/src/xenia/kernel/objects/xevent.h @@ -10,14 +10,13 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XEVENT_H_ #define XENIA_KERNEL_XBOXKRNL_XEVENT_H_ -#include +#include #include namespace xe { namespace kernel { -namespace xboxkrnl { class XEvent : public XObject { @@ -40,7 +39,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/xfile.cc b/src/xenia/kernel/objects/xfile.cc similarity index 91% rename from src/xenia/kernel/xboxkrnl/objects/xfile.cc rename to src/xenia/kernel/objects/xfile.cc index f508273f4..6b07529d7 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xfile.cc +++ b/src/xenia/kernel/objects/xfile.cc @@ -7,15 +7,14 @@ ****************************************************************************** */ -#include +#include -#include -#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; XFile::XFile(KernelState* kernel_state, uint32_t desired_access) : diff --git a/src/xenia/kernel/xboxkrnl/objects/xfile.h b/src/xenia/kernel/objects/xfile.h similarity index 96% rename from src/xenia/kernel/xboxkrnl/objects/xfile.h rename to src/xenia/kernel/objects/xfile.h index 3dfd4ad93..6a00cbf6d 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xfile.h +++ b/src/xenia/kernel/objects/xfile.h @@ -10,14 +10,13 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XFILE_H_ #define XENIA_KERNEL_XBOXKRNL_XFILE_H_ -#include +#include #include namespace xe { namespace kernel { -namespace xboxkrnl { class XAsyncRequest; class XEvent; @@ -79,7 +78,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/xmodule.cc b/src/xenia/kernel/objects/xmodule.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/objects/xmodule.cc rename to src/xenia/kernel/objects/xmodule.cc index f8a08f90d..ebfb79ae8 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xmodule.cc +++ b/src/xenia/kernel/objects/xmodule.cc @@ -7,17 +7,16 @@ ****************************************************************************** */ -#include +#include #include #include -#include +#include using namespace xe; using namespace xe::cpu; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; namespace { diff --git a/src/xenia/kernel/xboxkrnl/objects/xmodule.h b/src/xenia/kernel/objects/xmodule.h similarity index 92% rename from src/xenia/kernel/xboxkrnl/objects/xmodule.h rename to src/xenia/kernel/objects/xmodule.h index 505304d50..8b4900470 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xmodule.h +++ b/src/xenia/kernel/objects/xmodule.h @@ -10,18 +10,17 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XMODULE_H_ #define XENIA_KERNEL_XBOXKRNL_XMODULE_H_ -#include +#include #include #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { class XModule : public XObject { @@ -54,7 +53,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/xnotify_listener.cc b/src/xenia/kernel/objects/xnotify_listener.cc similarity index 97% rename from src/xenia/kernel/xboxkrnl/objects/xnotify_listener.cc rename to src/xenia/kernel/objects/xnotify_listener.cc index b78bd8e48..afc8d7e71 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xnotify_listener.cc +++ b/src/xenia/kernel/objects/xnotify_listener.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; XNotifyListener::XNotifyListener(KernelState* kernel_state) : diff --git a/src/xenia/kernel/xboxkrnl/objects/xnotify_listener.h b/src/xenia/kernel/objects/xnotify_listener.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/objects/xnotify_listener.h rename to src/xenia/kernel/objects/xnotify_listener.h index 3c2d02be9..f5248c5fd 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xnotify_listener.h +++ b/src/xenia/kernel/objects/xnotify_listener.h @@ -13,14 +13,13 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_ #define XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_ -#include +#include #include namespace xe { namespace kernel { -namespace xboxkrnl { // Values seem to be all over the place - GUIDs? typedef uint32_t XNotificationID; @@ -49,7 +48,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/xsemaphore.cc b/src/xenia/kernel/objects/xsemaphore.cc similarity index 96% rename from src/xenia/kernel/xboxkrnl/objects/xsemaphore.cc rename to src/xenia/kernel/objects/xsemaphore.cc index f41204d6a..1f22f5c7d 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xsemaphore.cc +++ b/src/xenia/kernel/objects/xsemaphore.cc @@ -7,12 +7,11 @@ ****************************************************************************** */ -#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; XSemaphore::XSemaphore(KernelState* kernel_state) : diff --git a/src/xenia/kernel/xboxkrnl/objects/xsemaphore.h b/src/xenia/kernel/objects/xsemaphore.h similarity index 93% rename from src/xenia/kernel/xboxkrnl/objects/xsemaphore.h rename to src/xenia/kernel/objects/xsemaphore.h index 5eb99fc1f..397eb1764 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xsemaphore.h +++ b/src/xenia/kernel/objects/xsemaphore.h @@ -10,14 +10,13 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_ #define XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_ -#include +#include #include namespace xe { namespace kernel { -namespace xboxkrnl { class XSemaphore : public XObject { @@ -38,7 +37,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/objects/xthread.cc b/src/xenia/kernel/objects/xthread.cc similarity index 97% rename from src/xenia/kernel/xboxkrnl/objects/xthread.cc rename to src/xenia/kernel/objects/xthread.cc index 5d097590a..8901d85c7 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xthread.cc +++ b/src/xenia/kernel/objects/xthread.cc @@ -7,19 +7,18 @@ ****************************************************************************** */ -#include +#include #include -#include -#include -#include +#include +#include +#include using namespace alloy; using namespace xe; using namespace xe::cpu; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; namespace { diff --git a/src/xenia/kernel/xboxkrnl/objects/xthread.h b/src/xenia/kernel/objects/xthread.h similarity index 96% rename from src/xenia/kernel/xboxkrnl/objects/xthread.h rename to src/xenia/kernel/objects/xthread.h index bd46ce240..05fc13783 100644 --- a/src/xenia/kernel/xboxkrnl/objects/xthread.h +++ b/src/xenia/kernel/objects/xthread.h @@ -10,7 +10,7 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XTHREAD_H_ #define XENIA_KERNEL_XBOXKRNL_XTHREAD_H_ -#include +#include #include @@ -24,7 +24,6 @@ class XenonThreadState; namespace xe { namespace kernel { -namespace xboxkrnl { class XEvent; @@ -90,7 +89,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/sources.gypi b/src/xenia/kernel/sources.gypi index 9bd4b8283..958140447 100644 --- a/src/xenia/kernel/sources.gypi +++ b/src/xenia/kernel/sources.gypi @@ -1,19 +1,71 @@ # Copyright 2013 Ben Vanik. All Rights Reserved. { 'sources': [ + 'async_request.cc', + 'async_request.h', 'kernel.h', 'kernel_module.cc', 'kernel_module.h', + 'kernel_state.cc', + 'kernel_state.h', 'modules.h', - 'shim_utils.h', - 'xex2.cc', - 'xex2.h', - 'xex2_info.h', + 'object_table.cc', + 'object_table.h', + 'xam_content.cc', + 'xam_content.h', + 'xam_info.cc', + 'xam_info.h', + 'xam_input.cc', + 'xam_input.h', + 'xam_module.cc', + 'xam_module.h', + 'xam_net.cc', + 'xam_net.h', + 'xam_notify.cc', + 'xam_notify.h', + 'xam_ordinals.h', + 'xam_private.h', + 'xam_table.inc', + 'xam_user.cc', + 'xam_user.h', + 'xam_video.cc', + 'xam_video.h', + 'xboxkrnl_audio.cc', + 'xboxkrnl_audio.h', + 'xboxkrnl_debug.cc', + 'xboxkrnl_debug.h', + 'xboxkrnl_hal.cc', + 'xboxkrnl_hal.h', + 'xboxkrnl_io.cc', + 'xboxkrnl_io.h', + 'xboxkrnl_memory.cc', + 'xboxkrnl_memory.h', + 'xboxkrnl_misc.cc', + 'xboxkrnl_misc.h', + 'xboxkrnl_module.cc', + 'xboxkrnl_module.h', + 'xboxkrnl_modules.cc', + 'xboxkrnl_modules.h', + 'xboxkrnl_nt.cc', + 'xboxkrnl_nt.h', + 'xboxkrnl_ob.cc', + 'xboxkrnl_ob.h', + 'xboxkrnl_ordinals.h', + 'xboxkrnl_private.h', + 'xboxkrnl_rtl.cc', + 'xboxkrnl_rtl.h', + 'xboxkrnl_table.inc', + 'xboxkrnl_threading.cc', + 'xboxkrnl_threading.h', + 'xboxkrnl_video.cc', + 'xboxkrnl_video.h', + 'xobject.cc', + 'xobject.h', ], 'includes': [ - 'xam/sources.gypi', - 'xboxkrnl/sources.gypi', + 'fs/sources.gypi', + 'objects/sources.gypi', 'util/sources.gypi', ], } diff --git a/src/xenia/kernel/shim_utils.h b/src/xenia/kernel/util/shim_utils.h similarity index 95% rename from src/xenia/kernel/shim_utils.h rename to src/xenia/kernel/util/shim_utils.h index 1a7661066..9d6108b6c 100644 --- a/src/xenia/kernel/shim_utils.h +++ b/src/xenia/kernel/util/shim_utils.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_SHIM_UTILS_H_ -#define XENIA_KERNEL_SHIM_UTILS_H_ +#ifndef XENIA_KERNEL_UTIL_SHIM_UTILS_H_ +#define XENIA_KERNEL_UTIL_SHIM_UTILS_H_ #include #include @@ -66,4 +66,4 @@ using PPCContext = alloy::frontend::ppc::PPCContext; } // namespace xe -#endif // XENIA_KERNEL_SHIM_UTILS_H_ +#endif // XENIA_KERNEL_UTIL_SHIM_UTILS_H_ diff --git a/src/xenia/kernel/util/sources.gypi b/src/xenia/kernel/util/sources.gypi index 88a3cb0bb..a0ce434bb 100644 --- a/src/xenia/kernel/util/sources.gypi +++ b/src/xenia/kernel/util/sources.gypi @@ -5,5 +5,9 @@ 'export_table_pre.inc', 'ordinal_table_post.inc', 'ordinal_table_pre.inc', + 'shim_utils.h', + 'xex2.cc', + 'xex2.h', + 'xex2_info.h', ], } diff --git a/src/xenia/kernel/xex2.cc b/src/xenia/kernel/util/xex2.cc similarity index 99% rename from src/xenia/kernel/xex2.cc rename to src/xenia/kernel/util/xex2.cc index e31814f03..2ce3a4c55 100644 --- a/src/xenia/kernel/xex2.cc +++ b/src/xenia/kernel/util/xex2.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include +#include #include diff --git a/src/xenia/kernel/xex2.h b/src/xenia/kernel/util/xex2.h similarity index 93% rename from src/xenia/kernel/xex2.h rename to src/xenia/kernel/util/xex2.h index d9793a442..4e865bd5d 100644 --- a/src/xenia/kernel/xex2.h +++ b/src/xenia/kernel/util/xex2.h @@ -7,11 +7,11 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XEX2_H_ -#define XENIA_KERNEL_XEX2_H_ +#ifndef XENIA_KERNEL_UTIL_XEX2_H_ +#define XENIA_KERNEL_UTIL_XEX2_H_ #include -#include +#include typedef struct { int reserved; @@ -61,4 +61,4 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex, size_t *out_import_info_count); -#endif // XENIA_KERNEL_XEX2_H_ +#endif // XENIA_KERNEL_UTIL_XEX2_H_ diff --git a/src/xenia/kernel/xex2_info.h b/src/xenia/kernel/util/xex2_info.h similarity index 100% rename from src/xenia/kernel/xex2_info.h rename to src/xenia/kernel/util/xex2_info.h diff --git a/src/xenia/kernel/xam/sources.gypi b/src/xenia/kernel/xam/sources.gypi deleted file mode 100644 index d12a381dd..000000000 --- a/src/xenia/kernel/xam/sources.gypi +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2013 Ben Vanik. All Rights Reserved. -{ - 'sources': [ - 'xam_content.cc', - 'xam_content.h', - 'xam_info.cc', - 'xam_info.h', - 'xam_input.cc', - 'xam_input.h', - 'xam_module.cc', - 'xam_module.h', - 'xam_net.cc', - 'xam_net.h', - 'xam_notify.cc', - 'xam_notify.h', - 'xam_ordinals.h', - 'xam_private.h', - 'xam_state.cc', - 'xam_state.h', - 'xam_table.inc', - 'xam_user.cc', - 'xam_user.h', - 'xam_video.cc', - 'xam_video.h', - ], -} diff --git a/src/xenia/kernel/xam/xam_state.cc b/src/xenia/kernel/xam/xam_state.cc deleted file mode 100644 index 1331f69e7..000000000 --- a/src/xenia/kernel/xam/xam_state.cc +++ /dev/null @@ -1,31 +0,0 @@ -/** - ****************************************************************************** - * 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 - -#include - - -using namespace xe; -using namespace xe::kernel; -using namespace xe::kernel::xam; - - -namespace { - -} - - -XamState::XamState(Emulator* emulator) : - emulator_(emulator), memory_(emulator->memory()), - export_resolver_(emulator->export_resolver()) { -} - -XamState::~XamState() { -} diff --git a/src/xenia/kernel/xam/xam_state.h b/src/xenia/kernel/xam/xam_state.h deleted file mode 100644 index c152e4b5b..000000000 --- a/src/xenia/kernel/xam/xam_state.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * Xenia : Xbox 360 Emulator Research Project * - ****************************************************************************** - * Copyright 2013 Ben Vanik. All rights reserved. * - * Released under the BSD license - see LICENSE in the root for more details. * - ****************************************************************************** - */ - -#ifndef XENIA_KERNEL_XAM_XAM_STATE_H_ -#define XENIA_KERNEL_XAM_XAM_STATE_H_ - -#include -#include - -#include -#include - - -namespace xe { -namespace kernel { -namespace xam { - - -class XamState { -public: - XamState(Emulator* emulator); - ~XamState(); - - Emulator* emulator() const { return emulator_; } - Memory* memory() const { return memory_; } - -private: - Emulator* emulator_; - Memory* memory_; - ExportResolver* export_resolver_; -}; - - -} // namespace xam -} // namespace kernel -} // namespace xe - - -#endif // XENIA_KERNEL_XAM_XAM_STATE_H_ diff --git a/src/xenia/kernel/xam/xam_content.cc b/src/xenia/kernel/xam_content.cc similarity index 77% rename from src/xenia/kernel/xam/xam_content.cc rename to src/xenia/kernel/xam_content.cc index ed5eec6e8..cdae8ba01 100644 --- a/src/xenia/kernel/xam/xam_content.cc +++ b/src/xenia/kernel/xam_content.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -21,11 +21,10 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { SHIM_CALL XamContentGetLicenseMask_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t unk0_ptr = SHIM_GET_ARG_32(0); uint32_t unk1_ptr = SHIM_GET_ARG_32(1); @@ -38,12 +37,11 @@ SHIM_CALL XamContentGetLicenseMask_shim( } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterContentExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XamContentGetLicenseMask, state); } diff --git a/src/xenia/kernel/xam/xam_content.h b/src/xenia/kernel/xam_content.h similarity index 95% rename from src/xenia/kernel/xam/xam_content.h rename to src/xenia/kernel/xam_content.h index 42aad6660..6cd6c7e2e 100644 --- a/src/xenia/kernel/xam/xam_content.h +++ b/src/xenia/kernel/xam_content.h @@ -18,12 +18,10 @@ namespace xe { namespace kernel { -namespace xam { -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_info.cc b/src/xenia/kernel/xam_info.cc similarity index 82% rename from src/xenia/kernel/xam/xam_info.cc rename to src/xenia/kernel/xam_info.cc index 488f8fcf7..35188e729 100644 --- a/src/xenia/kernel/xam/xam_info.cc +++ b/src/xenia/kernel/xam_info.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; @@ -22,11 +22,10 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { SHIM_CALL XamGetSystemVersion_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { XELOGD("XamGetSystemVersion()"); // eh, just picking one. If we go too low we may break new games, but // this value seems to be used for conditionally loading symbols and if @@ -38,7 +37,7 @@ SHIM_CALL XamGetSystemVersion_shim( SHIM_CALL XGetAVPack_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { // DWORD // Not sure what the values are for this, but 6 is VGA. // Other likely values are 3/4/8 for HDMI or something. @@ -49,7 +48,7 @@ SHIM_CALL XGetAVPack_shim( SHIM_CALL XGetGameRegion_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { XELOGD("XGetGameRegion()"); SHIM_SET_RETURN(XEX_REGION_ALL); @@ -57,7 +56,7 @@ SHIM_CALL XGetGameRegion_shim( SHIM_CALL XGetLanguage_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { XELOGD("XGetLanguage()"); uint32_t desired_language = X_LANGUAGE_ENGLISH; @@ -76,13 +75,12 @@ SHIM_CALL XGetLanguage_shim( } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterInfoExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XamGetSystemVersion, state); SHIM_SET_MAPPING("xam.xex", XGetAVPack, state); SHIM_SET_MAPPING("xam.xex", XGetGameRegion, state); diff --git a/src/xenia/kernel/xam/xam_info.h b/src/xenia/kernel/xam_info.h similarity index 95% rename from src/xenia/kernel/xam/xam_info.h rename to src/xenia/kernel/xam_info.h index e786c71d2..7757d18c2 100644 --- a/src/xenia/kernel/xam/xam_info.h +++ b/src/xenia/kernel/xam_info.h @@ -18,12 +18,10 @@ namespace xe { namespace kernel { -namespace xam { -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_input.cc b/src/xenia/kernel/xam_input.cc similarity index 88% rename from src/xenia/kernel/xam/xam_input.cc rename to src/xenia/kernel/xam_input.cc index 57b7d74c3..884b6e187 100644 --- a/src/xenia/kernel/xam/xam_input.cc +++ b/src/xenia/kernel/xam_input.cc @@ -7,13 +7,13 @@ ****************************************************************************** */ -#include +#include #include #include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -24,12 +24,11 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetcapabilities(v=vs.85).aspx SHIM_CALL XamInputGetCapabilities_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t user_index = SHIM_GET_ARG_32(0); uint32_t flags = SHIM_GET_ARG_32(1); uint32_t caps_ptr = SHIM_GET_ARG_32(2); @@ -58,7 +57,7 @@ SHIM_CALL XamInputGetCapabilities_shim( // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetstate(v=vs.85).aspx SHIM_CALL XamInputGetState_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t user_index = SHIM_GET_ARG_32(0); uint32_t state_ptr = SHIM_GET_ARG_32(1); @@ -85,7 +84,7 @@ SHIM_CALL XamInputGetState_shim( // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputsetstate(v=vs.85).aspx SHIM_CALL XamInputSetState_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t user_index = SHIM_GET_ARG_32(0); uint32_t vibration_ptr = SHIM_GET_ARG_32(1); @@ -107,13 +106,12 @@ SHIM_CALL XamInputSetState_shim( } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterInputExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XamInputGetCapabilities, state); SHIM_SET_MAPPING("xam.xex", XamInputGetState, state); SHIM_SET_MAPPING("xam.xex", XamInputSetState, state); diff --git a/src/xenia/kernel/xam/xam_input.h b/src/xenia/kernel/xam_input.h similarity index 95% rename from src/xenia/kernel/xam/xam_input.h rename to src/xenia/kernel/xam_input.h index cfd0d771f..43ab24342 100644 --- a/src/xenia/kernel/xam/xam_input.h +++ b/src/xenia/kernel/xam_input.h @@ -18,12 +18,10 @@ namespace xe { namespace kernel { -namespace xam { -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_module.cc b/src/xenia/kernel/xam_module.cc similarity index 51% rename from src/xenia/kernel/xam/xam_module.cc rename to src/xenia/kernel/xam_module.cc index e3ff3b3f2..2139e702b 100644 --- a/src/xenia/kernel/xam/xam_module.cc +++ b/src/xenia/kernel/xam_module.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include #include -#include -#include +#include +#include using namespace xe; @@ -19,38 +19,26 @@ using namespace xe::kernel; using namespace xe::kernel::xam; -XamState* xe::kernel::xam::shared_xam_state_ = NULL; - - -XamModule::XamModule(Emulator* emulator) : - KernelModule(emulator) { +XamModule::XamModule(Emulator* emulator, KernelState* kernel_state) : + KernelModule(emulator, kernel_state) { // Build the export table used for resolution. #include static KernelExport xam_export_table[] = { - #include + #include }; #include export_resolver_->RegisterTable( "xam.xex", xam_export_table, XECOUNT(xam_export_table)); - // Setup the xam state instance. - xam_state_ = new XamState(emulator); - - // Setup the shared global state object. - XEASSERTNULL(shared_xam_state_); - shared_xam_state_ = xam_state_; - // Register all exported functions. - RegisterContentExports(export_resolver_, xam_state_); - RegisterInfoExports(export_resolver_, xam_state_); - RegisterInputExports(export_resolver_, xam_state_); - RegisterNetExports(export_resolver_, xam_state_); - RegisterNotifyExports(export_resolver_, xam_state_); - RegisterUserExports(export_resolver_, xam_state_); - RegisterVideoExports(export_resolver_, xam_state_); + RegisterContentExports(export_resolver_, kernel_state); + RegisterInfoExports(export_resolver_, kernel_state); + RegisterInputExports(export_resolver_, kernel_state); + RegisterNetExports(export_resolver_, kernel_state); + RegisterNotifyExports(export_resolver_, kernel_state); + RegisterUserExports(export_resolver_, kernel_state); + RegisterVideoExports(export_resolver_, kernel_state); } XamModule::~XamModule() { - // Clear the shared XAM state. - shared_xam_state_ = NULL; } diff --git a/src/xenia/kernel/xam/xam_module.h b/src/xenia/kernel/xam_module.h similarity index 82% rename from src/xenia/kernel/xam/xam_module.h rename to src/xenia/kernel/xam_module.h index cb91bf9c6..4cfd76a7b 100644 --- a/src/xenia/kernel/xam/xam_module.h +++ b/src/xenia/kernel/xam_module.h @@ -15,30 +15,25 @@ #include #include -#include +#include // All of the exported functions: -#include +#include namespace xe { namespace kernel { -namespace xam { - -class XamState; class XamModule : public KernelModule { public: - XamModule(Emulator* emulator); + XamModule(Emulator* emulator, KernelState* kernel_state); virtual ~XamModule(); private: - XamState* xam_state_; }; -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_net.cc b/src/xenia/kernel/xam_net.cc similarity index 83% rename from src/xenia/kernel/xam/xam_net.cc rename to src/xenia/kernel/xam_net.cc index 060465c1b..177b4bf5d 100644 --- a/src/xenia/kernel/xam/xam_net.cc +++ b/src/xenia/kernel/xam_net.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -21,11 +21,10 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { SHIM_CALL NetDll_XNetStartup_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t one = SHIM_GET_ARG_32(0); uint32_t params_ptr = SHIM_GET_ARG_32(1); @@ -39,7 +38,7 @@ SHIM_CALL NetDll_XNetStartup_shim( SHIM_CALL NetDll_WSAStartup_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t one = SHIM_GET_ARG_32(0); uint32_t version = SHIM_GET_ARG_16(1); uint32_t data_ptr = SHIM_GET_ARG_32(2); @@ -65,7 +64,7 @@ SHIM_CALL NetDll_WSAStartup_shim( SHIM_CALL NetDll_XNetGetEthernetLinkStatus_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { // Games seem to call this before *Startup. If we return 0, they don't even // try. XELOGD( @@ -74,13 +73,12 @@ SHIM_CALL NetDll_XNetGetEthernetLinkStatus_shim( } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterNetExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", NetDll_XNetStartup, state); SHIM_SET_MAPPING("xam.xex", NetDll_WSAStartup, state); SHIM_SET_MAPPING("xam.xex", NetDll_XNetGetEthernetLinkStatus, state); diff --git a/src/xenia/kernel/xam/xam_net.h b/src/xenia/kernel/xam_net.h similarity index 95% rename from src/xenia/kernel/xam/xam_net.h rename to src/xenia/kernel/xam_net.h index fffadf725..3820b5d05 100644 --- a/src/xenia/kernel/xam/xam_net.h +++ b/src/xenia/kernel/xam_net.h @@ -18,12 +18,10 @@ namespace xe { namespace kernel { -namespace xam { -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_notify.cc b/src/xenia/kernel/xam_notify.cc similarity index 68% rename from src/xenia/kernel/xam/xam_notify.cc rename to src/xenia/kernel/xam_notify.cc index c271bc983..8ff4af196 100644 --- a/src/xenia/kernel/xam/xam_notify.cc +++ b/src/xenia/kernel/xam_notify.cc @@ -7,27 +7,25 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; using namespace xe::kernel; using namespace xe::kernel::xam; -using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xam { SHIM_CALL XamNotifyCreateListener_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint64_t mask = SHIM_GET_ARG_64(0); uint32_t one = SHIM_GET_ARG_32(1); @@ -38,15 +36,20 @@ SHIM_CALL XamNotifyCreateListener_shim( // r4=1 may indicate user process? - //return handle; + XNotifyListener* listener = new XNotifyListener(state); + listener->Initialize(mask); - SHIM_SET_RETURN(0); + // Handle ref is incremented, so return that. + uint32_t handle = listener->handle(); + listener->Release(); + + SHIM_SET_RETURN(handle); } // http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp SHIM_CALL XNotifyGetNext_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t handle = SHIM_GET_ARG_32(0); uint32_t match_id = SHIM_GET_ARG_32(1); uint32_t id_ptr = SHIM_GET_ARG_32(2); @@ -59,8 +62,18 @@ SHIM_CALL XNotifyGetNext_shim( id_ptr, param_ptr); - // get from handle - XNotifyListener* listener = 0; + if (!handle) { + SHIM_SET_RETURN(0); + return; + } + + // Grab listener. + XNotifyListener* listener = NULL; + if (XFAILED(state->object_table()->GetObject( + handle, (XObject**)&listener))) { + SHIM_SET_RETURN(0); + return; + } bool dequeued = false; uint32_t id = 0; @@ -74,6 +87,10 @@ SHIM_CALL XNotifyGetNext_shim( dequeued = listener->DequeueNotification(&id, ¶m); } + if (listener) { + listener->Release(); + } + if (dequeued) { SHIM_SET_MEM_32(id_ptr, id); SHIM_SET_MEM_32(param_ptr, param); @@ -83,13 +100,12 @@ SHIM_CALL XNotifyGetNext_shim( } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterNotifyExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XamNotifyCreateListener, state); SHIM_SET_MAPPING("xam.xex", XNotifyGetNext, state); } diff --git a/src/xenia/kernel/xam/xam_notify.h b/src/xenia/kernel/xam_notify.h similarity index 95% rename from src/xenia/kernel/xam/xam_notify.h rename to src/xenia/kernel/xam_notify.h index 0fcea77e4..8bf8b2c88 100644 --- a/src/xenia/kernel/xam/xam_notify.h +++ b/src/xenia/kernel/xam_notify.h @@ -18,12 +18,9 @@ namespace xe { namespace kernel { -namespace xam { - -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_ordinals.h b/src/xenia/kernel/xam_ordinals.h similarity index 95% rename from src/xenia/kernel/xam/xam_ordinals.h rename to src/xenia/kernel/xam_ordinals.h index 6941106ab..3c50ab2f7 100644 --- a/src/xenia/kernel/xam/xam_ordinals.h +++ b/src/xenia/kernel/xam_ordinals.h @@ -20,7 +20,7 @@ #include namespace ordinals { enum { - #include + #include }; } // namespace ordinals #include diff --git a/src/xenia/kernel/xam/xam_private.h b/src/xenia/kernel/xam_private.h similarity index 51% rename from src/xenia/kernel/xam/xam_private.h rename to src/xenia/kernel/xam_private.h index 1b0fe0da3..43953c5f8 100644 --- a/src/xenia/kernel/xam/xam_private.h +++ b/src/xenia/kernel/xam_private.h @@ -13,33 +13,25 @@ #include #include -#include +#include namespace xe { namespace kernel { + +class KernelState; + namespace xam { - -class XamState; - - -// This is a global object initialized with the XamModule. -// It references the current xam state object that all xam methods should -// be using to stash their variables. -extern XamState* shared_xam_state_; - - // Registration functions, one per file. -void RegisterContentExports(ExportResolver* export_resolver, XamState* state); -void RegisterInfoExports(ExportResolver* export_resolver, XamState* state); -void RegisterInputExports(ExportResolver* export_resolver, XamState* state); -void RegisterNetExports(ExportResolver* export_resolver, XamState* state); -void RegisterNotifyExports(ExportResolver* export_resolver, XamState* state); -void RegisterUserExports(ExportResolver* export_resolver, XamState* state); -void RegisterVideoExports(ExportResolver* export_resolver, XamState* state); - - +void RegisterContentExports(ExportResolver* export_resolver, KernelState* state); +void RegisterInfoExports(ExportResolver* export_resolver, KernelState* state); +void RegisterInputExports(ExportResolver* export_resolver, KernelState* state); +void RegisterNetExports(ExportResolver* export_resolver, KernelState* state); +void RegisterNotifyExports(ExportResolver* export_resolver, KernelState* state); +void RegisterUserExports(ExportResolver* export_resolver, KernelState* state); +void RegisterVideoExports(ExportResolver* export_resolver, KernelState* state); } // namespace xam + } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_table.inc b/src/xenia/kernel/xam_table.inc similarity index 100% rename from src/xenia/kernel/xam/xam_table.inc rename to src/xenia/kernel/xam_table.inc diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam_user.cc similarity index 79% rename from src/xenia/kernel/xam/xam_user.cc rename to src/xenia/kernel/xam_user.cc index 5ada0d93b..e1e015222 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam_user.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -21,11 +21,10 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { SHIM_CALL XamUserGetXUID_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t user_index = SHIM_GET_ARG_32(0); uint32_t xuid_ptr = SHIM_GET_ARG_32(1); @@ -43,7 +42,7 @@ SHIM_CALL XamUserGetXUID_shim( SHIM_CALL XamUserGetSigninState_shim( - PPCContext* ppc_state, XamState* state) { + PPCContext* ppc_state, KernelState* state) { uint32_t user_index = SHIM_GET_ARG_32(0); XELOGD( @@ -57,13 +56,12 @@ SHIM_CALL XamUserGetSigninState_shim( // XamUserReadProfileSettings -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterUserExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XamUserGetXUID, state); SHIM_SET_MAPPING("xam.xex", XamUserGetSigninState, state); } diff --git a/src/xenia/kernel/xam/xam_user.h b/src/xenia/kernel/xam_user.h similarity index 95% rename from src/xenia/kernel/xam/xam_user.h rename to src/xenia/kernel/xam_user.h index 802d78b94..d34a82d1e 100644 --- a/src/xenia/kernel/xam/xam_user.h +++ b/src/xenia/kernel/xam_user.h @@ -18,12 +18,9 @@ namespace xe { namespace kernel { -namespace xam { - -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_video.cc b/src/xenia/kernel/xam_video.cc similarity index 67% rename from src/xenia/kernel/xam/xam_video.cc rename to src/xenia/kernel/xam_video.cc index 6c2a684e6..b64e395c8 100644 --- a/src/xenia/kernel/xam/xam_video.cc +++ b/src/xenia/kernel/xam_video.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include #include @@ -23,22 +23,21 @@ using namespace xe::kernel::xam; namespace xe { namespace kernel { -namespace xam { SHIM_CALL XGetVideoMode_shim( - PPCContext* ppc_state, XamState* state) { - xe::kernel::xboxkrnl::X_VIDEO_MODE *video_mode = (xe::kernel::xboxkrnl::X_VIDEO_MODE*)SHIM_MEM_ADDR(SHIM_GET_ARG_32(0)); + PPCContext* ppc_state, KernelState* state) { + uint32_t video_mode_ptr = SHIM_GET_ARG_32(0); + X_VIDEO_MODE* video_mode = (X_VIDEO_MODE*)SHIM_MEM_ADDR(video_mode_ptr); xeVdQueryVideoMode(video_mode, true); } -} // namespace xam } // namespace kernel } // namespace xe void xe::kernel::xam::RegisterVideoExports( - ExportResolver* export_resolver, XamState* state) { + ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XGetVideoMode, state); } diff --git a/src/xenia/kernel/xam/xam_video.h b/src/xenia/kernel/xam_video.h similarity index 95% rename from src/xenia/kernel/xam/xam_video.h rename to src/xenia/kernel/xam_video.h index a70acfb0e..1bafb43ca 100644 --- a/src/xenia/kernel/xam/xam_video.h +++ b/src/xenia/kernel/xam_video.h @@ -18,12 +18,8 @@ namespace xe { namespace kernel { -namespace xam { - - -} // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/sources.gypi b/src/xenia/kernel/xboxkrnl/sources.gypi deleted file mode 100644 index 95fad3a1d..000000000 --- a/src/xenia/kernel/xboxkrnl/sources.gypi +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2013 Ben Vanik. All Rights Reserved. -{ - 'sources': [ - 'async_request.cc', - 'async_request.h', - 'kernel_state.cc', - 'kernel_state.h', - 'object_table.cc', - 'object_table.h', - 'xboxkrnl_audio.cc', - 'xboxkrnl_audio.h', - 'xboxkrnl_debug.cc', - 'xboxkrnl_debug.h', - 'xboxkrnl_hal.cc', - 'xboxkrnl_hal.h', - 'xboxkrnl_io.cc', - 'xboxkrnl_io.h', - 'xboxkrnl_memory.cc', - 'xboxkrnl_memory.h', - 'xboxkrnl_misc.cc', - 'xboxkrnl_misc.h', - 'xboxkrnl_module.cc', - 'xboxkrnl_module.h', - 'xboxkrnl_modules.cc', - 'xboxkrnl_modules.h', - 'xboxkrnl_nt.cc', - 'xboxkrnl_nt.h', - 'xboxkrnl_ob.cc', - 'xboxkrnl_ob.h', - 'xboxkrnl_ordinals.h', - 'xboxkrnl_private.h', - 'xboxkrnl_rtl.cc', - 'xboxkrnl_rtl.h', - 'xboxkrnl_table.inc', - 'xboxkrnl_threading.cc', - 'xboxkrnl_threading.h', - 'xboxkrnl_video.cc', - 'xboxkrnl_video.h', - 'xobject.cc', - 'xobject.h', - ], - - 'includes': [ - 'fs/sources.gypi', - 'objects/sources.gypi', - ], -} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc b/src/xenia/kernel/xboxkrnl_audio.cc similarity index 92% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc rename to src/xenia/kernel/xboxkrnl_audio.cc index f9bd35f11..00794d9f4 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc +++ b/src/xenia/kernel/xboxkrnl_audio.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include #include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -23,7 +23,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { SHIM_CALL XMACreateContext_shim( @@ -52,7 +51,6 @@ SHIM_CALL XMAReleaseContext_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.h b/src/xenia/kernel/xboxkrnl_audio.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_audio.h rename to src/xenia/kernel/xboxkrnl_audio.h index 24068e20a..c57498a7d 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.h +++ b/src/xenia/kernel/xboxkrnl_audio.h @@ -18,10 +18,8 @@ namespace xe { namespace kernel { -namespace xboxkrnl { -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc b/src/xenia/kernel/xboxkrnl_debug.cc similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc rename to src/xenia/kernel/xboxkrnl_debug.cc index 34097ed9e..a13eac5c8 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc +++ b/src/xenia/kernel/xboxkrnl_debug.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; @@ -22,7 +22,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { // TODO: clean me up! @@ -242,7 +241,6 @@ SHIM_CALL DbgBreakPoint_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.h b/src/xenia/kernel/xboxkrnl_debug.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_debug.h rename to src/xenia/kernel/xboxkrnl_debug.h index 8215ce34b..3d08ba531 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.h +++ b/src/xenia/kernel/xboxkrnl_debug.h @@ -18,13 +18,11 @@ namespace xe { namespace kernel { -namespace xboxkrnl { void xeDbgBreakPoint(); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc b/src/xenia/kernel/xboxkrnl_hal.cc similarity index 86% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc rename to src/xenia/kernel/xboxkrnl_hal.cc index 80b2c76a9..9234cbe81 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc +++ b/src/xenia/kernel/xboxkrnl_hal.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -21,7 +21,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { void xeHalReturnToFirmware(uint32_t routine) { @@ -53,7 +52,6 @@ SHIM_CALL HalReturnToFirmware_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.h b/src/xenia/kernel/xboxkrnl_hal.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_hal.h rename to src/xenia/kernel/xboxkrnl_hal.h index 8596ec64d..7e09fdf6f 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.h +++ b/src/xenia/kernel/xboxkrnl_hal.h @@ -18,13 +18,11 @@ namespace xe { namespace kernel { -namespace xboxkrnl { void xeHalReturnToFirmware(uint32_t routine); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl_io.cc similarity index 95% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc rename to src/xenia/kernel/xboxkrnl_io.cc index ad4ce5837..56794a523 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl_io.cc @@ -7,25 +7,23 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include using namespace xe; using namespace xe::kernel; -using namespace xe::kernel::xboxkrnl; -using namespace xe::kernel::xboxkrnl::fs; +using namespace xe::kernel::fs; namespace xe { namespace kernel { -namespace xboxkrnl { SHIM_CALL NtCreateFile_shim( @@ -389,7 +387,6 @@ SHIM_CALL NtQueryVolumeInformationFile_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.h b/src/xenia/kernel/xboxkrnl_io.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_io.h rename to src/xenia/kernel/xboxkrnl_io.h index 48a394947..84aecd8cc 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.h +++ b/src/xenia/kernel/xboxkrnl_io.h @@ -18,10 +18,8 @@ namespace xe { namespace kernel { -namespace xboxkrnl { -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc b/src/xenia/kernel/xboxkrnl_memory.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc rename to src/xenia/kernel/xboxkrnl_memory.cc index ea116f4df..5d9187bd5 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc +++ b/src/xenia/kernel/xboxkrnl_memory.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace alloy; @@ -22,7 +22,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { X_STATUS xeNtAllocateVirtualMemory( @@ -368,7 +367,6 @@ SHIM_CALL MmGetPhysicalAddress_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.h b/src/xenia/kernel/xboxkrnl_memory.h similarity index 96% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_memory.h rename to src/xenia/kernel/xboxkrnl_memory.h index b5ac87cb9..0796dd78b 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.h +++ b/src/xenia/kernel/xboxkrnl_memory.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { X_STATUS xeNtAllocateVirtualMemory( @@ -37,7 +36,6 @@ uint32_t xeMmQueryAddressProtect(uint32_t base_address); uint32_t xeMmGetPhysicalAddress(uint32_t base_address); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc b/src/xenia/kernel/xboxkrnl_misc.cc similarity index 85% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc rename to src/xenia/kernel/xboxkrnl_misc.cc index dc2f2b1f1..946aa30e9 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc +++ b/src/xenia/kernel/xboxkrnl_misc.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; @@ -22,7 +22,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { void xeKeBugCheckEx(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4) { @@ -49,7 +48,6 @@ SHIM_CALL KeBugCheckEx_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.h b/src/xenia/kernel/xboxkrnl_misc.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_misc.h rename to src/xenia/kernel/xboxkrnl_misc.h index b8399c61b..d0c9dd06d 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.h +++ b/src/xenia/kernel/xboxkrnl_misc.h @@ -18,10 +18,8 @@ namespace xe { namespace kernel { -namespace xboxkrnl { -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc b/src/xenia/kernel/xboxkrnl_module.cc similarity index 82% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc rename to src/xenia/kernel/xboxkrnl_module.cc index 50732b8f7..154c99edf 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc +++ b/src/xenia/kernel/xboxkrnl_module.cc @@ -7,16 +7,16 @@ ****************************************************************************** */ -#include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include using namespace xe; @@ -28,40 +28,29 @@ DEFINE_bool(abort_before_entry, false, "Abort execution right before launching the module."); -KernelState* xe::kernel::xboxkrnl::shared_kernel_state_ = NULL; - - -XboxkrnlModule::XboxkrnlModule(Emulator* emulator) : - KernelModule(emulator) { +XboxkrnlModule::XboxkrnlModule(Emulator* emulator, KernelState* kernel_state) : + KernelModule(emulator, kernel_state) { // Build the export table used for resolution. #include static KernelExport xboxkrnl_export_table[] = { - #include + #include }; #include export_resolver_->RegisterTable( "xboxkrnl.exe", xboxkrnl_export_table, XECOUNT(xboxkrnl_export_table)); - // Setup the kernel state instance. - // This is where all kernel objects are kept while running. - kernel_state_ = new KernelState(emulator); - - // Setup the shared global state object. - XEASSERTNULL(shared_kernel_state_); - shared_kernel_state_ = kernel_state_; - // Register all exported functions. - RegisterDebugExports(export_resolver_, kernel_state_); - RegisterHalExports(export_resolver_, kernel_state_); - RegisterIoExports(export_resolver_, kernel_state_); - RegisterMemoryExports(export_resolver_, kernel_state_); - RegisterMiscExports(export_resolver_, kernel_state_); - RegisterModuleExports(export_resolver_, kernel_state_); - RegisterNtExports(export_resolver_, kernel_state_); - RegisterObExports(export_resolver_, kernel_state_); + RegisterDebugExports(export_resolver_, kernel_state); + RegisterHalExports(export_resolver_, kernel_state); + RegisterIoExports(export_resolver_, kernel_state); + RegisterMemoryExports(export_resolver_, kernel_state); + RegisterMiscExports(export_resolver_, kernel_state); + RegisterModuleExports(export_resolver_, kernel_state); + RegisterNtExports(export_resolver_, kernel_state); + RegisterObExports(export_resolver_, kernel_state); RegisterRtlExports(export_resolver_, kernel_state_); - RegisterThreadingExports(export_resolver_, kernel_state_); - RegisterVideoExports(export_resolver_, kernel_state_); + RegisterThreadingExports(export_resolver_, kernel_state); + RegisterVideoExports(export_resolver_, kernel_state); uint8_t* mem = memory_->membase(); @@ -149,10 +138,6 @@ XboxkrnlModule::XboxkrnlModule(Emulator* emulator) : } XboxkrnlModule::~XboxkrnlModule() { - delete kernel_state_; - - // Clear the shared kernel state. - shared_kernel_state_ = NULL; } int XboxkrnlModule::LaunchModule(const char* path) { diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.h b/src/xenia/kernel/xboxkrnl_module.h similarity index 63% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_module.h rename to src/xenia/kernel/xboxkrnl_module.h index 223e3ad04..4453703f0 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.h +++ b/src/xenia/kernel/xboxkrnl_module.h @@ -15,40 +15,35 @@ #include #include -#include +#include // All of the exported functions: -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { class KernelState; class XboxkrnlModule : public KernelModule { public: - XboxkrnlModule(Emulator* emulator); + XboxkrnlModule(Emulator* emulator, KernelState* kernel_state); virtual ~XboxkrnlModule(); - KernelState* kernel_state() const { return kernel_state_; } - int LaunchModule(const char* path); private: - KernelState* kernel_state_; }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl_modules.cc similarity index 95% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc rename to src/xenia/kernel/xboxkrnl_modules.cc index 02838fdae..bc64e26bf 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl_modules.cc @@ -7,13 +7,13 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include using namespace xe; @@ -23,7 +23,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { X_STATUS xeExGetXConfigSetting( @@ -244,7 +243,6 @@ SHIM_CALL XexGetProcedureAddress_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.h b/src/xenia/kernel/xboxkrnl_modules.h similarity index 83% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_modules.h rename to src/xenia/kernel/xboxkrnl_modules.h index a76e12ce8..1c4997c31 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.h +++ b/src/xenia/kernel/xboxkrnl_modules.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_XBOXKRNL_MODULES_IMPL_H_ -#define XENIA_KERNEL_XBOXKRNL_MODULES_IMPL_H_ +#ifndef XENIA_KERNEL_XBOXKRNL_MODULES_H_ +#define XENIA_KERNEL_XBOXKRNL_MODULES_H_ #include #include @@ -18,7 +18,7 @@ namespace xe { namespace kernel { -namespace xboxkrnl { + X_STATUS xeExGetXConfigSetting( uint16_t category, uint16_t setting, void* buffer, uint16_t buffer_size, @@ -30,9 +30,8 @@ int xeXexGetModuleHandle(const char* module_name, X_HANDLE* module_handle_ptr); -} // namespace xboxkrnl } // namespace kernel } // namespace xe -#endif // XENIA_KERNEL_XBOXKRNL_MODULES_IMPL_H_ +#endif // XENIA_KERNEL_XBOXKRNL_MODULES_H_ diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_nt.cc b/src/xenia/kernel/xboxkrnl_nt.cc similarity index 80% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_nt.cc rename to src/xenia/kernel/xboxkrnl_nt.cc index 9ff1df1de..5da0cfa5b 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_nt.cc +++ b/src/xenia/kernel/xboxkrnl_nt.cc @@ -7,12 +7,12 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; @@ -22,7 +22,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { SHIM_CALL NtClose_shim( @@ -41,7 +40,6 @@ SHIM_CALL NtClose_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_nt.h b/src/xenia/kernel/xboxkrnl_nt.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_nt.h rename to src/xenia/kernel/xboxkrnl_nt.h index 0a42cef31..72ea2bef1 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_nt.h +++ b/src/xenia/kernel/xboxkrnl_nt.h @@ -18,10 +18,8 @@ namespace xe { namespace kernel { -namespace xboxkrnl { -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc b/src/xenia/kernel/xboxkrnl_ob.cc similarity index 88% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc rename to src/xenia/kernel/xboxkrnl_ob.cc index 0a9d4cfba..9062bc4d6 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc +++ b/src/xenia/kernel/xboxkrnl_ob.cc @@ -7,13 +7,13 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include using namespace xe; @@ -23,7 +23,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { SHIM_CALL ObReferenceObjectByHandle_shim( @@ -89,7 +88,6 @@ SHIM_CALL ObDereferenceObject_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.h b/src/xenia/kernel/xboxkrnl_ob.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_ob.h rename to src/xenia/kernel/xboxkrnl_ob.h index c56eef13f..0158fba73 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.h +++ b/src/xenia/kernel/xboxkrnl_ob.h @@ -18,10 +18,8 @@ namespace xe { namespace kernel { -namespace xboxkrnl { -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_ordinals.h b/src/xenia/kernel/xboxkrnl_ordinals.h similarity index 94% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_ordinals.h rename to src/xenia/kernel/xboxkrnl_ordinals.h index 7ec22c811..6a0f9f08e 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_ordinals.h +++ b/src/xenia/kernel/xboxkrnl_ordinals.h @@ -20,7 +20,7 @@ #include namespace ordinals { enum { - #include + #include }; } // namespace ordinals #include diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h b/src/xenia/kernel/xboxkrnl_private.h similarity index 86% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_private.h rename to src/xenia/kernel/xboxkrnl_private.h index cd0782ee2..41a5b6040 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h +++ b/src/xenia/kernel/xboxkrnl_private.h @@ -13,21 +13,15 @@ #include #include -#include +#include namespace xe { namespace kernel { -namespace xboxkrnl { class KernelState; - -// This is a global object initialized with the XboxkrnlModule. -// It references the current kernel state object that all kernel methods should -// be using to stash their variables. -extern KernelState* shared_kernel_state_; - +namespace xboxkrnl { // Registration functions, one per file. void RegisterAudioExports(ExportResolver* export_resolver, KernelState* state); void RegisterDebugExports(ExportResolver* export_resolver, KernelState* state); @@ -42,9 +36,8 @@ void RegisterRtlExports(ExportResolver* export_resolver, KernelState* state); void RegisterThreadingExports(ExportResolver* export_resolver, KernelState* state); void RegisterVideoExports(ExportResolver* export_resolver, KernelState* state); - - } // namespace xboxkrnl + } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl_rtl.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc rename to src/xenia/kernel/xboxkrnl_rtl.cc index 375a2e261..88646ce45 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl_rtl.cc @@ -7,14 +7,14 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include using namespace xe; @@ -24,7 +24,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { // http://msdn.microsoft.com/en-us/library/ff561778 @@ -867,7 +866,6 @@ SHIM_CALL RtlLeaveCriticalSection_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.h b/src/xenia/kernel/xboxkrnl_rtl.h similarity index 97% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.h rename to src/xenia/kernel/xboxkrnl_rtl.h index bb7228dac..7606be241 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.h +++ b/src/xenia/kernel/xboxkrnl_rtl.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { uint32_t xeRtlCompareMemory(uint32_t source1_ptr, uint32_t source2_ptr, @@ -49,7 +48,6 @@ uint32_t xeRtlTryEnterCriticalSection(uint32_t cs_ptr, uint32_t thread_id); void xeRtlLeaveCriticalSection(uint32_t cs_ptr); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_table.inc b/src/xenia/kernel/xboxkrnl_table.inc similarity index 100% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_table.inc rename to src/xenia/kernel/xboxkrnl_table.inc diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl_threading.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc rename to src/xenia/kernel/xboxkrnl_threading.cc index aafb3ff2a..f8ef3e72a 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl_threading.cc @@ -7,14 +7,14 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include using namespace xe; @@ -24,7 +24,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { // r13 + 0x100: pointer to thread local state @@ -868,7 +867,6 @@ SHIM_CALL KeLeaveCriticalRegion_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.h b/src/xenia/kernel/xboxkrnl_threading.h similarity index 97% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_threading.h rename to src/xenia/kernel/xboxkrnl_threading.h index 28d2c4bb8..dac0db9bc 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.h +++ b/src/xenia/kernel/xboxkrnl_threading.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { X_STATUS xeExCreateThread( @@ -59,7 +58,6 @@ void xeKeEnterCriticalRegion(); void xeKeLeaveCriticalRegion(); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc b/src/xenia/kernel/xboxkrnl_video.cc similarity index 98% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc rename to src/xenia/kernel/xboxkrnl_video.cc index 6cb209045..6f53fe91c 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc +++ b/src/xenia/kernel/xboxkrnl_video.cc @@ -7,15 +7,15 @@ ****************************************************************************** */ -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include using namespace xe; @@ -26,7 +26,6 @@ using namespace xe::kernel::xboxkrnl; namespace xe { namespace kernel { -namespace xboxkrnl { // http://www.tweakoz.com/orkid/ @@ -430,7 +429,6 @@ SHIM_CALL VdSwap_shim( } -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.h b/src/xenia/kernel/xboxkrnl_video.h similarity index 97% rename from src/xenia/kernel/xboxkrnl/xboxkrnl_video.h rename to src/xenia/kernel/xboxkrnl_video.h index 701b89d08..1a30d0849 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.h +++ b/src/xenia/kernel/xboxkrnl_video.h @@ -18,7 +18,6 @@ namespace xe { namespace kernel { -namespace xboxkrnl { // http://ffplay360.googlecode.com/svn/trunk/Common/XTLOnPC.h @@ -49,7 +48,6 @@ void xeVdSetGraphicsInterruptCallback(uint32_t callback, uint32_t user_data); void xeVdEnableRingBufferRPtrWriteBack(uint32_t ptr, uint32_t block_size); -} // namespace xboxkrnl } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xobject.cc b/src/xenia/kernel/xobject.cc similarity index 96% rename from src/xenia/kernel/xboxkrnl/xobject.cc rename to src/xenia/kernel/xobject.cc index c65ce92e3..5c8868404 100644 --- a/src/xenia/kernel/xboxkrnl/xobject.cc +++ b/src/xenia/kernel/xobject.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include +#include -#include -#include -#include +#include +#include +#include using namespace xe; diff --git a/src/xenia/kernel/xboxkrnl/xobject.h b/src/xenia/kernel/xobject.h similarity index 95% rename from src/xenia/kernel/xboxkrnl/xobject.h rename to src/xenia/kernel/xobject.h index ea7d3f83f..8660fcc0c 100644 --- a/src/xenia/kernel/xboxkrnl/xobject.h +++ b/src/xenia/kernel/xobject.h @@ -10,14 +10,13 @@ #ifndef XENIA_KERNEL_XBOXKRNL_XOBJECT_H_ #define XENIA_KERNEL_XBOXKRNL_XOBJECT_H_ -#include +#include #include namespace xe { namespace kernel { -namespace xboxkrnl { // http://www.nirsoft.net/kernel_struct/vista/DISPATCHER_HEADER.html @@ -81,7 +80,6 @@ private: }; -} // namespace xboxkrnl } // namespace kernel } // namespace xe