Moving all kernel files around just to fuck with whoever's keeping track ;)

This commit is contained in:
Ben Vanik 2014-01-04 17:12:46 -08:00
parent aad4d7bebf
commit 4d92720109
108 changed files with 449 additions and 677 deletions

View File

@ -12,7 +12,7 @@
#include <alloy/runtime/module.h>
#include <xenia/core.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/util/xex2.h>
namespace xe {

View File

@ -17,9 +17,9 @@
#include <xenia/debug/debug_server.h>
#include <xenia/debug/debug_target.h>
#include <xenia/debug/protocols/ws/simple_sha1.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_module.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_module.h>
#include <xenia/kernel/objects/xmodule.h>
#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) :

View File

@ -16,8 +16,9 @@
#include <xenia/gpu/gpu.h>
#include <xenia/hid/hid.h>
#include <xenia/kernel/kernel.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/modules.h>
#include <xenia/kernel/xboxkrnl/fs/filesystem.h>
#include <xenia/kernel/fs/filesystem.h>
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_;
@ -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.

View File

@ -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_;
};

View File

@ -7,16 +7,15 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/async_request.h>
#include <xenia/kernel/async_request.h>
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/xobject.h>
#include <xenia/kernel/objects/xevent.h>
using namespace std;
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
XAsyncRequest::XAsyncRequest(

View File

@ -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

View File

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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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_

View File

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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/fs/device.h>
#include <xenia/kernel/fs/device.h>
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_

View File

@ -7,16 +7,15 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.h>
#include <xenia/kernel/fs/devices/disc_image_entry.h>
#include <xenia/kernel/xboxkrnl/fs/gdfx.h>
#include <xenia/kernel/xboxkrnl/fs/devices/disc_image_file.h>
#include <xenia/kernel/fs/gdfx.h>
#include <xenia/kernel/fs/devices/disc_image_file.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
using namespace xe::kernel::xboxkrnl::fs;
using namespace xe::kernel::fs;
namespace {

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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_

View File

@ -7,16 +7,15 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/fs/devices/disc_image_file.h>
#include <xenia/kernel/fs/devices/disc_image_file.h>
#include <xenia/kernel/xboxkrnl/fs/gdfx.h>
#include <xenia/kernel/xboxkrnl/fs/devices/disc_image_entry.h>
#include <xenia/kernel/fs/gdfx.h>
#include <xenia/kernel/fs/devices/disc_image_entry.h>
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(

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/objects/xfile.h>
#include <xenia/kernel/objects/xfile.h>
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_

View File

@ -7,14 +7,14 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/fs/devices/host_path_device.h>
#include <xenia/kernel/fs/devices/host_path_device.h>
#include <xenia/kernel/xboxkrnl/fs/devices/host_path_entry.h>
#include <xenia/kernel/fs/devices/host_path_entry.h>
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) :

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/fs/device.h>
#include <xenia/kernel/fs/device.h>
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_

View File

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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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_

View File

@ -7,15 +7,14 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/fs/devices/host_path_file.h>
#include <xenia/kernel/fs/devices/host_path_file.h>
#include <xenia/kernel/xboxkrnl/fs/devices/host_path_entry.h>
#include <xenia/kernel/fs/devices/host_path_entry.h>
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(

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/objects/xfile.h>
#include <xenia/kernel/objects/xfile.h>
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_

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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) :

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
@ -16,14 +16,13 @@
#include <xenia/xbox.h>
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_

View File

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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <vector>
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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_

View File

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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
@ -16,12 +16,11 @@
#include <vector>
#include <xenia/xbox.h>
#include <xenia/kernel/xboxkrnl/fs/entry.h>
#include <xenia/kernel/fs/entry.h>
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_

View File

@ -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();
}

View File

@ -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_;
};

View File

@ -7,18 +7,23 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/emulator.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/xobject.h>
#include <xenia/kernel/objects/xmodule.h>
#include <xenia/kernel/objects/xthread.h>
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() {

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
@ -16,18 +16,17 @@
#include <xenia/export_resolver.h>
#include <xenia/xbox.h>
#include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/xboxkrnl/object_table.h>
#include <xenia/kernel/xboxkrnl/fs/filesystem.h>
#include <xenia/kernel/object_table.h>
#include <xenia/kernel/fs/filesystem.h>
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_

View File

@ -10,7 +10,7 @@
#ifndef XENIA_KERNEL_MODULES_H_
#define XENIA_KERNEL_MODULES_H_
#include <xenia/kernel/xam/xam_module.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_module.h>
#include <xenia/kernel/xam_module.h>
#include <xenia/kernel/xboxkrnl_module.h>
#endif // XENIA_KERNEL_MODULES_H_

View File

@ -7,15 +7,14 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/object_table.h>
#include <xenia/kernel/object_table.h>
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/xobject.h>
#include <xenia/kernel/objects/xthread.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
ObjectTable::ObjectTable() :

View File

@ -18,7 +18,6 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
class XObject;
@ -47,7 +46,6 @@ private:
};
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,12 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/objects/xevent.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
XEvent::XEvent(KernelState* kernel_state) :

