Shuffling filesystem to xboxkrnl.

This doesn't really change anything yet, just moves things.
Also fixed some bad over-including.
This commit is contained in:
Ben Vanik 2013-10-15 23:09:51 -07:00
parent 26c06e13d9
commit da2f7f1ea5
31 changed files with 119 additions and 61 deletions

View File

@ -0,0 +1,29 @@
/**
******************************************************************************
* 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 <xenia/kernel/kernel_module.h>
#include <xenia/kernel/export.h>
#include <xenia/kernel/runtime.h>
using namespace xe;
using namespace xe::kernel;
KernelModule::KernelModule(Runtime* runtime) {
runtime_ = runtime;
memory_ = runtime->memory();
export_resolver_ = runtime->export_resolver();
}
KernelModule::~KernelModule() {
export_resolver_.reset();
xe_memory_release(memory_);
}

View File

@ -13,29 +13,19 @@
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/kernel/export.h>
#include <xenia/kernel/runtime.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
class ExportResolver;
class Runtime; class Runtime;
class KernelModule { class KernelModule {
public: public:
KernelModule(Runtime* runtime) { KernelModule(Runtime* runtime);
runtime_ = runtime; virtual ~KernelModule();
memory_ = runtime->memory();
export_resolver_ = runtime->export_resolver();
}
virtual ~KernelModule() {
export_resolver_.reset();
xe_memory_release(memory_);
}
protected: protected:
Runtime* runtime_; Runtime* runtime_;

View File

@ -10,6 +10,7 @@
#include <xenia/kernel/modules/xam/xam_info.h> #include <xenia/kernel/modules/xam/xam_info.h>
#include <xenia/kernel/shim_utils.h> #include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/modules/xam/xam_private.h> #include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/xam/xam_state.h> #include <xenia/kernel/modules/xam/xam_state.h>

View File

@ -21,6 +21,7 @@ namespace kernel {
namespace xboxkrnl { namespace xboxkrnl {
class XEvent; class XEvent;
class XObject;
class XAsyncRequest { class XAsyncRequest {

View File

@ -7,12 +7,12 @@
****************************************************************************** ******************************************************************************
*/ */
#include <xenia/kernel/fs/device.h> #include <xenia/kernel/modules/xboxkrnl/fs/device.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
Device::Device(const char* path) { Device::Device(const char* path) {

View File

@ -7,17 +7,18 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_DEVICE_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICE_H_
#define XENIA_KERNEL_FS_DEVICE_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICE_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/kernel/fs/entry.h> #include <xenia/kernel/modules/xboxkrnl/fs/entry.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -36,8 +37,9 @@ protected:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_DEVICE_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICE_H_

View File

@ -7,14 +7,14 @@
****************************************************************************** ******************************************************************************
*/ */
#include <xenia/kernel/fs/devices/disc_image_device.h> #include <xenia/kernel/modules/xboxkrnl/fs/devices/disc_image_device.h>
#include <xenia/kernel/fs/gdfx.h> #include <xenia/kernel/modules/xboxkrnl/fs/gdfx.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
namespace { namespace {

View File

@ -7,17 +7,18 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_
#define XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/kernel/fs/device.h> #include <xenia/kernel/modules/xboxkrnl/fs/device.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -41,8 +42,9 @@ private:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_DEVICES_DISC_IMAGE_DEVICE_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_DISC_IMAGE_DEVICE_H_

View File

@ -7,12 +7,12 @@
****************************************************************************** ******************************************************************************
*/ */
#include <xenia/kernel/fs/devices/local_directory_device.h> #include <xenia/kernel/modules/xboxkrnl/fs/devices/local_directory_device.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
namespace { namespace {

View File

@ -7,17 +7,18 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_
#define XENIA_KERNEL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/kernel/fs/device.h> #include <xenia/kernel/modules/xboxkrnl/fs/device.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -34,8 +35,9 @@ private:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_DEVICES_LOCAL_DIRECTORY_DEVICE_H_

View File

@ -7,12 +7,12 @@
****************************************************************************** ******************************************************************************
*/ */
#include <xenia/kernel/fs/entry.h> #include <xenia/kernel/modules/xboxkrnl/fs/entry.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
Entry::Entry(Type type, Device* device, const char* path) : Entry::Entry(Type type, Device* device, const char* path) :

View File

@ -7,8 +7,8 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_ENTRY_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_ENTRY_H_
#define XENIA_KERNEL_FS_ENTRY_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_ENTRY_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
@ -16,6 +16,7 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -81,8 +82,9 @@ public:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_ENTRY_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_ENTRY_H_

View File

@ -7,15 +7,15 @@
****************************************************************************** ******************************************************************************
*/ */
#include <xenia/kernel/fs/filesystem.h> #include <xenia/kernel/modules/xboxkrnl/fs/filesystem.h>
#include <xenia/kernel/fs/devices/disc_image_device.h> #include <xenia/kernel/modules/xboxkrnl/fs/devices/disc_image_device.h>
#include <xenia/kernel/fs/devices/local_directory_device.h> #include <xenia/kernel/modules/xboxkrnl/fs/devices/local_directory_device.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
FileSystem::FileSystem() { FileSystem::FileSystem() {

View File

@ -7,19 +7,20 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_FILESYSTEM_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_FILESYSTEM_H_
#define XENIA_KERNEL_FS_FILESYSTEM_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_FILESYSTEM_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <vector> #include <vector>
#include <xenia/kernel/fs/entry.h> #include <xenia/kernel/modules/xboxkrnl/fs/entry.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -48,8 +49,9 @@ private:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_FILESYSTEM_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_FILESYSTEM_H_

View File

@ -9,12 +9,12 @@
* - abgx360 * - abgx360
*/ */
#include <xenia/kernel/fs/gdfx.h> #include <xenia/kernel/modules/xboxkrnl/fs/gdfx.h>
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
namespace { namespace {

View File

@ -7,19 +7,20 @@
****************************************************************************** ******************************************************************************
*/ */
#ifndef XENIA_KERNEL_FS_GDFX_H_ #ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FS_GDFX_H_
#define XENIA_KERNEL_FS_GDFX_H_ #define XENIA_KERNEL_MODULES_XBOXKRNL_FS_GDFX_H_
#include <xenia/common.h> #include <xenia/common.h>
#include <xenia/core.h> #include <xenia/core.h>
#include <vector> #include <vector>
#include <xenia/kernel/fs/entry.h> #include <xenia/kernel/modules/xboxkrnl/fs/entry.h>
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl {
namespace fs { namespace fs {
@ -98,8 +99,9 @@ private:
} // namespace fs } // namespace fs
} // namespace xboxkrnl
} // namespace kernel } // namespace kernel
} // namespace xe } // namespace xe
#endif // XENIA_KERNEL_FS_GDFX_H_ #endif // XENIA_KERNEL_MODULES_XBOXKRNL_FS_GDFX_H_

View File

@ -9,6 +9,7 @@
#include <xenia/kernel/modules/xboxkrnl/kernel_state.h> #include <xenia/kernel/modules/xboxkrnl/kernel_state.h>
#include <xenia/kernel/runtime.h>
#include <xenia/kernel/modules/xboxkrnl/xobject.h> #include <xenia/kernel/modules/xboxkrnl/xobject.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h> #include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xthread.h> #include <xenia/kernel/modules/xboxkrnl/objects/xthread.h>

View File

@ -16,16 +16,25 @@
#include <xenia/kernel/export.h> #include <xenia/kernel/export.h>
#include <xenia/kernel/kernel_module.h> #include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/xbox.h> #include <xenia/kernel/xbox.h>
#include <xenia/kernel/fs/filesystem.h>
#include <xenia/kernel/modules/xboxkrnl/object_table.h> #include <xenia/kernel/modules/xboxkrnl/object_table.h>
#include <xenia/kernel/modules/xboxkrnl/fs/filesystem.h>
namespace xe {
namespace cpu {
class Processor;
}
}
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl { namespace xboxkrnl {
class XModule; class XModule;
namespace fs {
class FileSystem;
}
class KernelState { class KernelState {

View File

@ -14,8 +14,8 @@
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs;
using namespace xe::kernel::xboxkrnl; using namespace xe::kernel::xboxkrnl;
using namespace xe::kernel::xboxkrnl::fs;
XFile::XFile(KernelState* kernel_state, FileEntry* entry) : XFile::XFile(KernelState* kernel_state, FileEntry* entry) :

View File

@ -13,8 +13,8 @@
#include <xenia/kernel/modules/xboxkrnl/xobject.h> #include <xenia/kernel/modules/xboxkrnl/xobject.h>
#include <xenia/kernel/xbox.h> #include <xenia/kernel/xbox.h>
#include <xenia/kernel/fs/entry.h>
#include <xenia/kernel/modules/xboxkrnl/async_request.h> #include <xenia/kernel/modules/xboxkrnl/async_request.h>
#include <xenia/kernel/modules/xboxkrnl/fs/entry.h>
namespace xe { namespace xe {

View File

@ -9,6 +9,8 @@
#include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h> #include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h>
#include <xenia/cpu/cpu.h>
#include <xenia/kernel/runtime.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xthread.h> #include <xenia/kernel/modules/xboxkrnl/objects/xthread.h>

View File

@ -9,6 +9,7 @@
#include <xenia/kernel/modules/xboxkrnl/objects/xthread.h> #include <xenia/kernel/modules/xboxkrnl/objects/xthread.h>
#include <xenia/cpu/cpu.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xevent.h> #include <xenia/kernel/modules/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h> #include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h>

View File

@ -15,6 +15,13 @@
#include <xenia/kernel/xbox.h> #include <xenia/kernel/xbox.h>
namespace xe {
namespace cpu {
class ThreadState;
}
}
namespace xe { namespace xe {
namespace kernel { namespace kernel {
namespace xboxkrnl { namespace xboxkrnl {

View File

@ -37,6 +37,7 @@
], ],
'includes': [ 'includes': [
'fs/sources.gypi',
'objects/sources.gypi', 'objects/sources.gypi',
], ],
} }

View File

@ -17,8 +17,8 @@
using namespace xe; using namespace xe;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs;
using namespace xe::kernel::xboxkrnl; using namespace xe::kernel::xboxkrnl;
using namespace xe::kernel::xboxkrnl::fs;
namespace xe { namespace xe {

View File

@ -9,6 +9,7 @@
#include <xenia/kernel/modules/xboxkrnl/xboxkrnl_video.h> #include <xenia/kernel/modules/xboxkrnl/xboxkrnl_video.h>
#include <xenia/cpu/cpu.h>
#include <xenia/gpu/gpu.h> #include <xenia/gpu/gpu.h>
#include <xenia/kernel/shim_utils.h> #include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/modules/xboxkrnl/kernel_state.h> #include <xenia/kernel/modules/xboxkrnl/kernel_state.h>

View File

@ -10,12 +10,13 @@
#include <xenia/kernel/runtime.h> #include <xenia/kernel/runtime.h>
#include <xenia/kernel/modules/modules.h> #include <xenia/kernel/modules/modules.h>
#include <xenia/kernel/modules/xboxkrnl/fs/filesystem.h>
using namespace xe; using namespace xe;
using namespace xe::cpu; using namespace xe::cpu;
using namespace xe::kernel; using namespace xe::kernel;
using namespace xe::kernel::fs; using namespace xe::kernel::xboxkrnl::fs;
Runtime::Runtime(shared_ptr<cpu::Processor> processor, Runtime::Runtime(shared_ptr<cpu::Processor> processor,

View File

@ -16,7 +16,6 @@
#include <xenia/kernel/export.h> #include <xenia/kernel/export.h>
#include <xenia/kernel/xex2.h> #include <xenia/kernel/xex2.h>
#include <xenia/kernel/fs/filesystem.h>
namespace xe { namespace xe {
@ -26,6 +25,9 @@ namespace cpu {
namespace kernel { namespace kernel {
namespace xboxkrnl { namespace xboxkrnl {
class XboxkrnlModule; class XboxkrnlModule;
namespace fs {
class FileSystem;
}
} }
namespace xam { namespace xam {
class XamModule; class XamModule;
@ -50,7 +52,7 @@ public:
xe_memory_ref memory(); xe_memory_ref memory();
shared_ptr<cpu::Processor> processor(); shared_ptr<cpu::Processor> processor();
shared_ptr<ExportResolver> export_resolver(); shared_ptr<ExportResolver> export_resolver();
shared_ptr<fs::FileSystem> filesystem(); shared_ptr<xboxkrnl::fs::FileSystem> filesystem();
int LaunchXexFile(const xechar_t* path); int LaunchXexFile(const xechar_t* path);
int LaunchDiscImage(const xechar_t* path); int LaunchDiscImage(const xechar_t* path);
@ -61,7 +63,7 @@ private:
xe_memory_ref memory_; xe_memory_ref memory_;
shared_ptr<cpu::Processor> processor_; shared_ptr<cpu::Processor> processor_;
shared_ptr<ExportResolver> export_resolver_; shared_ptr<ExportResolver> export_resolver_;
shared_ptr<fs::FileSystem> filesystem_; shared_ptr<xboxkrnl::fs::FileSystem> filesystem_;
auto_ptr<xboxkrnl::XboxkrnlModule> xboxkrnl_; auto_ptr<xboxkrnl::XboxkrnlModule> xboxkrnl_;
auto_ptr<xam::XamModule> xam_; auto_ptr<xam::XamModule> xam_;

View File

@ -4,6 +4,7 @@
'export.cc', 'export.cc',
'export.h', 'export.h',
'kernel.h', 'kernel.h',
'kernel_module.cc',
'kernel_module.h', 'kernel_module.h',
'runtime.cc', 'runtime.cc',
'runtime.h', 'runtime.h',
@ -15,7 +16,6 @@
], ],
'includes': [ 'includes': [
'fs/sources.gypi',
'modules/sources.gypi', 'modules/sources.gypi',
'util/sources.gypi', 'util/sources.gypi',
], ],