From d79bd8cfa7670338d9abf9ab6ecfa442c80a1918 Mon Sep 17 00:00:00 2001 From: gibbed Date: Tue, 15 Oct 2013 19:18:03 -0700 Subject: [PATCH] Renamed xboxkrnl_file* to xboxkrnl_nt*, added xboxkrnl_io*. --- src/xenia/kernel/modules/xboxkrnl/module.cc | 3 +- .../kernel/modules/xboxkrnl/sources.gypi | 6 ++- .../kernel/modules/xboxkrnl/xboxkrnl_io.cc | 37 +++++++++++++++++++ .../{xboxkrnl_file.h => xboxkrnl_io.h} | 6 +-- .../{xboxkrnl_file.cc => xboxkrnl_nt.cc} | 10 ++--- .../kernel/modules/xboxkrnl/xboxkrnl_nt.h | 29 +++++++++++++++ .../modules/xboxkrnl/xboxkrnl_private.h | 3 +- 7 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.cc rename src/xenia/kernel/modules/xboxkrnl/{xboxkrnl_file.h => xboxkrnl_io.h} (83%) rename src/xenia/kernel/modules/xboxkrnl/{xboxkrnl_file.cc => xboxkrnl_nt.cc} (96%) create mode 100644 src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.h diff --git a/src/xenia/kernel/modules/xboxkrnl/module.cc b/src/xenia/kernel/modules/xboxkrnl/module.cc index c49a7ffaf..245877057 100644 --- a/src/xenia/kernel/modules/xboxkrnl/module.cc +++ b/src/xenia/kernel/modules/xboxkrnl/module.cc @@ -52,11 +52,12 @@ XboxkrnlModule::XboxkrnlModule(Runtime* runtime) : // Register all exported functions. RegisterDebugExports(resolver, kernel_state_.get()); - RegisterFileExports(resolver, kernel_state_.get()); RegisterHalExports(resolver, kernel_state_.get()); + RegisterIoExports(resolver, kernel_state_.get()); RegisterMemoryExports(resolver, kernel_state_.get()); RegisterMiscExports(resolver, kernel_state_.get()); RegisterModuleExports(resolver, kernel_state_.get()); + RegisterNtExports(resolver, kernel_state_.get()); RegisterRtlExports(resolver, kernel_state_.get()); RegisterThreadingExports(resolver, kernel_state_.get()); RegisterVideoExports(resolver, kernel_state_.get()); diff --git a/src/xenia/kernel/modules/xboxkrnl/sources.gypi b/src/xenia/kernel/modules/xboxkrnl/sources.gypi index 173188924..2cf0db113 100644 --- a/src/xenia/kernel/modules/xboxkrnl/sources.gypi +++ b/src/xenia/kernel/modules/xboxkrnl/sources.gypi @@ -9,16 +9,18 @@ 'object_table.h', 'xboxkrnl_debug.cc', 'xboxkrnl_debug.h', - 'xboxkrnl_file.cc', - 'xboxkrnl_file.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_nt.cc', + 'xboxkrnl_nt.h', 'xboxkrnl_ordinals.h', 'xboxkrnl_private.h', 'xboxkrnl_rtl.cc', diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.cc new file mode 100644 index 000000000..766010c9d --- /dev/null +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.cc @@ -0,0 +1,37 @@ +/** + ****************************************************************************** + * 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 +#include +#include +#include + + +using namespace xe; +using namespace xe::kernel; +using namespace xe::kernel::xboxkrnl; + + +namespace xe { +namespace kernel { +namespace xboxkrnl { + + + + +} // namespace xboxkrnl +} // namespace kernel +} // namespace xe + + +void xe::kernel::xboxkrnl::RegisterIoExports( + ExportResolver* export_resolver, KernelState* state) { +} diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.h similarity index 83% rename from src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.h rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.h index 88ec0e027..6182ce295 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_io.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef XENIA_KERNEL_MODULES_XBOXKRNL_FILE_H_ -#define XENIA_KERNEL_MODULES_XBOXKRNL_FILE_H_ +#ifndef XENIA_KERNEL_MODULES_XBOXKRNL_IO_H_ +#define XENIA_KERNEL_MODULES_XBOXKRNL_IO_H_ #include #include @@ -26,4 +26,4 @@ namespace xboxkrnl { } // namespace xe -#endif // XENIA_KERNEL_MODULES_XBOXKRNL_FILE_H_ +#endif // XENIA_KERNEL_MODULES_XBOXKRNL_IO_H_ diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.cc similarity index 96% rename from src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.cc rename to src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.cc index c3a8623c9..3a74361c0 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_file.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include +#include #include #include @@ -54,7 +54,7 @@ SHIM_CALL NtCreateFile_shim( allocation_size_ptr, file_attributes, share_access, - creation_disposition); + creation_disposition); // object_attributes is: // void *root_directory @@ -104,11 +104,11 @@ SHIM_CALL NtClose_shim( } // namespace xe -void xe::kernel::xboxkrnl::RegisterFileExports( +void xe::kernel::xboxkrnl::RegisterNtExports( ExportResolver* export_resolver, KernelState* state) { + SHIM_SET_MAPPING("xboxkrnl.exe", NtClose, state); SHIM_SET_MAPPING("xboxkrnl.exe", NtCreateFile, state); + SHIM_SET_MAPPING("xboxkrnl.exe", NtQueryFullAttributesFile, state); SHIM_SET_MAPPING("xboxkrnl.exe", NtQueryInformationFile, state); SHIM_SET_MAPPING("xboxkrnl.exe", NtReadFile, state); - SHIM_SET_MAPPING("xboxkrnl.exe", NtQueryFullAttributesFile, state); - SHIM_SET_MAPPING("xboxkrnl.exe", NtClose, state); } diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.h new file mode 100644 index 000000000..713878de6 --- /dev/null +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_nt.h @@ -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. * + ****************************************************************************** + */ + +#ifndef XENIA_KERNEL_MODULES_XBOXKRNL_NT_H_ +#define XENIA_KERNEL_MODULES_XBOXKRNL_NT_H_ + +#include +#include + +#include + + +namespace xe { +namespace kernel { +namespace xboxkrnl { + + +} // namespace xboxkrnl +} // namespace kernel +} // namespace xe + + +#endif // XENIA_KERNEL_MODULES_XBOXKRNL_NT_H_ diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_private.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_private.h index 8a0a2559d..2513e7371 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_private.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_private.h @@ -30,11 +30,12 @@ extern KernelState* shared_kernel_state_; // Registration functions, one per file. void RegisterDebugExports(ExportResolver* export_resolver, KernelState* state); -void RegisterFileExports(ExportResolver* export_resolver, KernelState* state); void RegisterHalExports(ExportResolver* export_resolver, KernelState* state); +void RegisterIoExports(ExportResolver* export_resolver, KernelState* state); void RegisterMemoryExports(ExportResolver* export_resolver, KernelState* state); void RegisterMiscExports(ExportResolver* export_resolver, KernelState* state); void RegisterModuleExports(ExportResolver* export_resolver, KernelState* state); +void RegisterNtExports(ExportResolver* export_resolver, KernelState* state); void RegisterRtlExports(ExportResolver* export_resolver, KernelState* state); void RegisterThreadingExports(ExportResolver* export_resolver, KernelState* state);