View File

@ -10,14 +10,13 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XEVENT_H_
#define XENIA_KERNEL_XBOXKRNL_XEVENT_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xboxkrnl {
class XEvent : public XObject {
@ -40,7 +39,6 @@ private:
};
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,15 +7,14 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xfile.h>
#include <xenia/kernel/objects/xfile.h>
#include <xenia/kernel/xboxkrnl/async_request.h>
#include <xenia/kernel/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/async_request.h>
#include <xenia/kernel/objects/xevent.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
XFile::XFile(KernelState* kernel_state, uint32_t desired_access) :

View File

@ -10,14 +10,13 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XFILE_H_
#define XENIA_KERNEL_XBOXKRNL_XFILE_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xboxkrnl {
class XAsyncRequest;
class XEvent;
@ -79,7 +78,6 @@ private:
};
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,17 +7,16 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/objects/xmodule.h>
#include <xenia/emulator.h>
#include <xenia/cpu/cpu.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/objects/xthread.h>
using namespace xe;
using namespace xe::cpu;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
namespace {

View File

@ -10,18 +10,17 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XMODULE_H_
#define XENIA_KERNEL_XBOXKRNL_XMODULE_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <vector>
#include <xenia/export_resolver.h>
#include <xenia/xbox.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/util/xex2.h>
namespace xe {
namespace kernel {
namespace xboxkrnl {
class XModule : public XObject {
@ -54,7 +53,6 @@ private:
};
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,12 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xnotify_listener.h>
#include <xenia/kernel/objects/xnotify_listener.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
XNotifyListener::XNotifyListener(KernelState* kernel_state) :

View File

@ -13,14 +13,13 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_
#define XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <xenia/xbox.h>
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

View File

@ -7,12 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xsemaphore.h>
#include <xenia/kernel/objects/xsemaphore.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
XSemaphore::XSemaphore(KernelState* kernel_state) :

View File

@ -10,14 +10,13 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#define XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xboxkrnl {
class XSemaphore : public XObject {
@ -38,7 +37,6 @@ private:
};
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,19 +7,18 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/objects/xthread.h>
#include <xenia/cpu/cpu.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_threading.h>
#include <xenia/kernel/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/xboxkrnl_threading.h>
#include <xenia/kernel/objects/xevent.h>
#include <xenia/kernel/objects/xmodule.h>
using namespace alloy;
using namespace xe;
using namespace xe::cpu;
using namespace xe::kernel;
using namespace xe::kernel::xboxkrnl;
namespace {

View File

@ -10,7 +10,7 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XTHREAD_H_
#define XENIA_KERNEL_XBOXKRNL_XTHREAD_H_
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xobject.h>
#include <xenia/xbox.h>
@ -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

View File

@ -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',
],
}

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
@ -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_

View File

@ -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',
],
}

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/util/xex2.h>
#include <vector>

View File

@ -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 <xenia/core.h>
#include <xenia/kernel/xex2_info.h>
#include <xenia/kernel/util/xex2_info.h>
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_

View File

@ -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',
],
}

View File

@ -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 <xenia/kernel/xam/xam_state.h>
#include <xenia/emulator.h>
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() {
}

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
#include <xenia/export_resolver.h>
#include <xenia/kernel/kernel_module.h>
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_

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_content.h>
#include <xenia/kernel/xam_content.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
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);
}

View File

@ -18,12 +18,10 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_info.h>
#include <xenia/kernel/xam_info.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
#include <xenia/kernel/util/xex2.h>
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);

View File

@ -18,12 +18,10 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -7,13 +7,13 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_input.h>
#include <xenia/kernel/xam_input.h>
#include <xenia/emulator.h>
#include <xenia/hid/hid.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
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);

View File

@ -18,12 +18,10 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_module.h>
#include <xenia/kernel/xam_module.h>
#include <xenia/export_resolver.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
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 <xenia/kernel/util/export_table_pre.inc>
static KernelExport xam_export_table[] = {
#include <xenia/kernel/xam/xam_table.inc>
#include <xenia/kernel/xam_table.inc>
};
#include <xenia/kernel/util/export_table_post.inc>
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;
}

View File

@ -15,30 +15,25 @@
#include <xenia/export_resolver.h>
#include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/xam/xam_ordinals.h>
#include <xenia/kernel/xam_ordinals.h>
// All of the exported functions:
#include <xenia/kernel/xam/xam_info.h>
#include <xenia/kernel/xam_info.h>
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

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_net.h>
#include <xenia/kernel/xam_net.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
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);

View File

@ -18,12 +18,10 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -7,27 +7,25 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_notify.h>
#include <xenia/kernel/xam_notify.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/xboxkrnl/objects/xnotify_listener.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/objects/xnotify_listener.h>
#include <xenia/kernel/util/shim_utils.h>
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, &param);
}
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);
}

View File

@ -18,12 +18,9 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -20,7 +20,7 @@
#include <xenia/kernel/util/ordinal_table_pre.inc>
namespace ordinals {
enum {
#include <xenia/kernel/xam/xam_table.inc>
#include <xenia/kernel/xam_table.inc>
};
} // namespace ordinals
#include <xenia/kernel/util/ordinal_table_post.inc>

View File

@ -13,33 +13,25 @@
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xam/xam_ordinals.h>
#include <xenia/kernel/xam_ordinals.h>
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

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_user.h>
#include <xenia/kernel/xam_user.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
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);
}

View File

@ -18,12 +18,9 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xam/xam_video.h>
#include <xenia/kernel/xam_video.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xam_private.h>
#include <xenia/kernel/util/shim_utils.h>
#include <xenia/kernel/modules.h>
@ -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);
}

View File

@ -18,12 +18,8 @@
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -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',
],
}

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_audio.h>
#include <xenia/kernel/xboxkrnl_audio.h>
#include <xenia/apu/apu.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,10 +18,8 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_debug.h>
#include <xenia/kernel/xboxkrnl_debug.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xthread.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,13 +18,11 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
void xeDbgBreakPoint();
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_hal.h>
#include <xenia/kernel/xboxkrnl_hal.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,13 +18,11 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
void xeHalReturnToFirmware(uint32_t routine);
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,25 +7,23 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_io.h>
#include <xenia/kernel/xboxkrnl_io.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/async_request.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xevent.h>
#include <xenia/kernel/xboxkrnl/objects/xfile.h>
#include <xenia/kernel/async_request.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xevent.h>
#include <xenia/kernel/objects/xfile.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,10 +18,8 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,11 +7,11 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_memory.h>
#include <xenia/kernel/xboxkrnl_memory.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -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

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_misc.h>
#include <xenia/kernel/xboxkrnl_misc.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xthread.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,10 +18,8 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,16 +7,16 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_module.h>
#include <xenia/kernel/xboxkrnl_module.h>
#include <gflags/gflags.h>
#include <xenia/emulator.h>
#include <xenia/export_resolver.h>
#include <xenia/debug/debug_server.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xmodule.h>
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 <xenia/kernel/util/export_table_pre.inc>
static KernelExport xboxkrnl_export_table[] = {
#include <xenia/kernel/xboxkrnl/xboxkrnl_table.inc>
#include <xenia/kernel/xboxkrnl_table.inc>
};
#include <xenia/kernel/util/export_table_post.inc>
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) {

View File

@ -15,40 +15,35 @@
#include <xenia/export_resolver.h>
#include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_ordinals.h>
#include <xenia/kernel/xboxkrnl_ordinals.h>
// All of the exported functions:
#include <xenia/kernel/xboxkrnl/xboxkrnl_debug.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_hal.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_memory.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_module.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_rtl.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_threading.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_video.h>
#include <xenia/kernel/xboxkrnl_debug.h>
#include <xenia/kernel/xboxkrnl_hal.h>
#include <xenia/kernel/xboxkrnl_memory.h>
#include <xenia/kernel/xboxkrnl_module.h>
#include <xenia/kernel/xboxkrnl_rtl.h>
#include <xenia/kernel/xboxkrnl_threading.h>
#include <xenia/kernel/xboxkrnl_video.h>
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

View File

@ -7,13 +7,13 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_modules.h>
#include <xenia/kernel/xboxkrnl_modules.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xmodule.h>
#include <xenia/kernel/util/shim_utils.h>
#include <xenia/kernel/util/xex2.h>
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

View File

@ -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 <xenia/common.h>
#include <xenia/core.h>
@ -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_

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_nt.h>
#include <xenia/kernel/xboxkrnl_nt.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/xobject.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,10 +18,8 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -7,13 +7,13 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_ob.h>
#include <xenia/kernel/xboxkrnl_ob.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/xobject.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/xobject.h>
#include <xenia/kernel/objects/xthread.h>
#include <xenia/kernel/util/shim_utils.h>
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

View File

@ -18,10 +18,8 @@
namespace xe {
namespace kernel {
namespace xboxkrnl {
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe

View File

@ -20,7 +20,7 @@
#include <xenia/kernel/util/ordinal_table_pre.inc>
namespace ordinals {
enum {
#include <xenia/kernel/xboxkrnl/xboxkrnl_table.inc>
#include <xenia/kernel/xboxkrnl_table.inc>
};
} // namespace ordinals
#include <xenia/kernel/util/ordinal_table_post.inc>

View File

@ -13,21 +13,15 @@
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_ordinals.h>
#include <xenia/kernel/xboxkrnl_ordinals.h>
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

View File

@ -7,14 +7,14 @@
******************************************************************************
*/
#include <xenia/kernel/xboxkrnl/xboxkrnl_rtl.h>
#include <xenia/kernel/xboxkrnl_rtl.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/xboxkrnl/kernel_state.h>
#include <xenia/kernel/xboxkrnl/xboxkrnl_private.h>
#include <xenia/kernel/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/xboxkrnl/objects/xthread.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xmodule.h>
#include <xenia/kernel/objects/xthread.h>
#include <xenia/kernel/util/shim_utils.h>
#include <xenia/kernel/util/xex2.h>
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

Some files were not shown because too many files have changed in this diff Show More